pub struct EnumStateRecorder<T: RecordableEnum> { /* private fields */ }Expand description
Records time series data for an enum-valued state. This is best-suited for categorical observations, where the name of the state and not a numeric value will be most relevant for diagnostic and forensic purposes.
Implementations§
Source§impl<T: RecordableEnum + 'static> EnumStateRecorder<T>
impl<T: RecordableEnum + 'static> EnumStateRecorder<T>
Sourcepub fn new(
name: String,
trace_category: &'static CStr,
options: RecorderOptions,
) -> Result<Self, StateRecorderError>
pub fn new( name: String, trace_category: &'static CStr, options: RecorderOptions, ) -> Result<Self, StateRecorderError>
Creates a new EnumStateRecorder with a given name.
See RecorderOptions for more details on options that can be specified.
Errors:
- StateRecorderError::DuplicateName:
metadata.nameis already in use by a StateRecorder associated withmanager. - StateRecorderError::IncompatibleString: Either
nameor the display name of a state cannot be converted to a CString. - StateRecorderError::InvalidOptions:
optionsis invalid for the given mode.
pub fn record(&mut self, state_enum: T)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for EnumStateRecorder<T>
impl<T> !RefUnwindSafe for EnumStateRecorder<T>
impl<T> Send for EnumStateRecorder<T>
impl<T> Sync for EnumStateRecorder<T>
impl<T> Unpin for EnumStateRecorder<T>where
T: Unpin,
impl<T> UnsafeUnpin for EnumStateRecorder<T>
impl<T> !UnwindSafe for EnumStateRecorder<T>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more