Enum tailwind_css::UnitValue
source · [−]pub enum UnitValue {
Number {
n: f32,
is_negative: bool,
},
Length(LengthUnit),
Keyword(String),
Arbitrary(TailwindArbitrary),
}
Variants
Number
Length(LengthUnit)
Keyword(String)
Arbitrary(TailwindArbitrary)
Implementations
sourceimpl UnitValue
impl UnitValue
pub fn px(x: f32) -> Self
pub fn radio(a: u32, b: u32) -> Self
pub fn get_properties(&self, number: impl FnOnce(&f32) -> String) -> String
pub fn get_properties_rem(&self) -> String
pub fn write_negative(&self, f: &mut Formatter<'_>) -> Result
pub fn write_class(&self, f: &mut Formatter<'_>, before: &str) -> Result
sourceimpl UnitValue
impl UnitValue
pub fn negative_parser(
id: &'static str,
check_valid: impl Fn(&str) -> bool,
is_length: bool,
is_integer: bool,
allow_fraction: bool
) -> impl Fn(&[&str], &TailwindArbitrary, Negative) -> Result<Self>
pub fn positive_parser(
id: &'static str,
check_valid: impl Fn(&str) -> bool,
is_length: bool,
is_integer: bool,
allow_fraction: bool
) -> impl Fn(&[&str], &TailwindArbitrary) -> Result<Self>
pub fn parse_arbitrary(arbitrary: &TailwindArbitrary) -> Result<Self>
pub fn parse_number(
n: &str,
negative: Negative,
is_length: bool,
is_integer: bool,
can_be_fraction: bool
) -> Result<Self>
Trait Implementations
sourceimpl From<&TailwindArbitrary> for UnitValue
impl From<&TailwindArbitrary> for UnitValue
sourcefn from(a: &TailwindArbitrary) -> Self
fn from(a: &TailwindArbitrary) -> Self
Converts to this type from the input type.
sourceimpl From<LengthUnit> for UnitValue
impl From<LengthUnit> for UnitValue
sourcefn from(n: LengthUnit) -> Self
fn from(n: LengthUnit) -> Self
Converts to this type from the input type.
sourceimpl From<TailwindArbitrary> for UnitValue
impl From<TailwindArbitrary> for UnitValue
sourcefn from(a: TailwindArbitrary) -> Self
fn from(a: TailwindArbitrary) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for UnitValue
impl Send for UnitValue
impl Sync for UnitValue
impl Unpin for UnitValue
impl UnwindSafe for UnitValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more