pub struct VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,{
pub hamt: Cid,
pub changelog: Cid,
pub signature: PhantomData<(Key, Value)>,
}Expand description
A VersionedMapIpld pairs a Hamt and a ChangelogIpld to enable a data structure that contains its difference from a historical ancestor without requiring that a diff be performed.
Fields§
§hamt: CidA pointer to a Hamt root
changelog: CidA pointer to a ChangelogIpld
signature: PhantomData<(Key, Value)>Implementations§
Source§impl<Key, Value> VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
impl<Key, Value> VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
Sourcepub async fn load_hamt<S: BlockStore>(
&self,
store: &S,
) -> Result<Hamt<S, Value, Key, Sha256>>
pub async fn load_hamt<S: BlockStore>( &self, store: &S, ) -> Result<Hamt<S, Value, Key, Sha256>>
Load the Hamt root associated with this VersionedMapIpld
Sourcepub async fn load_changelog<S: BlockStore>(
&self,
store: &S,
) -> Result<ChangelogIpld<MapOperation<Key, Value>>>
pub async fn load_changelog<S: BlockStore>( &self, store: &S, ) -> Result<ChangelogIpld<MapOperation<Key, Value>>>
Load the ChangelogIpld associated with this VersionedMapIpld
Sourcepub async fn empty<S: BlockStore>(store: &mut S) -> Result<Self>
pub async fn empty<S: BlockStore>(store: &mut S) -> Result<Self>
Initialize an empty VersionedMapIpld, creating an empty Hamt root and ChangelogIpld as well
Trait Implementations§
Source§impl<Key, Value> Clone for VersionedMapIpld<Key, Value>
impl<Key, Value> Clone for VersionedMapIpld<Key, Value>
Source§fn clone(&self) -> VersionedMapIpld<Key, Value>
fn clone(&self) -> VersionedMapIpld<Key, Value>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Key, Value> Debug for VersionedMapIpld<Key, Value>
impl<Key, Value> Debug for VersionedMapIpld<Key, Value>
Source§impl<Key, Value> Default for VersionedMapIpld<Key, Value>
impl<Key, Value> Default for VersionedMapIpld<Key, Value>
Source§fn default() -> VersionedMapIpld<Key, Value>
fn default() -> VersionedMapIpld<Key, Value>
Returns the “default value” for a type. Read more
Source§impl<'de, Key, Value> Deserialize<'de> for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
impl<'de, Key, Value> Deserialize<'de> for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<Key, Value> PartialEq for VersionedMapIpld<Key, Value>
impl<Key, Value> PartialEq for VersionedMapIpld<Key, Value>
Source§fn eq(&self, other: &VersionedMapIpld<Key, Value>) -> bool
fn eq(&self, other: &VersionedMapIpld<Key, Value>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<Key, Value> Serialize for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
impl<Key, Value> Serialize for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
Source§impl<K, V> TryBundle for VersionedMapIpld<K, V>
impl<K, V> TryBundle for VersionedMapIpld<K, V>
fn extend_bundle<'life0, 'life1, 'life2, 'async_trait, S>(
&'life0 self,
bundle: &'life1 mut Bundle,
store: &'life2 S,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn extend_bundle_with_cid<'life0, 'life1, 'life2, 'async_trait, S>(
cid: &'life0 Cid,
bundle: &'life1 mut Bundle,
store: &'life2 S,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn bundle<'life0, 'life1, 'async_trait, S>(
&'life0 self,
store: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<Bundle>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn bundle_with_cid<'life0, 'life1, 'async_trait, S>(
cid: &'life0 Cid,
store: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<Bundle>> + Send + 'async_trait>>where
S: 'async_trait + BlockStore,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
impl<Key, Value> Eq for VersionedMapIpld<Key, Value>
impl<Key, Value> StructuralPartialEq for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey,
Value: VersionedMapValue,
Auto Trait Implementations§
impl<Key, Value> Freeze for VersionedMapIpld<Key, Value>
impl<Key, Value> RefUnwindSafe for VersionedMapIpld<Key, Value>where
Key: RefUnwindSafe,
Value: RefUnwindSafe,
impl<Key, Value> Send for VersionedMapIpld<Key, Value>
impl<Key, Value> Sync for VersionedMapIpld<Key, Value>
impl<Key, Value> Unpin for VersionedMapIpld<Key, Value>
impl<Key, Value> UnwindSafe for VersionedMapIpld<Key, Value>where
Key: UnwindSafe,
Value: UnwindSafe,
Blanket Implementations§
Source§impl<T> Base64Encode for Twhere
T: DagJson,
impl<T> Base64Encode for Twhere
T: DagJson,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DagJson for Twhere
T: Serialize + DeserializeOwned,
impl<T> DagJson for Twhere
T: Serialize + DeserializeOwned,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.