Struct noosphere_core::data::VersionedMapIpld
source · 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>where
Key: VersionedMapKey + Clone,
Value: VersionedMapValue + Clone,
impl<Key, Value> Clone for VersionedMapIpld<Key, Value>where Key: VersionedMapKey + Clone, Value: VersionedMapValue + Clone,
source§fn clone(&self) -> VersionedMapIpld<Key, Value>
fn clone(&self) -> VersionedMapIpld<Key, Value>
Returns a copy 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>where
Key: VersionedMapKey + Debug,
Value: VersionedMapValue + Debug,
impl<Key, Value> Debug for VersionedMapIpld<Key, Value>where Key: VersionedMapKey + Debug, Value: VersionedMapValue + Debug,
source§impl<Key, Value> Default for VersionedMapIpld<Key, Value>where
Key: VersionedMapKey + Default,
Value: VersionedMapValue + Default,
impl<Key, Value> Default for VersionedMapIpld<Key, Value>where Key: VersionedMapKey + Default, Value: VersionedMapValue + Default,
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>where
Key: VersionedMapKey + PartialEq,
Value: VersionedMapValue + PartialEq,
impl<Key, Value> PartialEq for VersionedMapIpld<Key, Value>where Key: VersionedMapKey + PartialEq, Value: VersionedMapValue + PartialEq,
source§fn eq(&self, other: &VersionedMapIpld<Key, Value>) -> bool
fn eq(&self, other: &VersionedMapIpld<Key, Value>) -> bool
This method 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>where
K: VersionedMapKey,
V: VersionedMapValue + TryBundle,
impl<K, V> TryBundle for VersionedMapIpld<K, V>where K: VersionedMapKey, V: VersionedMapValue + TryBundle,
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, Self: 'async_trait, '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>where Key: VersionedMapKey + Eq, Value: VersionedMapValue + Eq,
impl<Key, Value> StructuralEq for VersionedMapIpld<Key, Value>where Key: VersionedMapKey, Value: VersionedMapValue,
impl<Key, Value> StructuralPartialEq for VersionedMapIpld<Key, Value>where Key: VersionedMapKey, Value: VersionedMapValue,
Auto Trait Implementations§
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>where Key: Unpin, Value: Unpin,
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> DagJson for Twhere
T: Serialize + DeserializeOwned,
impl<T> DagJson for Twhere T: Serialize + DeserializeOwned,
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.