Map

Struct Map 

Source
pub struct Map<'db, 'tbl, K, V, C>
where K: Format, V: Format, C: Savepointable,
{ /* private fields */ }
Expand description

Deterministic store set.

Implementations§

Source§

impl<K, V, C> Map<'static, 'static, K, V, C>
where K: Format, V: Format, C: Savepointable,

Source

pub fn open(connection: C) -> Result<Self, OpenError>

Source

pub fn unchecked_open(connection: C) -> Self

Open a set without creating it or checking if it exists. This is safe if you call a safe open in (or under) the same transaction or savepoint beforehand.

Source§

impl<'db, 'tbl, K, V, C> Map<'db, 'tbl, K, V, C>
where K: Format, V: Format, C: Savepointable,

Source

pub fn open_with_config( connection: C, config: Config<'db, 'tbl>, ) -> Result<Self, OpenError>

Source

pub fn unchecked_open_with_config( connection: C, config: Config<'db, 'tbl>, ) -> Self

Open a set without creating it or checking if it exists. This is safe if you call a safe open in (or under) the same transaction or savepoint beforehand.

Source

pub fn insert( &mut self, key: &K::In, value: &V::In, ) -> Result<Option<V::Out>, Error<K, V>>

Source

pub fn len(&mut self) -> Result<u64, Error<K, V>>

Source

pub fn is_empty(&mut self) -> Result<bool, Error<K, V>>

Source

pub fn get(&mut self, key: &K::In) -> Result<Option<V::Out>, Error<K, V>>

Source

pub fn remove(&mut self, key: &K::In) -> Result<Option<V::Out>, Error<K, V>>

Source

pub fn contains_key(&mut self, key: &K::In) -> Result<bool, Error<K, V>>

Source

pub fn clear(&mut self) -> Result<(), Error<K, V>>

Source

pub fn iter( &mut self, ) -> Result<KeyValueIter<'db, 'tbl, K, V, Savepoint<'_>>, Error<K, V>>

Source

pub fn keys( &mut self, ) -> Result<KeyIter<'db, 'tbl, K, V, Savepoint<'_>>, Error<K, V>>

Source

pub fn values( &mut self, ) -> Result<ValueIter<'db, 'tbl, K, V, Savepoint<'_>>, Error<K, V>>

Source

pub fn retain<F>(&mut self, f: F) -> Result<(), Error<K, V>>
where F: FnMut(K::Out, V::Out) -> bool,

Retains only the elements specified by the predicate.

In other words, remove all pairs (k, v) for which f(k, v) returns false. The elements are visited in unsorted (and unspecified) order.

This is all done in a single transaction.

Auto Trait Implementations§

§

impl<'db, 'tbl, K, V, C> Freeze for Map<'db, 'tbl, K, V, C>
where C: Freeze,

§

impl<'db, 'tbl, K, V, C> RefUnwindSafe for Map<'db, 'tbl, K, V, C>

§

impl<'db, 'tbl, K, V, C> Send for Map<'db, 'tbl, K, V, C>
where C: Send, K: Send, V: Send,

§

impl<'db, 'tbl, K, V, C> Sync for Map<'db, 'tbl, K, V, C>
where C: Sync, K: Sync, V: Sync,

§

impl<'db, 'tbl, K, V, C> Unpin for Map<'db, 'tbl, K, V, C>
where C: Unpin, K: Unpin, V: Unpin,

§

impl<'db, 'tbl, K, V, C> UnwindSafe for Map<'db, 'tbl, K, V, C>
where C: UnwindSafe, K: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.