Enum taffy::style::LengthPercentageAuto
source · pub enum LengthPercentageAuto {
Points(f32),
Percent(f32),
Auto,
}
Expand description
Variants§
Points(f32)
Points are abstract absolute 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§
source§impl LengthPercentageAuto
impl LengthPercentageAuto
sourcepub fn resolve_to_option(self, context: f32) -> Option<f32>
pub fn resolve_to_option(self, context: f32) -> Option<f32>
Returns:
- Some(points) for Points variants
- Some(resolved) using the provided context for Percent variants
- None for Auto variants
Trait Implementations§
source§impl Clone for LengthPercentageAuto
impl Clone for LengthPercentageAuto
source§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 moresource§impl Debug for LengthPercentageAuto
impl Debug for LengthPercentageAuto
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 From<LengthPercentageAuto> for Dimension
impl From<LengthPercentageAuto> for Dimension
source§fn from(input: LengthPercentageAuto) -> Self
fn from(input: LengthPercentageAuto) -> Self
Converts to this type from the input type.
source§impl FromPercent for LengthPercentageAuto
impl FromPercent for LengthPercentageAuto
source§impl FromPoints for LengthPercentageAuto
impl FromPoints for LengthPercentageAuto
source§impl PartialEq for LengthPercentageAuto
impl PartialEq for LengthPercentageAuto
source§fn eq(&self, other: &LengthPercentageAuto) -> bool
fn eq(&self, other: &LengthPercentageAuto) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TaffyAuto for LengthPercentageAuto
impl TaffyAuto for LengthPercentageAuto
source§impl TaffyZero for LengthPercentageAuto
impl TaffyZero for LengthPercentageAuto
impl Copy for LengthPercentageAuto
impl StructuralPartialEq for LengthPercentageAuto
Auto Trait Implementations§
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