pub struct GroupCrdtState<ID, OP, M, C>{
pub inner: GroupCrdtInnerState<ID, OP, M, C>,
}Expand description
State object for GroupCrdt containing an orderer state and the inner
state.
Fields§
§inner: GroupCrdtInnerState<ID, OP, M, C>Inner groups state.
Implementations§
Source§impl<ID, OP, M, C> GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> GroupCrdtState<ID, OP, M, C>
Sourcepub fn root_members(&self, group_id: ID) -> Vec<(GroupMember<ID>, Access<C>)>
pub fn root_members(&self, group_id: ID) -> Vec<(GroupMember<ID>, Access<C>)>
Get all direct members of a group.
This method does not recurse into sub-groups, but rather returns only the direct group members and their access levels.
Sourcepub fn members(&self, group_id: ID) -> Vec<(ID, Access<C>)>
pub fn members(&self, group_id: ID) -> Vec<(ID, Access<C>)>
Get all transitive members of a group.
This method recurses into all sub-groups and returns a resolved list of individual group members and their access levels.
Sourcepub fn has_group(&self, group_id: ID) -> bool
pub fn has_group(&self, group_id: ID) -> bool
Returns true if the passed group exists in the current state.
Sourcepub fn heads_filtered(&self, groups: &[ID]) -> Vec<OP>
pub fn heads_filtered(&self, groups: &[ID]) -> Vec<OP>
Get graph tips filtered to only those which included “create” operation for passed group ids in their causal history.
Source§impl<ID, OP, M, C> GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Ord + Display,
OP: OperationId + Ord + Display,
M: Operation<ID, OP, C>,
C: Conditions,
impl<ID, OP, M, C> GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Ord + Display,
OP: OperationId + Ord + Display,
M: Operation<ID, OP, C>,
C: Conditions,
Trait Implementations§
Source§impl<ID, OP, M: Clone, C: Clone> Clone for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M: Clone, C: Clone> Clone for GroupCrdtState<ID, OP, M, C>
Source§fn clone(&self) -> GroupCrdtState<ID, OP, M, C>
fn clone(&self) -> GroupCrdtState<ID, OP, M, C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<ID, OP, M, C> Default for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> Default for GroupCrdtState<ID, OP, M, C>
Source§impl<'de, ID, OP, M, C> Deserialize<'de> for GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Deserialize<'de>,
OP: OperationId + Ord + Deserialize<'de>,
M: Deserialize<'de>,
C: Deserialize<'de>,
impl<'de, ID, OP, M, C> Deserialize<'de> for GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Deserialize<'de>,
OP: OperationId + Ord + Deserialize<'de>,
M: Deserialize<'de>,
C: Deserialize<'de>,
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<ID, OP, M, C> Serialize for GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Serialize,
OP: OperationId + Ord + Serialize,
M: Serialize,
C: Serialize,
impl<ID, OP, M, C> Serialize for GroupCrdtState<ID, OP, M, C>where
ID: IdentityHandle + Serialize,
OP: OperationId + Ord + Serialize,
M: Serialize,
C: Serialize,
Auto Trait Implementations§
impl<ID, OP, M, C> Freeze for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> RefUnwindSafe for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> Send for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> Sync for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> Unpin for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> UnsafeUnpin for GroupCrdtState<ID, OP, M, C>
impl<ID, OP, M, C> UnwindSafe for GroupCrdtState<ID, OP, M, C>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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