[][src]Struct rbatis_core::sync::sync_map::SyncMap

pub struct SyncMap<K, V> where
    K: Eq + Hash
{ pub shard: RwLock<HashMap<K, V, RandomState>>, }

SyncMap impl the Send and Sync it use of RwLock,so it's safe! but we went convert lifetime ,so use some lifetime convert unsafe method(but it is safe)

Fields

shard: RwLock<HashMap<K, V, RandomState>>

Implementations

impl<'a, K: 'a + Eq + Hash, V: 'a> SyncMap<K, V> where
    K: Eq + Hash
[src]

pub fn new() -> Self[src]

pub fn with_capacity(capacity: usize) -> Self[src]

pub async fn insert<'_>(&'_ self, key: K, value: V) -> Option<V>[src]

pub async fn remove<Q: ?Sized, '_, '_>(&'_ self, key: &'_ Q) -> Option<V> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

pub async fn clear<'_>(&'_ self)[src]

pub async fn shrink_to_fit<'_>(&'_ self)[src]

pub async fn reserve<'_>(&'_ self, additional: usize)[src]

pub async fn read<'_, '_>(
    &'_ self
) -> RwLockReadGuard<'_, HashMap<K, V, RandomState>>
[src]

pub async fn write<'_, '_>(
    &'_ self
) -> RwLockWriteGuard<'_, HashMap<K, V, RandomState>>
[src]

pub async fn get<Q: ?Sized, '_>(&'a self, k: &'_ Q) -> Option<Ref<'a, K, V>> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

pub async fn get_mut<Q: ?Sized, '_>(
    &'a self,
    k: &'_ Q
) -> Option<RefMut<'a, K, V>> where
    K: Borrow<Q>,
    Q: Hash + Eq
[src]

Auto Trait Implementations

impl<K, V> !RefUnwindSafe for SyncMap<K, V>

impl<K, V> Send for SyncMap<K, V> where
    K: Send,
    V: Send

impl<K, V> Sync for SyncMap<K, V> where
    K: Send + Sync,
    V: Send + Sync

impl<K, V> Unpin for SyncMap<K, V> where
    K: Unpin,
    V: Unpin

impl<K, V> UnwindSafe for SyncMap<K, V> where
    K: UnwindSafe,
    V: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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