pub enum ArrayContent<T> {
Values(Vec<T>),
LinearHistogram(LinearHistogram<T>),
ExponentialHistogram(ExponentialHistogram<T>),
}
Expand description
Represents the content of a DiagnosticsHierarchy array property: a regular array or a linear/exponential histogram.
Variants§
Values(Vec<T>)
The contents of an array.
LinearHistogram(LinearHistogram<T>)
The data for a linear histogram.
ExponentialHistogram(ExponentialHistogram<T>)
Implementations§
Source§impl<T> ArrayContent<T>
impl<T> ArrayContent<T>
Sourcepub fn new(
values: Vec<T>,
format: ArrayFormat,
) -> Result<ArrayContent<T>, Error>
pub fn new( values: Vec<T>, format: ArrayFormat, ) -> Result<ArrayContent<T>, Error>
Creates a new ArrayContent parsing the values
based on the given format
.
Sourcepub fn raw_values(&self) -> Cow<'_, Vec<T>>
pub fn raw_values(&self) -> Cow<'_, Vec<T>>
Returns the raw values of this Array content. In the case of a histogram, returns the bucket counts.
Trait Implementations§
Source§impl<T> Clone for ArrayContent<T>where
T: Clone,
impl<T> Clone for ArrayContent<T>where
T: Clone,
Source§fn clone(&self) -> ArrayContent<T>
fn clone(&self) -> ArrayContent<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> CondensableOnDemand for ArrayContent<T>
impl<T> CondensableOnDemand for ArrayContent<T>
fn condense_histogram(&mut self)
Source§impl<T> Debug for ArrayContent<T>where
T: Debug,
impl<T> Debug for ArrayContent<T>where
T: Debug,
Source§impl<T> PartialEq for ArrayContent<T>where
T: PartialEq,
impl<T> PartialEq for ArrayContent<T>where
T: PartialEq,
Source§impl Serialize for ArrayContent<f64>
impl Serialize for ArrayContent<f64>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Serialize for ArrayContent<i64>
impl Serialize for ArrayContent<i64>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Serialize for ArrayContent<u64>
impl Serialize for ArrayContent<u64>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> StructuralPartialEq for ArrayContent<T>
Auto Trait Implementations§
impl<T> Freeze for ArrayContent<T>where
T: Freeze,
impl<T> RefUnwindSafe for ArrayContent<T>where
T: RefUnwindSafe,
impl<T> Send for ArrayContent<T>where
T: Send,
impl<T> Sync for ArrayContent<T>where
T: Sync,
impl<T> Unpin for ArrayContent<T>where
T: Unpin,
impl<T> UnwindSafe for ArrayContent<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
)