Enum taffy::style::LengthPercentage
source · pub enum LengthPercentage {
Length(f32),
Percent(f32),
}
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.
Trait Implementations§
source§impl Clone for LengthPercentage
impl Clone for LengthPercentage
source§fn clone(&self) -> LengthPercentage
fn clone(&self) -> LengthPercentage
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 moresource§impl Debug for LengthPercentage
impl Debug for LengthPercentage
source§impl<'de> Deserialize<'de> for LengthPercentage
impl<'de> Deserialize<'de> for LengthPercentage
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<LengthPercentage> for Dimension
impl From<LengthPercentage> for Dimension
source§fn from(input: LengthPercentage) -> Self
fn from(input: LengthPercentage) -> Self
Converts to this type from the input type.
source§impl From<LengthPercentage> for LengthPercentageAuto
impl From<LengthPercentage> for LengthPercentageAuto
source§fn from(input: LengthPercentage) -> Self
fn from(input: LengthPercentage) -> Self
Converts to this type from the input type.
source§impl FromLength for LengthPercentage
impl FromLength for LengthPercentage
source§impl FromPercent for LengthPercentage
impl FromPercent for LengthPercentage
source§impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentage
impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentage
source§fn maybe_resolve(self, context: Option<f32>) -> Option<f32>
fn maybe_resolve(self, context: Option<f32>) -> Option<f32>
Converts the given LengthPercentage
into an absolute length
Can return None
source§impl PartialEq for LengthPercentage
impl PartialEq for LengthPercentage
source§impl ResolveOrZero<Option<f32>, f32> for LengthPercentage
impl ResolveOrZero<Option<f32>, f32> for LengthPercentage
source§impl Serialize for LengthPercentage
impl Serialize for LengthPercentage
source§impl TaffyZero for LengthPercentage
impl TaffyZero for LengthPercentage
impl Copy for LengthPercentage
impl StructuralPartialEq for LengthPercentage
Auto Trait Implementations§
impl Freeze for LengthPercentage
impl RefUnwindSafe for LengthPercentage
impl Send for LengthPercentage
impl Sync for LengthPercentage
impl Unpin for LengthPercentage
impl UnwindSafe for LengthPercentage
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
)