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
Source§fn clone(&self) -> DefiniteLength
fn clone(&self) -> DefiniteLength
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DefiniteLength
Source§impl Debug for DefiniteLength
impl Debug for DefiniteLength
Source§impl Default for DefiniteLength
impl Default for DefiniteLength
Source§fn default() -> DefiniteLength
fn default() -> DefiniteLength
Returns the “default value” for a type. Read more
impl Eq for DefiniteLength
Source§impl From<AbsoluteLength> for DefiniteLength
impl From<AbsoluteLength> for DefiniteLength
Source§fn from(a: AbsoluteLength) -> DefiniteLength
fn from(a: AbsoluteLength) -> DefiniteLength
Converts to this type from the input type.
Source§impl From<DefiniteLength> for Length
impl From<DefiniteLength> for Length
Source§fn from(d: DefiniteLength) -> Length
fn from(d: DefiniteLength) -> Length
Converts to this type from the input type.
Source§impl From<Percentage> for DefiniteLength
impl From<Percentage> for DefiniteLength
Source§fn from(f: Percentage) -> DefiniteLength
fn from(f: Percentage) -> DefiniteLength
Converts to this type from the input type.
Source§impl From<Points> for DefiniteLength
impl From<Points> for DefiniteLength
Source§fn from(p: Points) -> DefiniteLength
fn from(p: Points) -> DefiniteLength
Converts to this type from the input type.
Source§impl From<Rems> for DefiniteLength
impl From<Rems> for DefiniteLength
Source§fn from(r: Rems) -> DefiniteLength
fn from(r: Rems) -> DefiniteLength
Converts to this type from the input type.
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 Freeze 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.
fn classes(out: &mut Vec<&'static ClassDef>)
Source§impl<T> CallbackRet for Twhere
T: JsValue,
impl<T> CallbackRet for Twhere
T: JsValue,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.