Skip to main content

MaybeResolve

Trait MaybeResolve 

Source
pub trait MaybeResolve<In, Out> {
    // Required method
    fn maybe_resolve(
        self,
        context: In,
        calc: impl Fn(*const (), f32) -> f32,
    ) -> Out;
}
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 None if it unable to resolve.

Required Methods§

Source

fn maybe_resolve(self, context: In, calc: impl Fn(*const (), f32) -> f32) -> Out

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§