palette::bool_mask

Trait LazySelect

Source
pub trait LazySelect<T>: Select<T>
where T: HasBoolMask<Mask = Self>,
{ // Required method fn lazy_select<A, B>(self, a: A, b: B) -> T where A: FnOnce() -> T, B: FnOnce() -> T; }
Expand description

Like Select, but can avoid evaluating the input.

Required Methods§

Source

fn lazy_select<A, B>(self, a: A, b: B) -> T
where A: FnOnce() -> T, B: FnOnce() -> T,

Select lanes from the output of a when corresponding lanes in self are true, and select from the output of b when false. May avoid evaluating either option if it’s not selected.

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.

Implementations on Foreign Types§

Source§

impl<T> LazySelect<T> for bool
where T: HasBoolMask<Mask = Self>,

Source§

fn lazy_select<A, B>(self, a: A, b: B) -> T
where A: FnOnce() -> T, B: FnOnce() -> T,

Implementors§