pub struct SetMultimap<'a, BS>(/* private fields */);Expand description
SetMultimap is a hamt with values that are also a hamt but are of the set variant. This allows hash sets to be indexable by an address.
Implementations§
Source§impl<'a, BS> SetMultimap<'a, BS>where
BS: Blockstore,
impl<'a, BS> SetMultimap<'a, BS>where
BS: Blockstore,
Sourcepub fn from_root(bs: &'a BS, cid: &Cid) -> Result<Self, Error>
pub fn from_root(bs: &'a BS, cid: &Cid) -> Result<Self, Error>
Initializes a SetMultimap from a root Cid.
Sourcepub fn put(&mut self, key: ChainEpoch, value: DealID) -> Result<(), Error>
pub fn put(&mut self, key: ChainEpoch, value: DealID) -> Result<(), Error>
Puts the DealID in the hash set of the key.
Sourcepub fn put_many(
&mut self,
key: ChainEpoch,
values: &[DealID],
) -> Result<(), Error>
pub fn put_many( &mut self, key: ChainEpoch, values: &[DealID], ) -> Result<(), Error>
Puts slice of DealIDs in the hash set of the key.
Sourcepub fn get(&self, key: ChainEpoch) -> Result<Option<Set<'a, BS>>, Error>
pub fn get(&self, key: ChainEpoch) -> Result<Option<Set<'a, BS>>, Error>
Gets the set at the given index of the SetMultimap
Sourcepub fn remove(&mut self, key: ChainEpoch, v: DealID) -> Result<(), Error>
pub fn remove(&mut self, key: ChainEpoch, v: DealID) -> Result<(), Error>
Removes a DealID from a key hash set.
Sourcepub fn remove_all(&mut self, key: ChainEpoch) -> Result<(), Error>
pub fn remove_all(&mut self, key: ChainEpoch) -> Result<(), Error>
Removes set at index.
Auto Trait Implementations§
impl<'a, BS> Freeze for SetMultimap<'a, BS>
impl<'a, BS> RefUnwindSafe for SetMultimap<'a, BS>where
BS: RefUnwindSafe,
impl<'a, BS> Send for SetMultimap<'a, BS>where
BS: Sync,
impl<'a, BS> !Sync for SetMultimap<'a, BS>
impl<'a, BS> Unpin for SetMultimap<'a, BS>
impl<'a, BS> UnwindSafe for SetMultimap<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more