pub struct MetadataBuilder { /* private fields */ }
Implementations§
Source§impl MetadataBuilder
Metadata builder, used to slim down code that creates a Metadata object
impl MetadataBuilder
Metadata builder, used to slim down code that creates a Metadata object
pub const fn new(n: String) -> Self
pub fn name(self, name: String) -> Self
pub fn unit(self, u: String) -> Self
pub fn description(self, description: String) -> Self
pub fn value_map(self, value_map: ValueMap) -> Self
pub const fn mode(self, mode: SensorMode) -> Self
pub fn mode_string(self, value: &str) -> Self
Sourcepub fn value_map_string(self, value: String) -> Self
pub fn value_map_string(self, value: String) -> Self
Parse a value map from a string. Does not return errors as it is assumed that the consumer of such an error would not be happy.
Sourcepub fn row_string(self, value: &str) -> Self
pub fn row_string(self, value: &str) -> Self
Parse a row metadata from a string. Does not return errors as it is assumed that the consumer of such an error would not be happy.
pub fn pair(self, tag: &str, value: String) -> Self
pub fn build(self) -> Metadata
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetadataBuilder
impl RefUnwindSafe for MetadataBuilder
impl Send for MetadataBuilder
impl Sync for MetadataBuilder
impl Unpin for MetadataBuilder
impl UnwindSafe for MetadataBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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