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.6.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 From<UnitVolume> for UnitVolume
impl From<UnitVolume> for UnitVolume
source§fn from(value: UnitVolume) -> Self
fn from(value: UnitVolume) -> Self
Converts to this type from the input type.
source§impl From<UnitVolume> for UnitVolume
impl From<UnitVolume> for UnitVolume
source§fn from(value: UnitVolume) -> Self
fn from(value: UnitVolume) -> Self
Converts to this type from the input type.
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§impl PartialOrd for UnitVolume
impl PartialOrd for UnitVolume
source§impl Serialize for UnitVolume
impl Serialize for UnitVolume
source§impl Tabled for UnitVolume
impl Tabled for UnitVolume
impl Copy for UnitVolume
impl Eq for UnitVolume
impl StructuralPartialEq for UnitVolume
Auto Trait Implementations§
impl Freeze for UnitVolume
impl RefUnwindSafe for UnitVolume
impl Send for UnitVolume
impl Sync for UnitVolume
impl Unpin for UnitVolume
impl UnwindSafe for UnitVolume
Blanket Implementations§
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more