Struct relay_metrics::BucketsView
source · pub struct BucketsView<T> { /* private fields */ }
Expand description
A view into a slice of metric buckets.
The view can be used to iterate over a large slice of metric data slicing even into the buckets themselves.
Full View
/---------------------------------------------\
[[C:1], [C:12], [D:0, 1, 2, 3, 5, 5], [S:42, 75]]
\--------------------------/ \---------------/
View 1 View 2
Iterating over a BucketsView
yields BucketView
items,
only the first and last elements may be partial buckets.
In the above example View 1
has a partial bucket at the end and
View 2
has a partial bucket in the beginning.
Using the above example, iterating over View 1
yields the buckets:
[C:1], [C:12], [D:0, 1, 2, 3]
.
Implementations§
source§impl<T> BucketsView<T>
impl<T> BucketsView<T>
sourcepub fn as_slice(&self) -> BucketsView<&[Bucket]>
pub fn as_slice(&self) -> BucketsView<&[Bucket]>
Returns the same bucket view as a bucket view over a slice.
sourcepub fn iter(&self) -> BucketsViewIter<'_> ⓘ
pub fn iter(&self) -> BucketsViewIter<'_> ⓘ
Iterator over all buckets in the view.
sourcepub fn by_size(self, size_in_bytes: usize) -> BucketsViewBySizeIter<T> ⓘ
pub fn by_size(self, size_in_bytes: usize) -> BucketsViewBySizeIter<T> ⓘ
Iterator which slices the source view into segments with an approximate size of size_in_bytes
.
Trait Implementations§
source§impl<T: Clone> Clone for BucketsView<T>
impl<T: Clone> Clone for BucketsView<T>
source§fn clone(&self) -> BucketsView<T>
fn clone(&self) -> BucketsView<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for BucketsView<T>
impl<T> Debug for BucketsView<T>
source§impl<'a, T> IntoIterator for &'a BucketsView<T>
impl<'a, T> IntoIterator for &'a BucketsView<T>
source§impl<'a> IntoIterator for BucketsView<&'a [Bucket]>
impl<'a> IntoIterator for BucketsView<&'a [Bucket]>
source§impl<T> Serialize for BucketsView<T>
impl<T> Serialize for BucketsView<T>
impl<T: Copy> Copy for BucketsView<T>
Auto Trait Implementations§
impl<T> Freeze for BucketsView<T>where
T: Freeze,
impl<T> RefUnwindSafe for BucketsView<T>where
T: RefUnwindSafe,
impl<T> Send for BucketsView<T>where
T: Send,
impl<T> Sync for BucketsView<T>where
T: Sync,
impl<T> Unpin for BucketsView<T>where
T: Unpin,
impl<T> UnwindSafe for BucketsView<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)