Struct redb::MultimapTable
source · [−]pub struct MultimapTable<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> { /* private fields */ }
Expand description
A multimap table
Multimap tables may have multiple values associated with each key
Implementations
sourceimpl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> MultimapTable<'db, 'txn, K, V>
sourcepub fn insert(&mut self, key: &K, value: &V) -> Result<bool, Error>
pub fn insert(&mut self, key: &K, value: &V) -> Result<bool, Error>
Add the given value to the mapping of the key
Returns true
if the key-value pair was present
sourcepub fn remove(&mut self, key: &K, value: &V) -> Result<bool, Error>
pub fn remove(&mut self, key: &K, value: &V) -> Result<bool, Error>
Removes the given key-value pair
Returns true
if the key-value pair was present
sourcepub fn remove_all(&mut self, key: &K) -> Result<MultimapValueIter<'_, V>, Error>
pub fn remove_all(&mut self, key: &K) -> Result<MultimapValueIter<'_, V>, Error>
Removes all values for the given key
Returns an iterator over the removed values
Trait Implementations
sourceimpl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> Drop for MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> Drop for MultimapTable<'db, 'txn, K, V>
sourceimpl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> ReadableMultimapTable<K, V> for MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K: RedbKey + ?Sized, V: RedbKey + ?Sized> ReadableMultimapTable<K, V> for MultimapTable<'db, 'txn, K, V>
sourcefn get<'a>(&'a self, key: &'a K) -> Result<MultimapValueIter<'a, V>, Error>
fn get<'a>(&'a self, key: &'a K) -> Result<MultimapValueIter<'a, V>, Error>
Returns an iterator over all values for the given key
Auto Trait Implementations
impl<'db, 'txn, K, V> !RefUnwindSafe for MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K, V> !Send for MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K, V> !Sync for MultimapTable<'db, 'txn, K, V>
impl<'db, 'txn, K: ?Sized, V: ?Sized> Unpin for MultimapTable<'db, 'txn, K, V> where
K: Unpin,
V: Unpin,
'db: 'txn,
impl<'db, 'txn, K, V> !UnwindSafe for MultimapTable<'db, 'txn, K, V>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more