pub enum DefiniteLength {
Absolute(AbsoluteLength),
Fraction(Percentage),
}Expand description
A length that is not auto: absolute, or a fraction of a reference
length (the parent’s size for a box, the gradient line for a color
stop).
Variants§
Absolute(AbsoluteLength)
Points or rems.
Fraction(Percentage)
A fraction of the reference length (0.5 is 50%).
Implementations§
Source§impl DefiniteLength
impl DefiniteLength
Sourcepub fn to_points(self, base_size: AbsoluteLength, rem_size: Points) -> Points
pub fn to_points(self, base_size: AbsoluteLength, rem_size: Points) -> Points
In points: a fraction of base_size, rems of rem_size.
Sourcepub fn is_absolute(self) -> bool
pub fn is_absolute(self) -> bool
Whether the length is absolute (it does not depend on a reference).
Trait Implementations§
Source§impl Clone for DefiniteLength
impl Clone for DefiniteLength
impl Copy for DefiniteLength
Source§impl Debug for DefiniteLength
impl Debug for DefiniteLength
Source§impl Default for DefiniteLength
impl Default for DefiniteLength
impl Eq for DefiniteLength
Source§impl From<AbsoluteLength> for DefiniteLength
impl From<AbsoluteLength> for DefiniteLength
Source§fn from(a: AbsoluteLength) -> Self
fn from(a: AbsoluteLength) -> Self
Converts to this type from the input type.
Source§impl From<DefiniteLength> for Length
impl From<DefiniteLength> for Length
Source§fn from(d: DefiniteLength) -> Self
fn from(d: DefiniteLength) -> Self
Converts to this type from the input type.
Source§impl From<DefiniteLength> for LengthPercentage
impl From<DefiniteLength> for LengthPercentage
Source§fn from(l: DefiniteLength) -> Self
fn from(l: DefiniteLength) -> Self
Converts to this type from the input type.
Source§impl From<DefiniteLength> for LengthPercentageAuto
impl From<DefiniteLength> for LengthPercentageAuto
Source§fn from(l: DefiniteLength) -> Self
fn from(l: DefiniteLength) -> Self
Converts to this type from the input type.
Source§impl From<DefiniteLength> for Dimension
impl From<DefiniteLength> for Dimension
Source§fn from(l: DefiniteLength) -> Self
fn from(l: DefiniteLength) -> Self
Converts to this type from the input type.
Source§impl From<Percentage> for DefiniteLength
impl From<Percentage> for DefiniteLength
Source§fn from(f: Percentage) -> Self
fn from(f: Percentage) -> Self
Converts to this type from the input type.
Source§impl From<Points> for DefiniteLength
impl From<Points> for DefiniteLength
Source§impl From<Rems> for DefiniteLength
impl From<Rems> for DefiniteLength
Source§impl Hash for DefiniteLength
impl Hash for DefiniteLength
Source§impl IntoReactive<DefiniteLength> for Points
impl IntoReactive<DefiniteLength> for Points
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<DefiniteLength> for Rems
impl IntoReactive<DefiniteLength> for Rems
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<DefiniteLength> for AbsoluteLength
impl IntoReactive<DefiniteLength> for AbsoluteLength
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<DefiniteLength> for DefiniteLength
impl IntoReactive<DefiniteLength> for DefiniteLength
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<DefiniteLength> for Percentage
impl IntoReactive<DefiniteLength> for Percentage
Source§fn into_reactive(self) -> Reactive<DefiniteLength>
fn into_reactive(self) -> Reactive<DefiniteLength>
As a
Reactive.Source§impl IntoReactive<Length> for DefiniteLength
impl IntoReactive<Length> for DefiniteLength
Source§impl JsValue for DefiniteLength
A length of points or a percentage of a reference length the prop
names, as CSS writes them: a number of points, or "50%" (TS
number | `${number}%` ). A length in rems, which only Rust makes,
reads back as its CSS text ("1.5rem").
impl JsValue for DefiniteLength
A length of points or a percentage of a reference length the prop
names, as CSS writes them: a number of points, or "50%" (TS
number | `${number}%` ). A length in rems, which only Rust makes,
reads back as its CSS text ("1.5rem").
Source§impl PartialEq for DefiniteLength
impl PartialEq for DefiniteLength
impl StructuralPartialEq for DefiniteLength
Auto Trait Implementations§
impl Forget for DefiniteLength
impl Freeze for DefiniteLength
impl Move for DefiniteLength
impl RefUnwindSafe for DefiniteLength
impl Send for DefiniteLength
impl Sync for DefiniteLength
impl Unpin for DefiniteLength
impl UnsafeUnpin for DefiniteLength
impl UnwindSafe for DefiniteLength
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> CallbackArgs for Twhere
T: Ret,
impl<T> CallbackArgs for Twhere
T: Ret,
Source§fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
fn ts_params(types: &mut TsTypes, names: &[&str]) -> String
Its TypeScript parameters, named
names (name: string, amount: number), or without names value for one and a, b, … for
several.Source§fn into_js_args<'a>(
self,
host: &'a dyn JsHost,
) -> Result<Vec<JsOwned<'a>>, PropError>
fn into_js_args<'a>( self, host: &'a dyn JsHost, ) -> Result<Vec<JsOwned<'a>>, PropError>
The arguments as JS values.