pub struct MeasurementBlock {
pub id: Option<String>,
pub value: f64,
pub uncertainty: Option<f64>,
pub uncertainty_notation: Option<UncertaintyNotation>,
pub exponent: Option<i32>,
pub display: String,
pub unit: Option<String>,
}Expand description
Measurement block for scientific/technical values.
Fields§
§id: Option<String>Optional unique identifier.
value: f64The numeric value.
uncertainty: Option<f64>Uncertainty value (optional).
uncertainty_notation: Option<UncertaintyNotation>How to display uncertainty.
exponent: Option<i32>Scientific notation exponent (optional).
display: StringDisplay format (required).
unit: Option<String>Unit of measurement (optional).
Implementations§
Source§impl MeasurementBlock
impl MeasurementBlock
Sourcepub fn with_uncertainty(
self,
uncertainty: f64,
notation: UncertaintyNotation,
) -> Self
pub fn with_uncertainty( self, uncertainty: f64, notation: UncertaintyNotation, ) -> Self
Set the uncertainty.
Sourcepub fn with_exponent(self, exponent: i32) -> Self
pub fn with_exponent(self, exponent: i32) -> Self
Set the exponent.
Trait Implementations§
Source§impl Clone for MeasurementBlock
impl Clone for MeasurementBlock
Source§fn clone(&self) -> MeasurementBlock
fn clone(&self) -> MeasurementBlock
Returns a duplicate 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 Debug for MeasurementBlock
impl Debug for MeasurementBlock
Source§impl<'de> Deserialize<'de> for MeasurementBlock
impl<'de> Deserialize<'de> for MeasurementBlock
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 PartialEq for MeasurementBlock
impl PartialEq for MeasurementBlock
Source§impl Serialize for MeasurementBlock
impl Serialize for MeasurementBlock
impl StructuralPartialEq for MeasurementBlock
Auto Trait Implementations§
impl Freeze for MeasurementBlock
impl RefUnwindSafe for MeasurementBlock
impl Send for MeasurementBlock
impl Sync for MeasurementBlock
impl Unpin for MeasurementBlock
impl UnsafeUnpin for MeasurementBlock
impl UnwindSafe for MeasurementBlock
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