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 individuals 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 groups(&self, group_id: ID) -> Vec<(ID, Access<C>)>
pub fn groups(&self, group_id: ID) -> Vec<(ID, Access<C>)>
Get all transitive groups inside a group.
This method recurses into all sub-groups and returns a resolved list of nested group members and their access levels.
Sourcepub fn traverse_members(
&self,
group_id: ID,
depth: u32,
) -> Vec<(GroupMember<ID>, Access<C>)>
pub fn traverse_members( &self, group_id: ID, depth: u32, ) -> Vec<(GroupMember<ID>, Access<C>)>
Traverse membership graph with a specified max. depth and return all visited members (individuals and transitive groups) of a group.
Set depth to 0 to traverse the full graph.
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>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more