pub struct LengthPercentage(/* private fields */);Expand description
Implementations§
Source§impl LengthPercentage
impl LengthPercentage
Sourcepub const fn length(val: f32) -> LengthPercentage
pub const fn length(val: f32) -> LengthPercentage
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.
Sourcepub const fn percent(val: f32) -> LengthPercentage
pub const fn percent(val: f32) -> LengthPercentage
A percentage length relative to the size of the containing block.
NOTE: percentages are represented as a f32 value in the range [0.0, 1.0] NOT the range [0.0, 100.0]
Sourcepub fn calc(ptr: *const ()) -> LengthPercentage
pub fn calc(ptr: *const ()) -> LengthPercentage
A calc() value. The value passed here is treated as an opaque handle to
the actual calc representation and may be a pointer, index, etc.
The low 3 bits are used as a tag value and will be returned as 0.
Sourcepub const unsafe fn from_raw(val: CompactLength) -> LengthPercentage
pub const unsafe fn from_raw(val: CompactLength) -> LengthPercentage
Create a LengthPercentage from a raw CompactLength.
§Safety
CompactLength must represent a valid variant for LengthPercentage
Sourcepub const fn into_raw(self) -> CompactLength
pub const fn into_raw(self) -> CompactLength
Get the underlying CompactLength representation of the value
Trait Implementations§
Source§impl Clone for LengthPercentage
impl Clone for LengthPercentage
Source§fn clone(&self) -> LengthPercentage
fn clone(&self) -> LengthPercentage
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 moreSource§impl Debug for LengthPercentage
impl Debug for LengthPercentage
Source§impl From<LengthPercentage> for Dimension
impl From<LengthPercentage> for Dimension
Source§fn from(input: LengthPercentage) -> Dimension
fn from(input: LengthPercentage) -> Dimension
Converts to this type from the input type.
Source§impl From<LengthPercentage> for LengthPercentageAuto
impl From<LengthPercentage> for LengthPercentageAuto
Source§fn from(input: LengthPercentage) -> LengthPercentageAuto
fn from(input: LengthPercentage) -> LengthPercentageAuto
Converts to this type from the input type.
Source§impl From<LengthPercentage> for MaxTrackSizingFunction
impl From<LengthPercentage> for MaxTrackSizingFunction
Source§fn from(input: LengthPercentage) -> MaxTrackSizingFunction
fn from(input: LengthPercentage) -> MaxTrackSizingFunction
Converts to this type from the input type.
Source§impl From<LengthPercentage> for MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>
impl From<LengthPercentage> for MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>
Source§fn from(
input: LengthPercentage,
) -> MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>
fn from( input: LengthPercentage, ) -> MinMax<MinTrackSizingFunction, MaxTrackSizingFunction>
Converts to this type from the input type.
Source§impl From<LengthPercentage> for MinTrackSizingFunction
impl From<LengthPercentage> for MinTrackSizingFunction
Source§fn from(input: LengthPercentage) -> MinTrackSizingFunction
fn from(input: LengthPercentage) -> MinTrackSizingFunction
Converts to this type from the input type.
Source§impl FromLength for LengthPercentage
impl FromLength for LengthPercentage
Source§fn from_length<Input>(value: Input) -> LengthPercentage
fn from_length<Input>(value: Input) -> LengthPercentage
Converts into an
Into<f32> into SelfSource§impl FromPercent for LengthPercentage
impl FromPercent for LengthPercentage
Source§fn from_percent<Input>(value: Input) -> LengthPercentage
fn from_percent<Input>(value: Input) -> LengthPercentage
Converts into an
Into<f32> into SelfSource§impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentage
impl MaybeResolve<Option<f32>, Option<f32>> for LengthPercentage
Source§impl PartialEq for LengthPercentage
impl PartialEq for LengthPercentage
Source§fn eq(&self, other: &LengthPercentage) -> bool
fn eq(&self, other: &LengthPercentage) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl ResolveOrZero<Option<f32>, f32> for LengthPercentage
impl ResolveOrZero<Option<f32>, f32> for LengthPercentage
Source§impl TaffyZero for LengthPercentage
impl TaffyZero for LengthPercentage
Source§const ZERO: LengthPercentage
const ZERO: LengthPercentage
The zero value for type implementing TaffyZero
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 UnsafeUnpin 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§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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