pub struct SharedOperatorBuilder<S, O, A, Scorers, W, Sc> { /* private fields */ }Expand description
Builder holding a terminal’s impact and weight until it is named.
Scorers is () for the first terminal; first_named
finalizes it, named appends to an existing chain.
Implementations§
Sourcepub fn first(operator: O, adapter: A, impact: ImpactType, weight: W) -> Self
pub fn first(operator: O, adapter: A, impact: ImpactType, weight: W) -> Self
Starts the first terminal over operator. Hardness comes from
adapter.is_hard(&weight).
Sourcepub fn with_explainer(
self,
explain: fn(&O, &S, RowHandle, &mut Vec<EntityRef>),
) -> Self
pub fn with_explainer( self, explain: fn(&O, &S, RowHandle, &mut Vec<EntityRef>), ) -> Self
Sets the function that lists the entities behind a row, used by
get_matches. Without it, get_matches returns no matches.
Sourcepub fn first_with_hard(
operator: O,
adapter: A,
impact: ImpactType,
weight: W,
hard: bool,
) -> Self
pub fn first_with_hard( operator: O, adapter: A, impact: ImpactType, weight: W, hard: bool, ) -> Self
Like first, with explicit hardness.
Sourcepub fn first_named(
self,
name: &str,
) -> SharedOperatorTerminal<S, O, A, OperatorScorer<A::RowWeight, Sc>, Sc>
pub fn first_named( self, name: &str, ) -> SharedOperatorTerminal<S, O, A, OperatorScorer<A::RowWeight, Sc>, Sc>
Names the first terminal, producing a one-scorer terminal.
Sourcepub fn named(
self,
name: &str,
) -> SharedOperatorTerminal<S, O, A, ScorerChain<(Scorers, OperatorScorer<A::RowWeight, Sc>)>, Sc>
pub fn named( self, name: &str, ) -> SharedOperatorTerminal<S, O, A, ScorerChain<(Scorers, OperatorScorer<A::RowWeight, Sc>)>, Sc>
Names this terminal and appends it to the scorer chain.
Auto Trait Implementations§
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