pub struct Map<K, V> { /* private fields */ }Expand description
A key-value map.
Implementations§
Source§impl<K, V> Map<K, V>where
K: ObjectKey,
V: ObjectValue,
impl<K, V> Map<K, V>where
K: ObjectKey,
V: ObjectValue,
Sourcepub fn get<'a, 'b, L>(
&self,
ctx: &'a Context<'_>,
key: L,
) -> Result<Option<<V as ObjectValue>::Out<'a>>, ClientError<u8>>
pub fn get<'a, 'b, L>( &self, ctx: &'a Context<'_>, key: L, ) -> Result<Option<<V as ObjectValue>::Out<'a>>, ClientError<u8>>
Gets the value of the map at the given key.
Sourcepub fn set<'a, L, U>(
&self,
ctx: &mut Context<'_>,
key: L,
value: U,
) -> Result<(), ClientError<u8>>
pub fn set<'a, L, U>( &self, ctx: &mut Context<'_>, key: L, value: U, ) -> Result<(), ClientError<u8>>
Sets the value of the map at the given key.
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Map<K, V>
impl<K, V> RefUnwindSafe for Map<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Map<K, V>
impl<K, V> Sync for Map<K, V>
impl<K, V> Unpin for Map<K, V>
impl<K, V> UnwindSafe for Map<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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