Enum kittycad_modeling_cmds::units::UnitVolume
source · pub enum UnitVolume {
CubicCentimeters,
CubicFeet,
CubicInches,
CubicMeters,
CubicYards,
FluidOunces,
Gallons,
Liters,
Milliliters,
}
Expand description
The valid types of volume units.
Variants§
CubicCentimeters
Cubic centimeters (cc or cm³) https://en.wikipedia.org/wiki/Cubic_centimeter
CubicFeet
Cubic feet (ft³) https://en.wikipedia.org/wiki/Cubic_foot
CubicInches
Cubic inches (cu in or in³) https://en.wikipedia.org/wiki/Cubic_inch
CubicMeters
Cubic meters (m³) https://en.wikipedia.org/wiki/Cubic_meter
CubicYards
Cubic yards (yd³) https://en.wikipedia.org/wiki/Cubic_yard
FluidOunces
US Fluid Ounces (fl oz) https://en.wikipedia.org/wiki/Fluid_ounce
Gallons
US Gallons (gal US) https://en.wikipedia.org/wiki/Gallon
Liters
Liters (l) https://en.wikipedia.org/wiki/Litre
Milliliters
Milliliters (ml) https://en.wikipedia.org/wiki/Litre
Implementations§
source§impl UnitVolume
impl UnitVolume
sourcepub fn convert_to(&self, to: UnitVolume, input: f64) -> f64
pub fn convert_to(&self, to: UnitVolume, input: f64) -> f64
Do a unit conversion for this type.
source§impl UnitVolume
impl UnitVolume
sourcepub fn as_measurement(self, value: f64) -> Volume
pub fn as_measurement(self, value: f64) -> Volume
Convert to measurement.
Trait Implementations§
source§impl Clone for UnitVolume
impl Clone for UnitVolume
source§fn clone(&self) -> UnitVolume
fn clone(&self) -> UnitVolume
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 UnitVolume
impl Debug for UnitVolume
source§impl Default for UnitVolume
impl Default for UnitVolume
source§fn default() -> UnitVolume
fn default() -> UnitVolume
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for UnitVolume
impl<'de> Deserialize<'de> for UnitVolume
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 Display for UnitVolume
impl Display for UnitVolume
source§impl FromStr for UnitVolume
impl FromStr for UnitVolume
source§impl Hash for UnitVolume
impl Hash for UnitVolume
source§impl JsonSchema for UnitVolume
impl JsonSchema for UnitVolume
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. 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 Ord for UnitVolume
impl Ord for UnitVolume
source§fn cmp(&self, other: &UnitVolume) -> Ordering
fn cmp(&self, other: &UnitVolume) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for UnitVolume
impl PartialEq for UnitVolume
source§fn eq(&self, other: &UnitVolume) -> bool
fn eq(&self, other: &UnitVolume) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for UnitVolume
impl PartialOrd for UnitVolume
source§fn partial_cmp(&self, other: &UnitVolume) -> Option<Ordering>
fn partial_cmp(&self, other: &UnitVolume) -> 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 UnitVolume
impl Serialize for UnitVolume
source§impl Value for UnitVolume
impl Value for UnitVolume
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 UnitVolume
impl Eq for UnitVolume
impl StructuralPartialEq for UnitVolume
Auto Trait Implementations§
impl RefUnwindSafe for UnitVolume
impl Send for UnitVolume
impl Sync for UnitVolume
impl Unpin for UnitVolume
impl UnwindSafe for UnitVolume
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