Trait Selector

Source
pub trait Selector {
    // Required methods
    fn servers(&self) -> impl Future<Output = Vec<Server>> + Send + Sync;
    fn server(
        &self,
        key: &Key,
    ) -> impl Future<Output = Result<Server, MtopError>> + Send + Sync;
}
Expand description

Logic for picking a server to “own” a particular cache key.

Required Methods§

Source

fn servers(&self) -> impl Future<Output = Vec<Server>> + Send + Sync

Get a copy of all known servers.

Source

fn server( &self, key: &Key, ) -> impl Future<Output = Result<Server, MtopError>> + Send + Sync

Get the Server that owns the given key, or an error if there are no servers.

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.

Implementors§