pub enum Value {
Scalar(ScalarValue),
Duration(Duration),
String(String),
Bytes(Vec<u8>),
}
Expand description
A value representation within a MSR system.
TODO: Split into a separate type for simple, copyable values and an enclosing type that includes the complex, non-real-time-safe values?
Variants§
Scalar(ScalarValue)
Scalar value (real-time safe)
This variant can safely be used in real-time contexts.
Duration(Duration)
Duration, e.g. a timeout
This variant can safely be used in real-time contexts.
String(String)
Variable-size text data
This variant must not be used in real-time contexts.
Bytes(Vec<u8>)
Variable-size binary data
This variant must not be used in real-time contexts.
Implementations§
Source§impl Value
impl Value
pub const fn to_type(&self) -> ValueType
pub const fn to_scalar(&self) -> Option<ScalarValue>
pub const fn from_scalar(scalar: ScalarValue) -> Self
pub fn to_i32(&self) -> Option<i32>
pub fn to_u32(&self) -> Option<u32>
pub fn to_i64(&self) -> Option<i64>
pub fn to_u64(&self) -> Option<u64>
pub fn to_f32(&self) -> Option<f32>
pub fn to_f64(&self) -> Option<f64>
Trait Implementations§
Source§impl ToValueType for Value
impl ToValueType for Value
fn to_value_type(&self) -> ValueType
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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