pub struct MapMap<'a, BS, V, K1, K2> { /* private fields */ }

Implementations§

source§

impl<'a, BS, V, K1, K2> MapMap<'a, BS, V, K1, K2>where BS: Blockstore, V: Serialize + DeserializeOwned + Clone + PartialEq, K1: Keyer + Debug + Display, K2: Keyer + Debug + Display,

source

pub fn new(bs: &'a BS, outer_bitwidth: u32, inner_bitwidth: u32) -> Self

source

pub fn from_root( bs: &'a BS, cid: &Cid, outer_bitwidth: u32, inner_bitwidth: u32 ) -> Result<Self, Error>

source

pub fn flush(&mut self) -> Result<Cid, Error>

source

pub fn get(&mut self, outside_k: K1, inside_k: K2) -> Result<Option<&V>, Error>

source

pub fn for_each<F>(&mut self, outside_k: K1, f: F) -> Result<(), Error>where F: FnMut(&BytesKey, &V) -> Result<()>,

source

pub fn put( &mut self, outside_k: K1, inside_k: K2, value: V ) -> Result<Option<V>, Error>

source

pub fn put_if_absent( &mut self, outside_k: K1, inside_k: K2, value: V ) -> Result<bool, Error>

source

pub fn put_many<I>(&mut self, outside_k: K1, values: I) -> Result<(), Error>where I: Iterator<Item = (K2, V)>,

source

pub fn remove( &mut self, outside_k: K1, inside_k: K2 ) -> Result<Option<V>, Error>

Removes a key from the MapMap, returning the value at the key if the key was previously set.

Auto Trait Implementations§

§

impl<'a, BS, V, K1, K2> RefUnwindSafe for MapMap<'a, BS, V, K1, K2>where BS: RefUnwindSafe, K1: RefUnwindSafe, K2: RefUnwindSafe, V: UnwindSafe + RefUnwindSafe,

§

impl<'a, BS, V, K1, K2> Send for MapMap<'a, BS, V, K1, K2>where BS: Sync, K1: Send, K2: Send, V: Send,

§

impl<'a, BS, V, K1, K2> !Sync for MapMap<'a, BS, V, K1, K2>

§

impl<'a, BS, V, K1, K2> Unpin for MapMap<'a, BS, V, K1, K2>where K1: Unpin, K2: Unpin,

§

impl<'a, BS, V, K1, K2> UnwindSafe for MapMap<'a, BS, V, K1, K2>where BS: RefUnwindSafe, K1: UnwindSafe, K2: UnwindSafe, V: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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.

§

impl<T> References<RawCodec> for T

§

fn references<R, E>(_c: RawCodec, _r: &mut R, _set: &mut E) -> Result<(), Error>where R: Read, E: Extend<Cid<64>>,

Scrape the references from an impl Read. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.