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
Performs the conversion.
sourceimpl From<LengthUnit> for UnitValue
impl From<LengthUnit> for UnitValue
sourcefn from(n: LengthUnit) -> Self
fn from(n: LengthUnit) -> Self
Performs the conversion.
sourceimpl From<TailwindArbitrary> for UnitValue
impl From<TailwindArbitrary> for UnitValue
sourcefn from(a: TailwindArbitrary) -> Self
fn from(a: TailwindArbitrary) -> Self
Performs the conversion.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more