Trait async_map::AsyncMap[][src]

pub trait AsyncMap: Clone + Send {
    type Key: KeyTrait;
    type Value: ValueTrait;
    fn get_if_present(&self, key: &Self::Key) -> Option<Self::Value>;
fn get<'a, 'b, B: FactoryBorrow<Self::Key, Self::Value>>(
        &'a self,
        key: &'a Self::Key,
        factory: B
    ) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'b>>; }

Associated Types

Required methods

fn get_if_present(&self, key: &Self::Key) -> Option<Self::Value>[src]

fn get<'a, 'b, B: FactoryBorrow<Self::Key, Self::Value>>(
    &'a self,
    key: &'a Self::Key,
    factory: B
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'b>>
[src]

Implementors

impl<K: KeyTrait + Sync, V: ValueTrait + Sync> AsyncMap for LockingMap<K, V>[src]

type Key = K

type Value = V

fn get_if_present(&self, key: &Self::Key) -> Option<Self::Value>[src]

fn get<'a, 'b, B: FactoryBorrow<K, V>>(
    &self,
    key: &'a Self::Key,
    factory: B
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'b>>
[src]

impl<K: KeyTrait, V: ValueTrait> AsyncMap for NonLockingMap<K, V>[src]

type Key = K

type Value = V

fn get_if_present(&self, key: &K) -> Option<V>[src]

fn get<'a, 'b, F: FactoryBorrow<K, V>>(
    &'a self,
    key: &'a K,
    factory: F
) -> Pin<Box<dyn Future<Output = V> + Send + 'b>>
[src]

impl<K: KeyTrait, V: ValueTrait> AsyncMap for VersionedMap<K, V>[src]

fn get_if_present(&self, key: &Self::Key) -> Option<Self::Value>[src]

Synchronously returns the value associated with the provided key, if present; otherwise None

type Key = K

type Value = V

fn get<'a, 'b, B: FactoryBorrow<K, V>>(
    &'a self,
    key: &'a Self::Key,
    factory: B
) -> Pin<Box<dyn Future<Output = Self::Value> + Send + 'b>>
[src]