pub trait HofTrait<R, V, Root, Value, MutRoot, MutValue, G, S>: KpTrait<R, V, Root, Value, MutRoot, MutValue, G, S>where
Root: Borrow<R>,
Value: Borrow<V>,
MutRoot: BorrowMut<R>,
MutValue: BorrowMut<V>,
G: Fn(Root) -> Option<Value>,
S: Fn(MutRoot) -> Option<MutValue>,{
Show 16 methods
// Provided methods
fn map<MappedValue, F>(
&self,
mapper: F,
) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
where F: Fn(&V) -> MappedValue + Copy + 'static,
V: 'static,
MappedValue: 'static { ... }
fn filter<F>(
&self,
predicate: F,
) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
where F: Fn(&V) -> bool + Copy + 'static,
V: 'static { ... }
fn filter_map<MappedValue, F>(
&self,
mapper: F,
) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
where F: Fn(&V) -> Option<MappedValue> + Copy + 'static,
V: 'static,
MappedValue: 'static { ... }
fn inspect<F>(
&self,
inspector: F,
) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
where F: Fn(&V) + Copy + 'static,
V: 'static { ... }
fn flat_map<I, Item, F>(&self, mapper: F) -> impl Fn(Root) -> Vec<Item> + '_
where F: Fn(&V) -> I + 'static,
V: 'static,
I: IntoIterator<Item = Item>,
Item: 'static { ... }
fn fold_value<Acc, F>(
&self,
init: Acc,
folder: F,
) -> impl Fn(Root) -> Acc + '_
where F: Fn(Acc, &V) -> Acc + 'static,
V: 'static,
Acc: Copy + 'static { ... }
fn any<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
where F: Fn(&V) -> bool + 'static,
V: 'static { ... }
fn all<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
where F: Fn(&V) -> bool + 'static,
V: 'static { ... }
fn count_items<F>(&self, counter: F) -> impl Fn(Root) -> Option<usize> + '_
where F: Fn(&V) -> usize + 'static,
V: 'static { ... }
fn find_in<Item, F>(&self, finder: F) -> impl Fn(Root) -> Option<Item> + '_
where F: Fn(&V) -> Option<Item> + 'static,
V: 'static,
Item: 'static { ... }
fn take<Output, F>(
&self,
n: usize,
taker: F,
) -> impl Fn(Root) -> Option<Output> + '_
where F: Fn(&V, usize) -> Output + 'static,
V: 'static,
Output: 'static { ... }
fn skip<Output, F>(
&self,
n: usize,
skipper: F,
) -> impl Fn(Root) -> Option<Output> + '_
where F: Fn(&V, usize) -> Output + 'static,
V: 'static,
Output: 'static { ... }
fn partition_value<Output, F>(
&self,
partitioner: F,
) -> impl Fn(Root) -> Option<Output> + '_
where F: Fn(&V) -> Output + 'static,
V: 'static,
Output: 'static { ... }
fn min_value<Item, F>(
&self,
min_fn: F,
) -> impl Fn(Root) -> Option<Item> + '_
where F: Fn(&V) -> Option<Item> + 'static,
V: 'static,
Item: 'static { ... }
fn max_value<Item, F>(
&self,
max_fn: F,
) -> impl Fn(Root) -> Option<Item> + '_
where F: Fn(&V) -> Option<Item> + 'static,
V: 'static,
Item: 'static { ... }
fn sum_value<Sum, F>(&self, sum_fn: F) -> impl Fn(Root) -> Option<Sum> + '_
where F: Fn(&V) -> Sum + 'static,
V: 'static,
Sum: 'static { ... }
}Provided Methods§
Sourcefn map<MappedValue, F>(
&self,
mapper: F,
) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
fn map<MappedValue, F>( &self, mapper: F, ) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
Map the value through a transformation function.
Sourcefn filter<F>(
&self,
predicate: F,
) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
fn filter<F>( &self, predicate: F, ) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
Filter the value based on a predicate.
Sourcefn filter_map<MappedValue, F>(
&self,
mapper: F,
) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
fn filter_map<MappedValue, F>( &self, mapper: F, ) -> Kp<R, MappedValue, Root, MappedValue, MutRoot, MappedValue, impl Fn(Root) -> Option<MappedValue> + '_, impl Fn(MutRoot) -> Option<MappedValue> + '_>
Map and flatten when mapper returns an Option.
Sourcefn inspect<F>(
&self,
inspector: F,
) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
fn inspect<F>( &self, inspector: F, ) -> Kp<R, V, Root, Value, MutRoot, MutValue, impl Fn(Root) -> Option<Value> + '_, impl Fn(MutRoot) -> Option<MutValue> + '_>
Apply a function for its side effects and return the value.
Sourcefn flat_map<I, Item, F>(&self, mapper: F) -> impl Fn(Root) -> Vec<Item> + '_
fn flat_map<I, Item, F>(&self, mapper: F) -> impl Fn(Root) -> Vec<Item> + '_
Flat map - maps to an iterator and flattens.
Sourcefn fold_value<Acc, F>(&self, init: Acc, folder: F) -> impl Fn(Root) -> Acc + '_
fn fold_value<Acc, F>(&self, init: Acc, folder: F) -> impl Fn(Root) -> Acc + '_
Fold/reduce the value using an accumulator function.
Sourcefn any<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
fn any<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
Check if any element satisfies a predicate.
Sourcefn all<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
fn all<F>(&self, predicate: F) -> impl Fn(Root) -> bool + '_
Check if all elements satisfy a predicate.
Sourcefn count_items<F>(&self, counter: F) -> impl Fn(Root) -> Option<usize> + '_
fn count_items<F>(&self, counter: F) -> impl Fn(Root) -> Option<usize> + '_
Count elements in a collection value.
Sourcefn find_in<Item, F>(&self, finder: F) -> impl Fn(Root) -> Option<Item> + '_
fn find_in<Item, F>(&self, finder: F) -> impl Fn(Root) -> Option<Item> + '_
Find first element matching predicate in a collection value.
Sourcefn take<Output, F>(
&self,
n: usize,
taker: F,
) -> impl Fn(Root) -> Option<Output> + '_
fn take<Output, F>( &self, n: usize, taker: F, ) -> impl Fn(Root) -> Option<Output> + '_
Take first N elements from a collection value.
Sourcefn skip<Output, F>(
&self,
n: usize,
skipper: F,
) -> impl Fn(Root) -> Option<Output> + '_
fn skip<Output, F>( &self, n: usize, skipper: F, ) -> impl Fn(Root) -> Option<Output> + '_
Skip first N elements from a collection value.
Sourcefn partition_value<Output, F>(
&self,
partitioner: F,
) -> impl Fn(Root) -> Option<Output> + '_
fn partition_value<Output, F>( &self, partitioner: F, ) -> impl Fn(Root) -> Option<Output> + '_
Partition a collection value into two groups based on predicate.
Sourcefn min_value<Item, F>(&self, min_fn: F) -> impl Fn(Root) -> Option<Item> + '_
fn min_value<Item, F>(&self, min_fn: F) -> impl Fn(Root) -> Option<Item> + '_
Get min value from a collection.
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.