pub trait CtFind<T: CtAssign> {
// Required method
fn ct_find<P>(&self, predicate: P) -> CtOption<T>
where P: Fn(&T) -> Choice;
}Expand description
Constant-time equivalent of Iterator::find, which can search a collection by iterating over
every element and applying the given predicate to each item, then selecting the first matching
entry.
Required Methods§
Sourcefn ct_find<P>(&self, predicate: P) -> CtOption<T>
fn ct_find<P>(&self, predicate: P) -> CtOption<T>
Iterate through every T item in &self, applying the given predicate which can select
a specific item by returning Choice::TRUE.
The first item where predicate returns Choice::TRUE is selected, or the CtOption
equivalent of None is returned if the predicate returns Choice::FALSE for all items.
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.