Length

Enum Length 

Source
pub enum Length {
    Absolute(AbsoluteLength),
    Relative(RelativeLength),
}
Expand description

Variants§

Implementations§

Source§

impl Length

Source

pub const fn is_absolute(&self) -> bool

Returns true if the enum is Length::Absolute otherwise false

Source

pub const fn is_relative(&self) -> bool

Returns true if the enum is Length::Relative otherwise false

Trait Implementations§

Source§

impl AbsoluteLengthStorage for Length

Source§

fn absolute_length(value: AbsoluteLength) -> Self
where Self: Sized,

Source§

impl CapHeightStorage for Length

Source§

fn cap(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cap" (Cap) as value to store. Read more
Source§

impl CentimeterStorage for Length

Source§

fn cm(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cm" (Cm) as value to store. Read more
Source§

impl CharSizeStorage for Length

Source§

fn ch(value: isize) -> Self
where Self: Sized,

Use a CSS unit "ch" (Ch) as value to store. Read more
Source§

impl Clone for Length

Source§

fn clone(&self) -> Length

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContainerLengthStorage for Length

Source§

fn container_length(value: ContainerLength) -> Self
where Self: Sized,

Source§

impl ContainerQueryBlockStorage for Length

Source§

fn cqb(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqb" (Cqb) as value to store. Read more
Source§

impl ContainerQueryHeightStorage for Length

Source§

fn cqh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqh" (Cqh) as value to store. Read more
Source§

impl ContainerQueryInlineStorage for Length

Source§

fn cqi(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqi" (Cqi) as value to store. Read more
Source§

impl ContainerQueryMaxStorage for Length

Source§

fn cqmax(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqmax" (Cqmax) as value to store. Read more
Source§

impl ContainerQueryMinStorage for Length

Source§

fn cqmin(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqmin" (Cqmin) as value to store. Read more
Source§

impl ContainerQueryWidthStorage for Length

Source§

fn cqw(value: f64) -> Self
where Self: Sized,

Use a CSS unit "cqw" (Cqw) as value to store. Read more
Source§

impl Debug for Length

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Length

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DynamicViewportBlockStorage for Length

Source§

fn dvb(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvb" (Dvb) as value to store. Read more
Source§

impl DynamicViewportHeightStorage for Length

Source§

fn dvh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvh" (Dvh) as value to store. Read more
Source§

impl DynamicViewportInlineStorage for Length

Source§

fn dvi(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvi" (Dvi) as value to store. Read more
Source§

impl DynamicViewportMaxStorage for Length

Source§

fn dvmax(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvmax" (Dvmax) as value to store. Read more
Source§

impl DynamicViewportMinStorage for Length

Source§

fn dvmin(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvmin" (Dvmin) as value to store. Read more
Source§

impl DynamicViewportWidthStorage for Length

Source§

fn dvw(value: f64) -> Self
where Self: Sized,

Use a CSS unit "dvw" (Dvw) as value to store. Read more
Source§

impl EmStorage for Length

Source§

fn em(value: f64) -> Self
where Self: Sized,

Use a CSS unit "em" (Em) as value to store. Read more
Source§

impl ExStorage for Length

Source§

fn ex(value: f64) -> Self
where Self: Sized,

Use a CSS unit "ex" (Ex) as value to store. Read more
Source§

impl FontLengthStorage for Length

Source§

fn font_length(value: FontLength) -> Self
where Self: Sized,

Source§

impl From<AbsoluteLength> for Length

Source§

fn from(value: AbsoluteLength) -> Self

Converts to this type from the input type.
Source§

impl From<Cap> for Length

Source§

fn from(value: Cap) -> Self

Converts to this type from the input type.
Source§

impl From<Ch> for Length

Source§

fn from(value: Ch) -> Self

Converts to this type from the input type.
Source§

impl From<Cm> for Length

Source§

fn from(value: Cm) -> Self

Converts to this type from the input type.
Source§

impl From<ContainerLength> for Length

Source§

fn from(value: ContainerLength) -> Self

Converts to this type from the input type.
Source§

impl From<Cqb> for Length

Source§

fn from(value: Cqb) -> Self

Converts to this type from the input type.
Source§

impl From<Cqh> for Length

Source§

fn from(value: Cqh) -> Self

Converts to this type from the input type.
Source§

impl From<Cqi> for Length

Source§

fn from(value: Cqi) -> Self

Converts to this type from the input type.
Source§

impl From<Cqmax> for Length

Source§

fn from(value: Cqmax) -> Self

Converts to this type from the input type.
Source§

impl From<Cqmin> for Length

Source§

fn from(value: Cqmin) -> Self

Converts to this type from the input type.
Source§

impl From<Cqw> for Length

Source§

fn from(value: Cqw) -> Self

Converts to this type from the input type.
Source§

impl From<Dvb> for Length

Source§

fn from(value: Dvb) -> Self

Converts to this type from the input type.
Source§

impl From<Dvh> for Length

Source§

fn from(value: Dvh) -> Self

Converts to this type from the input type.
Source§

impl From<Dvi> for Length

Source§

fn from(value: Dvi) -> Self

Converts to this type from the input type.
Source§

impl From<Dvmax> for Length

Source§

fn from(value: Dvmax) -> Self

Converts to this type from the input type.
Source§

impl From<Dvmin> for Length

Source§

fn from(value: Dvmin) -> Self

Converts to this type from the input type.
Source§

impl From<Dvw> for Length

Source§

fn from(value: Dvw) -> Self

Converts to this type from the input type.
Source§

impl From<Em> for Length

Source§

fn from(value: Em) -> Self

Converts to this type from the input type.
Source§

impl From<Ex> for Length

Source§

fn from(value: Ex) -> Self

Converts to this type from the input type.
Source§

impl From<FontLength> for Length

Source§

fn from(value: FontLength) -> Self

Converts to this type from the input type.
Source§

impl From<Ic> for Length

Source§

fn from(value: Ic) -> Self

Converts to this type from the input type.
Source§

impl From<In> for Length

Source§

fn from(value: In) -> Self

Converts to this type from the input type.
Source§

impl From<Length> for Dimension

Source§

fn from(value: Length) -> Self

Converts to this type from the input type.
Source§

impl From<Length> for LengthPercentage

Source§

fn from(value: Length) -> Self

Converts to this type from the input type.
Source§

impl From<Lh> for Length

Source§

fn from(value: Lh) -> Self

Converts to this type from the input type.
Source§

impl From<Lvb> for Length

Source§

fn from(value: Lvb) -> Self

Converts to this type from the input type.
Source§

impl From<Lvh> for Length

Source§

fn from(value: Lvh) -> Self

Converts to this type from the input type.
Source§

impl From<Lvi> for Length

Source§

fn from(value: Lvi) -> Self

Converts to this type from the input type.
Source§

impl From<Lvmax> for Length

Source§

fn from(value: Lvmax) -> Self

Converts to this type from the input type.
Source§

impl From<Lvmin> for Length

Source§

fn from(value: Lvmin) -> Self

Converts to this type from the input type.
Source§

impl From<Lvw> for Length

Source§

fn from(value: Lvw) -> Self

Converts to this type from the input type.
Source§

impl From<Mm> for Length

Source§

fn from(value: Mm) -> Self

Converts to this type from the input type.
Source§

impl From<Pc> for Length

Source§

fn from(value: Pc) -> Self

Converts to this type from the input type.
Source§

impl From<Pt> for Length

Source§

fn from(value: Pt) -> Self

Converts to this type from the input type.
Source§

impl From<Px> for Length

Source§

fn from(value: Px) -> Self

Converts to this type from the input type.
Source§

impl From<Q> for Length

Source§

fn from(value: Q) -> Self

Converts to this type from the input type.
Source§

impl From<Rcap> for Length

Source§

fn from(value: Rcap) -> Self

Converts to this type from the input type.
Source§

impl From<Rch> for Length

Source§

fn from(value: Rch) -> Self

Converts to this type from the input type.
Source§

impl From<RelativeLength> for Length

Source§

fn from(value: RelativeLength) -> Self

Converts to this type from the input type.
Source§

impl From<Rem> for Length

Source§

fn from(value: Rem) -> Self

Converts to this type from the input type.
Source§

impl From<Rex> for Length

Source§

fn from(value: Rex) -> Self

Converts to this type from the input type.
Source§

impl From<Ric> for Length

Source§

fn from(value: Ric) -> Self

Converts to this type from the input type.
Source§

impl From<Rlh> for Length

Source§

fn from(value: Rlh) -> Self

Converts to this type from the input type.
Source§

impl From<Svb> for Length

Source§

fn from(value: Svb) -> Self

Converts to this type from the input type.
Source§

impl From<Svh> for Length

Source§

fn from(value: Svh) -> Self

Converts to this type from the input type.
Source§

impl From<Svi> for Length

Source§

fn from(value: Svi) -> Self

Converts to this type from the input type.
Source§

impl From<Svmax> for Length

Source§

fn from(value: Svmax) -> Self

Converts to this type from the input type.
Source§

impl From<Svmin> for Length

Source§

fn from(value: Svmin) -> Self

Converts to this type from the input type.
Source§

impl From<Svw> for Length

Source§

fn from(value: Svw) -> Self

Converts to this type from the input type.
Source§

impl From<Vb> for Length

Source§

fn from(value: Vb) -> Self

Converts to this type from the input type.
Source§

impl From<Vh> for Length

Source§

fn from(value: Vh) -> Self

Converts to this type from the input type.
Source§

impl From<Vi> for Length

Source§

fn from(value: Vi) -> Self

Converts to this type from the input type.
Source§

impl From<ViewportLength> for Length

Source§

fn from(value: ViewportLength) -> Self

Converts to this type from the input type.
Source§

impl From<Vmax> for Length

Source§

fn from(value: Vmax) -> Self

Converts to this type from the input type.
Source§

impl From<Vmin> for Length

Source§

fn from(value: Vmin) -> Self

Converts to this type from the input type.
Source§

impl From<Vw> for Length

Source§

fn from(value: Vw) -> Self

Converts to this type from the input type.
Source§

impl IcStorage for Length

Source§

fn ic(value: isize) -> Self
where Self: Sized,

Use a CSS unit "ic" (Ic) as value to store. Read more
Source§

impl InchStorage for Length

Source§

fn in(value: f64) -> Self
where Self: Sized,

Use a CSS unit "in" (In) as value to store. Read more
Source§

impl LargeViewportBlockStorage for Length

Source§

fn lvb(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvb" (Lvb) as value to store. Read more
Source§

impl LargeViewportHeightStorage for Length

Source§

fn lvh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvh" (Lvh) as value to store. Read more
Source§

impl LargeViewportInlineStorage for Length

Source§

fn lvi(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvi" (Lvi) as value to store. Read more
Source§

impl LargeViewportMaxStorage for Length

Source§

fn lvmax(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvmax" (Lvmax) as value to store. Read more
Source§

impl LargeViewportMinStorage for Length

Source§

fn lvmin(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvmin" (Lvmin) as value to store. Read more
Source§

impl LargeViewportWidthStorage for Length

Source§

fn lvw(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lvw" (Lvw) as value to store. Read more
Source§

impl LineHeightStorage for Length

Source§

fn lh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "lh" (Lh) as value to store. Read more
Source§

impl MillimeterStorage for Length

Source§

fn mm(value: f64) -> Self
where Self: Sized,

Use a CSS unit "mm" (Mm) as value to store. Read more
Source§

impl PartialEq for Length

Source§

fn eq(&self, other: &Length) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PicaStorage for Length

Source§

fn pc(value: isize) -> Self
where Self: Sized,

Use a CSS unit "pc" (Pc) as value to store. Read more
Source§

impl PixelStorage for Length

Source§

fn px(value: isize) -> Self
where Self: Sized,

Use a CSS unit "px" (Px) as value to store. Read more
Source§

impl PointStorage for Length

Source§

fn pt(value: isize) -> Self
where Self: Sized,

Use a CSS unit "pt" (Pt) as value to store. Read more
Source§

impl QuarterOfMillimeterStorage for Length

Source§

fn q(value: isize) -> Self
where Self: Sized,

Use a CSS unit "q" (Q) as value to store. Read more
Source§

impl RelativeCapHeightStorage for Length

Source§

fn rcap(value: f64) -> Self
where Self: Sized,

Use a CSS unit "rcap" (Rcap) as value to store. Read more
Source§

impl RelativeCharSizeStorage for Length

Source§

fn rch(value: isize) -> Self
where Self: Sized,

Use a CSS unit "rch" (Rch) as value to store. Read more
Source§

impl RelativeEmStorage for Length

Source§

fn rem(value: f64) -> Self
where Self: Sized,

Use a CSS unit "rem" (Rem) as value to store. Read more
Source§

impl RelativeExStorage for Length

Source§

fn rex(value: f64) -> Self
where Self: Sized,

Use a CSS unit "rex" (Rex) as value to store. Read more
Source§

impl RelativeIcStorage for Length

Source§

fn ric(value: isize) -> Self
where Self: Sized,

Use a CSS unit "ric" (Ric) as value to store. Read more
Source§

impl RelativeLengthStorage for Length

Source§

fn relative_length(value: RelativeLength) -> Self
where Self: Sized,

Source§

impl RelativeLineHeightStorage for Length

Source§

fn rlh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "rlh" (Rlh) as value to store. Read more
Source§

impl SmallViewportBlockStorage for Length

Source§

fn svb(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svb" (Svb) as value to store. Read more
Source§

impl SmallViewportHeightStorage for Length

Source§

fn svh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svh" (Svh) as value to store. Read more
Source§

impl SmallViewportInlineStorage for Length

Source§

fn svi(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svi" (Svi) as value to store. Read more
Source§

impl SmallViewportMaxStorage for Length

Source§

fn svmax(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svmax" (Svmax) as value to store. Read more
Source§

impl SmallViewportMinStorage for Length

Source§

fn svmin(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svmin" (Svmin) as value to store. Read more
Source§

impl SmallViewportWidthStorage for Length

Source§

fn svw(value: f64) -> Self
where Self: Sized,

Use a CSS unit "svw" (Svw) as value to store. Read more
Source§

impl ViewportBlockStorage for Length

Source§

fn vb(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vb" (Vb) as value to store. Read more
Source§

impl ViewportHeightStorage for Length

Source§

fn vh(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vh" (Vh) as value to store. Read more
Source§

impl ViewportInlineStorage for Length

Source§

fn vi(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vi" (Vi) as value to store. Read more
Source§

impl ViewportLengthStorage for Length

Source§

fn viewport_length(value: ViewportLength) -> Self
where Self: Sized,

Source§

impl ViewportMaxStorage for Length

Source§

fn vmax(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vmax" (Vmax) as value to store. Read more
Source§

impl ViewportMinStorage for Length

Source§

fn vmin(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vmin" (Vmin) as value to store. Read more
Source§

impl ViewportWidthStorage for Length

Source§

fn vw(value: f64) -> Self
where Self: Sized,

Use a CSS unit "vw" (Vw) as value to store. Read more
Source§

impl StructuralPartialEq for Length

Auto Trait Implementations§

§

impl Freeze for Length

§

impl RefUnwindSafe for Length

§

impl Send for Length

§

impl Sync for Length

§

impl Unpin for Length

§

impl UnwindSafe for Length

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.