pub struct TreeSync { /* private fields */ }Expand description
The TreeSync struct holds an MlsBinaryTree instance, which contains
the state that is synced across the group, as well as the LeafNodeIndex
pointing to the leaf of this group member and the current hash of the tree.
It follows the same pattern of tree and diff as the underlying
MlsBinaryTree, where the TreeSync instance is immutable safe for
merging a TreeSyncDiff, which can be created, staged and merged (see
TreeSyncDiff).
TreeSync instance guarantee a few invariants that are checked upon
creating a new instance from an imported set of nodes, as well as when
merging a diff.
Implementations§
Source§impl TreeSync
impl TreeSync
Sourcepub fn full_leaves(&self) -> impl Iterator<Item = (LeafNodeIndex, &LeafNode)>
pub fn full_leaves(&self) -> impl Iterator<Item = (LeafNodeIndex, &LeafNode)>
Returns an iterator over the (non-blank) LeafNodes in the tree.
Sourcepub fn full_parents(
&self,
) -> impl Iterator<Item = (ParentNodeIndex, &ParentNode)>
pub fn full_parents( &self, ) -> impl Iterator<Item = (ParentNodeIndex, &ParentNode)>
Returns an iterator over the (non-blank) ParentNodes in the tree.
Sourcepub fn blank_parents<'a>(&'a self) -> impl Iterator<Item = ParentNodeIndex> + 'a
pub fn blank_parents<'a>(&'a self) -> impl Iterator<Item = ParentNodeIndex> + 'a
Returns an iterator over the ParentNodeIndexes of blank ParentNodes in the tree.
Sourcepub fn blank_leaves<'a>(&'a self) -> impl Iterator<Item = LeafNodeIndex> + 'a
pub fn blank_leaves<'a>(&'a self) -> impl Iterator<Item = LeafNodeIndex> + 'a
Returns an iterator over the LeafNodeIndexes of blank LeafNodes in the tree.
Sourcepub fn export_ratchet_tree(&self) -> RatchetTree
pub fn export_ratchet_tree(&self) -> RatchetTree
Returns the nodes in the tree ordered according to the array-representation of the underlying binary tree.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TreeSync
impl<'de> Deserialize<'de> for TreeSync
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>,
impl Entity<CURRENT_VERSION> for TreeSync
impl StructuralPartialEq for TreeSync
impl TreeSync<CURRENT_VERSION> for TreeSync
Auto Trait Implementations§
impl Freeze for TreeSync
impl RefUnwindSafe for TreeSync
impl Send for TreeSync
impl Sync for TreeSync
impl Unpin for TreeSync
impl UnsafeUnpin for TreeSync
impl UnwindSafe for TreeSync
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
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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>
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>
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