pub struct Table<'db, 'txn, K: RedbKey + ?Sized + 'txn, V: RedbValue + ?Sized + 'txn> { /* private fields */ }
Expand description
A table containing key-value mappings
Implementations§
source§impl<'db, 'txn, K: RedbKey + ?Sized + 'txn, V: RedbValue + ?Sized + 'txn> Table<'db, 'txn, K, V>
impl<'db, 'txn, K: RedbKey + ?Sized + 'txn, V: RedbValue + ?Sized + 'txn> Table<'db, 'txn, K, V>
sourcepub fn insert<'a, 'b: 'a, AK, AV>(
&mut self,
key: &'a AK,
value: &'a AV
) -> Result<Option<AccessGuard<'_, V>>, Error>where
K: 'b,
V: 'b,
AK: Borrow<K::RefBaseType<'b>> + ?Sized,
AV: Borrow<V::RefBaseType<'b>> + ?Sized,
pub fn insert<'a, 'b: 'a, AK, AV>(
&mut self,
key: &'a AK,
value: &'a AV
) -> Result<Option<AccessGuard<'_, V>>, Error>where
K: 'b,
V: 'b,
AK: Borrow<K::RefBaseType<'b>> + ?Sized,
AV: Borrow<V::RefBaseType<'b>> + ?Sized,
Insert mapping of the given key to the given value
Returns the old value, if the key was present in the table
Trait Implementations§
source§impl<'db, 'txn, K: RedbKey + ?Sized, V: RedbValue + ?Sized> ReadableTable<K, V> for Table<'db, 'txn, K, V>
impl<'db, 'txn, K: RedbKey + ?Sized, V: RedbValue + ?Sized> ReadableTable<K, V> for Table<'db, 'txn, K, V>
source§fn get<'a, 'b: 'a, AK>(
&self,
key: &'a AK
) -> Result<Option<AccessGuard<'_, V>>, Error>where
K: 'b,
AK: Borrow<K::RefBaseType<'b>> + ?Sized,
fn get<'a, 'b: 'a, AK>(
&self,
key: &'a AK
) -> Result<Option<AccessGuard<'_, V>>, Error>where
K: 'b,
AK: Borrow<K::RefBaseType<'b>> + ?Sized,
Returns the value corresponding to the given key