pub struct Weighted<H = FnvHasher> { /* private fields */ }Expand description
Weighted selection with a given selection algorithm
The default algorithm is FnvHasher. See super::algorithms for more choices.
Trait Implementations§
Source§impl<H: SelectionAlgorithm> BackendSelection for Weighted<H>
impl<H: SelectionAlgorithm> BackendSelection for Weighted<H>
Source§type Iter = WeightedIterator<H>
type Iter = WeightedIterator<H>
The BackendIter returned from iter() below.
Source§type Config = ()
type Config = ()
The configuration type constructing BackendSelection
Source§fn build(backends: &BTreeSet<Backend>) -> Self
fn build(backends: &BTreeSet<Backend>) -> Self
The function to create a BackendSelection implementation.
Source§fn iter(self: &Arc<Self>, key: &[u8]) -> Self::Iter
fn iter(self: &Arc<Self>, key: &[u8]) -> Self::Iter
Select backends for a given key. Read more
Source§fn build_with_config(
backends: &BTreeSet<Backend>,
_config: &Self::Config,
) -> Self
fn build_with_config( backends: &BTreeSet<Backend>, _config: &Self::Config, ) -> Self
Create a BackendSelection from a set of backends and the given configuration. The
default implementation ignores the configuration and simply calls Self::build
Auto Trait Implementations§
impl<H = FnvHasher> !RefUnwindSafe for Weighted<H>
impl<H = FnvHasher> !UnwindSafe for Weighted<H>
impl<H> Freeze for Weighted<H>where
H: Freeze,
impl<H> Send for Weighted<H>where
H: Send,
impl<H> Sync for Weighted<H>where
H: Sync,
impl<H> Unpin for Weighted<H>where
H: Unpin,
impl<H> UnsafeUnpin for Weighted<H>where
H: UnsafeUnpin,
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