Trait ResolveOrZero

Source
pub trait ResolveOrZero<TContext, TOutput: TaffyZero> {
    // Required method
    fn resolve_or_zero(
        self,
        context: TContext,
        calc: impl Fn(*const (), f32) -> f32,
    ) -> 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§

Source

fn resolve_or_zero( self, context: TContext, calc: impl Fn(*const (), f32) -> f32, ) -> TOutput

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§