Struct fil_actors_runtime_v10::util::Multimap
source · pub struct Multimap<'a, BS>(_, _);
Expand description
Multimap
stores multiple values per key in a HAMT of AMTs.
The order of insertion of values for each key is retained.
Implementations§
source§impl<'a, BS> Multimap<'a, BS>where
BS: Blockstore,
impl<'a, BS> Multimap<'a, BS>where BS: Blockstore,
sourcepub fn new(bs: &'a BS, outer_bitwidth: u32, inner_bitwidth: u32) -> Self
pub fn new(bs: &'a BS, outer_bitwidth: u32, inner_bitwidth: u32) -> Self
Initializes a new empty Multimap
.
The outer_bitwidth
is the width of the HAMT and the
inner_bitwidth
is the width of the AMTs inside of it.
sourcepub fn from_root(
bs: &'a BS,
cid: &Cid,
outer_bitwidth: u32,
inner_bitwidth: u32
) -> Result<Self, Error>
pub fn from_root( bs: &'a BS, cid: &Cid, outer_bitwidth: u32, inner_bitwidth: u32 ) -> Result<Self, Error>
Initializes a Multimap
from a root Cid
sourcepub fn add<V>(&mut self, key: BytesKey, value: V) -> Result<(), Error>where
V: Serialize + DeserializeOwned,
pub fn add<V>(&mut self, key: BytesKey, value: V) -> Result<(), Error>where V: Serialize + DeserializeOwned,
Adds a value for a key.
sourcepub fn get<V>(&self, key: &[u8]) -> Result<Option<Array<'a, V, BS>>, Error>where
V: DeserializeOwned + Serialize,
pub fn get<V>(&self, key: &[u8]) -> Result<Option<Array<'a, V, BS>>, Error>where V: DeserializeOwned + Serialize,
Gets the Array of value type V
using the Multimap
store.
Auto Trait Implementations§
impl<'a, BS> RefUnwindSafe for Multimap<'a, BS>where BS: RefUnwindSafe,
impl<'a, BS> Send for Multimap<'a, BS>where BS: Sync,
impl<'a, BS> !Sync for Multimap<'a, BS>
impl<'a, BS> Unpin for Multimap<'a, BS>
impl<'a, BS> UnwindSafe for Multimap<'a, BS>where BS: RefUnwindSafe,
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