Skip to main content

SelectionContextBuilder

Struct SelectionContextBuilder 

Source
pub struct SelectionContextBuilder<___State = __SelectionContextBuilderInitialState> { /* private fields */ }
Expand description

Use builder syntax to set the required parameters and finish by calling the method Self::build().

Implementations§

Source§

impl<__EstimatedCost, __HashKey, __Tags, __Exclude> SelectionContextBuilder<(__EstimatedCost, __HashKey, __Tags, __Exclude)>

Source

pub fn build(self) -> SelectionContext
where __EstimatedCost: IntoSet<Option<f64>, SelectionContextBuilder__estimated_cost>, __HashKey: IntoSet<Option<u64>, SelectionContextBuilder__hash_key>, __Tags: IntoSet<Option<HashMap<String, String>>, SelectionContextBuilder__tags>, __Exclude: IntoSet<Option<Vec<usize>>, SelectionContextBuilder__exclude>,

Finishes building and returns the requested object.

Source

pub fn maybe_estimated_cost( self, value: Option<f64>, ) -> <Self as __SelectionContextBuilderSetMember>::EstimatedCost
where __EstimatedCost: IsUnset,

Same as Self::estimated_cost, but accepts an Option as input. See that method’s documentation for more details.

Source

pub fn estimated_cost( self, value: f64, ) -> <Self as __SelectionContextBuilderSetMember>::EstimatedCost
where __EstimatedCost: IsUnset,

Estimated cost/weight of this request (e.g., token count).

Source

pub fn maybe_hash_key( self, value: Option<u64>, ) -> <Self as __SelectionContextBuilderSetMember>::HashKey
where __HashKey: IsUnset,

Same as Self::hash_key, but accepts an Option as input. See that method’s documentation for more details.

Source

pub fn hash_key( self, value: u64, ) -> <Self as __SelectionContextBuilderSetMember>::HashKey
where __HashKey: IsUnset,

Hash key for consistent hashing strategies.

Source

pub fn maybe_tags( self, value: Option<HashMap<String, String>>, ) -> <Self as __SelectionContextBuilderSetMember>::Tags
where __Tags: IsUnset,

Same as Self::tags, but accepts an Option as input. See that method’s documentation for more details.

Source

pub fn tags( self, value: HashMap<String, String>, ) -> <Self as __SelectionContextBuilderSetMember>::Tags
where __Tags: IsUnset,

Arbitrary tags for routing decisions. None by default to avoid allocation.

Source

pub fn maybe_exclude( self, value: Option<Vec<usize>>, ) -> <Self as __SelectionContextBuilderSetMember>::Exclude
where __Exclude: IsUnset,

Same as Self::exclude, but accepts an Option as input. See that method’s documentation for more details.

Source

pub fn exclude( self, value: Vec<usize>, ) -> <Self as __SelectionContextBuilderSetMember>::Exclude
where __Exclude: IsUnset,

Indices to skip during selection (for retry scenarios). None by default to avoid allocation.

Auto Trait Implementations§

§

impl<___State> Freeze for SelectionContextBuilder<___State>
where ___State: Freeze,

§

impl<___State> RefUnwindSafe for SelectionContextBuilder<___State>
where ___State: RefUnwindSafe,

§

impl<___State> Send for SelectionContextBuilder<___State>
where ___State: Send,

§

impl<___State> Sync for SelectionContextBuilder<___State>
where ___State: Sync,

§

impl<___State> Unpin for SelectionContextBuilder<___State>
where ___State: Unpin,

§

impl<___State> UnsafeUnpin for SelectionContextBuilder<___State>
where ___State: UnsafeUnpin,

§

impl<___State> UnwindSafe for SelectionContextBuilder<___State>
where ___State: 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V