Skip to main content

SharedOperatorBuilder

Struct SharedOperatorBuilder 

Source
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§

Source§

impl<S, O, A, W, Sc> SharedOperatorBuilder<S, O, A, (), W, Sc>

Source

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).

Source

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.

Source

pub fn first_with_hard( operator: O, adapter: A, impact: ImpactType, weight: W, hard: bool, ) -> Self

Like first, with explicit hardness.

Source§

impl<S, O, A, W, Sc> SharedOperatorBuilder<S, O, A, (), W, Sc>
where S: Send + Sync + 'static, O: GroupedOperator<S> + Send + Sync, A: AdaptWeight<S, O, W, Sc>, Sc: Score,

Source

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.

Source§

impl<S, O, A, Scorers, W, Sc> SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where S: Send + Sync + 'static, O: GroupedOperator<S> + Send + Sync, A: AdaptWeight<S, O, W, Sc>, Scorers: OperatorScorerSet<S, O, Sc>, Sc: Score,

Source

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§

§

impl<S, O, A, Scorers, W, Sc> Forget for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>

§

impl<S, O, A, Scorers, W, Sc> Freeze for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: Freeze, W: Freeze,

§

impl<S, O, A, Scorers, W, Sc> RefUnwindSafe for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: RefUnwindSafe, W: RefUnwindSafe,

§

impl<S, O, A, Scorers, W, Sc> Send for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: Send, W: Send,

§

impl<S, O, A, Scorers, W, Sc> Sync for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: Sync, W: Sync,

§

impl<S, O, A, Scorers, W, Sc> Unpin for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: Unpin, W: Unpin,

§

impl<S, O, A, Scorers, W, Sc> UnsafeUnpin for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: UnsafeUnpin, W: UnsafeUnpin,

§

impl<S, O, A, Scorers, W, Sc> UnwindSafe for SharedOperatorBuilder<S, O, A, Scorers, W, Sc>
where SharedOperatorTerminal<S, O, A, Scorers, Sc>: UnwindSafe, W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.