pub struct ClosureRule<T>where
T: Clone,{
pub closure: fn(&T, &Bucket<T>) -> Scalar,
}Expand description
Bucket rule that applies score based on closure result.
Fields§
§closure: fn(&T, &Bucket<T>) -> ScalarClosure that will calculate item score.
Implementations§
Trait Implementations§
Source§impl<T> Clone for ClosureRule<T>
impl<T> Clone for ClosureRule<T>
Source§fn clone(&self) -> ClosureRule<T>
fn clone(&self) -> ClosureRule<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for ClosureRule<T>
impl<T> RefUnwindSafe for ClosureRule<T>
impl<T> Send for ClosureRule<T>
impl<T> Sync for ClosureRule<T>
impl<T> Unpin for ClosureRule<T>
impl<T> UnwindSafe for ClosureRule<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more