pub struct UnitValue<V, U> {
pub value: V,
pub units: Option<U>,
}Expand description
A generic container for a value and its associated unit.
This struct is used throughout the library to represent measurements like position, velocity, etc., which have a numerical value and an optional unit enum.
§Type Parameters
V: The type of the value (e.g.,f64,i32).U: The type of the unit enum (e.g.,PositionUnits).
Fields§
§value: V§units: Option<U>Implementations§
Trait Implementations§
Source§impl<'de, V, U> Deserialize<'de> for UnitValue<V, U>
impl<'de, V, U> Deserialize<'de> for UnitValue<V, U>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<U> FromKvnFloat for UnitValue<f64, U>
impl<U> FromKvnFloat for UnitValue<f64, U>
impl<V, U> StructuralPartialEq for UnitValue<V, U>
Auto Trait Implementations§
impl<V, U> Freeze for UnitValue<V, U>
impl<V, U> RefUnwindSafe for UnitValue<V, U>where
V: RefUnwindSafe,
U: RefUnwindSafe,
impl<V, U> Send for UnitValue<V, U>
impl<V, U> Sync for UnitValue<V, U>
impl<V, U> Unpin for UnitValue<V, U>
impl<V, U> UnsafeUnpin for UnitValue<V, U>where
V: UnsafeUnpin,
U: UnsafeUnpin,
impl<V, U> UnwindSafe for UnitValue<V, U>where
V: UnwindSafe,
U: 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§impl<T> FromKvnValue for T
impl<T> FromKvnValue for T
Source§fn from_kvn_value(s: &str) -> Result<T, CcsdsNdmError>
fn from_kvn_value(s: &str) -> Result<T, CcsdsNdmError>
Parse a value from its KVN string representation. Read more