Struct forest_actor::util::Multimap [−][src]
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
impl<'a, BS> Multimap<'a, BS> where
BS: BlockStore,
[src]
impl<'a, BS> Multimap<'a, BS> where
BS: BlockStore,
[src]pub fn new(bs: &'a BS, outer_bitwidth: u32, inner_bitwidth: usize) -> Self
[src]
pub fn new(bs: &'a BS, outer_bitwidth: u32, inner_bitwidth: usize) -> Self
[src]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.
pub fn from_root(
bs: &'a BS,
cid: &Cid,
outer_bitwidth: u32,
inner_bitwidth: usize
) -> Result<Self, Error>
[src]
pub fn from_root(
bs: &'a BS,
cid: &Cid,
outer_bitwidth: u32,
inner_bitwidth: usize
) -> Result<Self, Error>
[src]Initializes a multimap from a root Cid
pub fn add<V>(
&mut self,
key: BytesKey,
value: V
) -> Result<(), Box<dyn StdError>> where
V: Serialize + DeserializeOwned,
[src]
pub fn add<V>(
&mut self,
key: BytesKey,
value: V
) -> Result<(), Box<dyn StdError>> where
V: Serialize + DeserializeOwned,
[src]Adds a value for a key.
pub fn get<V>(
&self,
key: &[u8]
) -> Result<Option<Amt<'a, V, BS>>, Box<dyn StdError>> where
V: DeserializeOwned + Serialize,
[src]
pub fn get<V>(
&self,
key: &[u8]
) -> Result<Option<Amt<'a, V, BS>>, Box<dyn StdError>> where
V: DeserializeOwned + Serialize,
[src]Gets the Array of value type V
using the multimap store.
pub fn remove_all(&mut self, key: &[u8]) -> Result<(), Box<dyn StdError>>
[src]
pub fn remove_all(&mut self, key: &[u8]) -> Result<(), Box<dyn StdError>>
[src]Removes all values for a key.
Auto Trait Implementations
impl<'a, BS> RefUnwindSafe for Multimap<'a, BS> where
BS: RefUnwindSafe,
BS: RefUnwindSafe,
impl<'a, BS> Send for Multimap<'a, BS> where
BS: Sync,
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,
BS: RefUnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,