Struct kittycad_modeling_cmds::length_unit::LengthUnit
source · pub struct LengthUnit(pub f64);Expand description
A length unit is wrapper around an f64 that represents a length in some unit.
Tuple Fields§
§0: f64Implementations§
source§impl LengthUnit
impl LengthUnit
sourcepub fn to_millimeters(&self, from: UnitLength) -> f64
pub fn to_millimeters(&self, from: UnitLength) -> f64
Get the value of the length unit in millimeters. This is how we convert for the engine.
sourcepub fn from_millimeters(&self, to: UnitLength) -> LengthUnit
pub fn from_millimeters(&self, to: UnitLength) -> LengthUnit
Get the value from millimeters to the length unit.
Trait Implementations§
source§impl Add for LengthUnit
impl Add for LengthUnit
source§impl Clone for LengthUnit
impl Clone for LengthUnit
source§fn clone(&self) -> LengthUnit
fn clone(&self) -> LengthUnit
Returns a copy 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 LengthUnit
impl Debug for LengthUnit
source§impl<'de> Deserialize<'de> for LengthUnit
impl<'de> Deserialize<'de> for LengthUnit
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 Div<f64> for LengthUnit
impl Div<f64> for LengthUnit
source§impl From<LengthUnit> for Primitive
impl From<LengthUnit> for Primitive
source§fn from(value: LengthUnit) -> Self
fn from(value: LengthUnit) -> Self
Converts to this type from the input type.
source§impl From<f64> for LengthUnit
impl From<f64> for LengthUnit
source§impl JsonSchema for LengthUnit
impl JsonSchema for LengthUnit
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moresource§impl Mul<f64> for LengthUnit
impl Mul<f64> for LengthUnit
source§impl Neg for LengthUnit
impl Neg for LengthUnit
source§impl PartialEq for LengthUnit
impl PartialEq for LengthUnit
source§fn eq(&self, other: &LengthUnit) -> bool
fn eq(&self, other: &LengthUnit) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for LengthUnit
impl PartialOrd for LengthUnit
source§fn partial_cmp(&self, other: &LengthUnit) -> Option<Ordering>
fn partial_cmp(&self, other: &LengthUnit) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl Serialize for LengthUnit
impl Serialize for LengthUnit
source§impl Sub for LengthUnit
impl Sub for LengthUnit
source§impl TryFrom<Primitive> for LengthUnit
impl TryFrom<Primitive> for LengthUnit
source§impl Value for LengthUnit
impl Value for LengthUnit
source§fn into_parts(self) -> Vec<Primitive>
fn into_parts(self) -> Vec<Primitive>
Store the value in memory.
source§fn from_parts<I>(values: &mut I) -> Result<Self, MemoryError>
fn from_parts<I>(values: &mut I) -> Result<Self, MemoryError>
Read the value from memory.
impl Copy for LengthUnit
impl StructuralPartialEq for LengthUnit
Auto Trait Implementations§
impl RefUnwindSafe for LengthUnit
impl Send for LengthUnit
impl Sync for LengthUnit
impl Unpin for LengthUnit
impl UnwindSafe for LengthUnit
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