pub enum LengthUnit {
Fraction(u32, u32),
Unit(f32, &'static str),
}
Variants§
Implementations§
Source§impl LengthUnit
impl LengthUnit
Sourcepub fn parse_faction(input: &str) -> Result<Self>
pub fn parse_faction(input: &str) -> Result<Self>
pub fn parse_length(input: &str) -> Result<Self>
pub fn parse_angle(input: &str) -> Result<Self>
pub fn px(x: f32) -> Self
pub fn em(x: f32) -> Self
pub fn rem(x: f32) -> Self
pub fn percent(x: f32) -> Self
pub fn radio(a: u32, b: u32) -> Self
Source§impl LengthUnit
impl LengthUnit
pub fn get_class(&self) -> String
pub fn get_class_arbitrary(&self) -> String
pub fn get_properties(&self) -> String
pub fn is_fraction(&self) -> bool
pub fn is_fraction_eq(&self) -> bool
pub fn is_fraction_zero(&self) -> bool
Trait Implementations§
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 Display for LengthUnit
impl Display for LengthUnit
Source§impl From<LengthUnit> for UnitValue
impl From<LengthUnit> for UnitValue
Source§fn from(n: LengthUnit) -> Self
fn from(n: LengthUnit) -> Self
Converts to this type from the input type.
impl Copy for LengthUnit
Auto Trait Implementations§
impl Freeze for LengthUnit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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