#[non_exhaustive]pub enum Base {
Length(Length),
Mass(Mass),
Area(Area),
Volume(Volume),
Time(Time),
}Expand description
A base unit with no power.
See the corresponding enum variants for the available units and their abbreviations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Trait Implementations§
Source§impl FromStr for Base
Try a to convert a string to a Base.
impl FromStr for Base
Try a to convert a string to a Base.
Note that Base does not encode the power of the unit, so this function will return an
error if the string contains a power. Use Unit::try_from to convert a string to a unit,
while accounting for the power.
Source§impl TryFrom<&str> for Base
Try a to convert a string to a Base.
impl TryFrom<&str> for Base
Try a to convert a string to a Base.
Note that Base does not encode the power of the unit, so this function will return an
error if the string contains a power. Use Unit::try_from to convert a string to a unit,
impl Copy for Base
impl Eq for Base
impl StructuralPartialEq for Base
Auto Trait Implementations§
impl Freeze for Base
impl RefUnwindSafe for Base
impl Send for Base
impl Sync for Base
impl Unpin for Base
impl UnwindSafe for Base
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