Enum lay_rs::prelude::taffy::style::LengthPercentageAuto
pub enum LengthPercentageAuto {
Length(f32),
Percent(f32),
Auto,
}
Expand description
Variants§
Length(f32)
An absolute length in some abstract units. Users of Taffy may define what they correspond to in their application (pixels, logical pixels, mm, etc) as they see fit.
Percent(f32)
The dimension is stored in percentage relative to the parent item.
Auto
The dimension should be automatically computed
Implementations§
Trait Implementations§
§impl Clone for LengthPercentageAuto
impl Clone for LengthPercentageAuto
§fn clone(&self) -> LengthPercentageAuto
fn clone(&self) -> LengthPercentageAuto
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for LengthPercentageAuto
impl Debug for LengthPercentageAuto
§impl<'de> Deserialize<'de> for LengthPercentageAuto
impl<'de> Deserialize<'de> for LengthPercentageAuto
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LengthPercentageAuto, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LengthPercentageAuto, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<LengthPercentage> for LengthPercentageAuto
impl From<LengthPercentage> for LengthPercentageAuto
§fn from(input: LengthPercentage) -> LengthPercentageAuto
fn from(input: LengthPercentage) -> LengthPercentageAuto
Converts to this type from the input type.
§impl From<LengthPercentageAuto> for Dimension
impl From<LengthPercentageAuto> for Dimension
§fn from(input: LengthPercentageAuto) -> Dimension
fn from(input: LengthPercentageAuto) -> Dimension
Converts to this type from the input type.
§impl FromLength for LengthPercentageAuto
impl FromLength for LengthPercentageAuto
§fn from_length<Input>(value: Input) -> LengthPercentageAuto
fn from_length<Input>(value: Input) -> LengthPercentageAuto
Converts into an
Into<f32>
into Self§impl FromPercent for LengthPercentageAuto
impl FromPercent for LengthPercentageAuto
§fn from_percent<Input>(percent: Input) -> LengthPercentageAuto
fn from_percent<Input>(percent: Input) -> LengthPercentageAuto
Converts into an
Into<f32>
into Self§impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentageAuto
impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentageAuto
§fn maybe_resolve(self, context: Option<f32>) -> Option<f32>
fn maybe_resolve(self, context: Option<f32>) -> Option<f32>
Converts the given LengthPercentageAuto
into an absolute length
Can return None
§impl PartialEq for LengthPercentageAuto
impl PartialEq for LengthPercentageAuto
§impl ResolveOrZero<Option<f32>, f32> for LengthPercentageAuto
impl ResolveOrZero<Option<f32>, f32> for LengthPercentageAuto
§fn resolve_or_zero(self, context: Option<f32>) -> f32
fn resolve_or_zero(self, context: Option<f32>) -> f32
Will return a default value of result is evaluated to None
§impl Serialize for LengthPercentageAuto
impl Serialize for LengthPercentageAuto
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TaffyAuto for LengthPercentageAuto
impl TaffyAuto for LengthPercentageAuto
§const AUTO: LengthPercentageAuto = Self::Auto
const AUTO: LengthPercentageAuto = Self::Auto
The auto value for type implementing TaffyAuto
§impl TaffyZero for LengthPercentageAuto
impl TaffyZero for LengthPercentageAuto
§const ZERO: LengthPercentageAuto = _
const ZERO: LengthPercentageAuto = _
The zero value for type implementing TaffyZero
impl Copy for LengthPercentageAuto
impl StructuralPartialEq for LengthPercentageAuto
Auto Trait Implementations§
impl Freeze for LengthPercentageAuto
impl RefUnwindSafe for LengthPercentageAuto
impl Send for LengthPercentageAuto
impl Sync for LengthPercentageAuto
impl Unpin for LengthPercentageAuto
impl UnwindSafe for LengthPercentageAuto
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> MaybeResolve<f32, Option<f32>> for T
impl<T> MaybeResolve<f32, Option<f32>> for T
§fn maybe_resolve(self, context: f32) -> Option<f32>
fn maybe_resolve(self, context: f32) -> Option<f32>
Converts the given MaybeResolve value into an absolute length
Can return None