Trait lay_rs::prelude::taffy::util::ResolveOrZero

pub trait ResolveOrZero<TContext, TOutput>
where TOutput: TaffyZero,
{ // Required method fn resolve_or_zero(self, context: TContext) -> TOutput; }
Expand description

Trait to encapsulate behaviour where we need to resolve from a potentially context-dependent size or dimension into a context-independent size or dimension.

Will return a default value if it unable to resolve.

Required Methods§

fn resolve_or_zero(self, context: TContext) -> TOutput

Resolve a dimension that might be dependent on a context, with a default fallback value

Implementors§

§

impl ResolveOrZero<Option<f32>, f32> for Dimension

§

impl ResolveOrZero<Option<f32>, f32> for LengthPercentage

§

impl ResolveOrZero<Option<f32>, f32> for LengthPercentageAuto

§

impl<In, Out, T> ResolveOrZero<Size<In>, Rect<Out>> for Rect<T>
where In: Copy, Out: TaffyZero, T: ResolveOrZero<In, Out>,

§

impl<In, Out, T> ResolveOrZero<Size<In>, Size<Out>> for Size<T>
where Out: TaffyZero, T: ResolveOrZero<In, Out>,

§

impl<Out, T> ResolveOrZero<Option<f32>, Rect<Out>> for Rect<T>
where Out: TaffyZero, T: ResolveOrZero<Option<f32>, Out>,