pub trait BackendSelection {
type Iter;
// Required methods
fn build(backends: &BTreeSet<Backend>) -> Self;
fn iter(self: &Arc<Self>, key: &[u8]) -> Self::Iter
where Self::Iter: BackendIter;
}
Expand description
BackendSelection is the interface to implement backend selection mechanisms.
Required Associated Types§
Sourcetype Iter
type Iter
The BackendIter returned from iter() below.
Required Methods§
Sourcefn build(backends: &BTreeSet<Backend>) -> Self
fn build(backends: &BTreeSet<Backend>) -> Self
The function to create a BackendSelection implementation.
Sourcefn iter(self: &Arc<Self>, key: &[u8]) -> Self::Iterwhere
Self::Iter: BackendIter,
fn iter(self: &Arc<Self>, key: &[u8]) -> Self::Iterwhere
Self::Iter: BackendIter,
Select backends for a given key.
An BackendIter should be returned. The first item in the iter is the first choice backend. The user should continue to iterate over it if the first backend cannot be used due to its health or other reasons.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.