pub struct GroupCrdtInnerState<ID, OP, M, C>{
pub operations: HashMap<OP, M>,
pub ignore: HashSet<OP>,
pub mutual_removes: HashSet<OP>,
pub states: HashMap<OP, HashMap<ID, GroupMembersState<GroupMember<ID>, C>>>,
pub graph: DiGraphMap<OP, ()>,
}Expand description
Inner state object for GroupCrdt which contains the actual groups state,
including operation graph and membership snapshots.
Fields§
§operations: HashMap<OP, M>All operations processed by this group.
ignore: HashSet<OP>All operations who’s actions should be ignored.
mutual_removes: HashSet<OP>All operations which are part of a mutual remove cycle.
states: HashMap<OP, HashMap<ID, GroupMembersState<GroupMember<ID>, C>>>All resolved states.
graph: DiGraphMap<OP, ()>Operation graph of all auth operations.
Implementations§
Source§impl<ID, OP, M, C> GroupCrdtInnerState<ID, OP, M, C>
impl<ID, OP, M, C> GroupCrdtInnerState<ID, OP, M, C>
Sourcepub fn heads_filtered(&self, groups: &[ID]) -> HashSet<OP>
pub fn heads_filtered(&self, groups: &[ID]) -> HashSet<OP>
Get graph tips filtered to only those which included “create” operation for passed group ids in their causal history.
Sourcepub fn current_state(
&self,
) -> HashMap<ID, GroupMembersState<GroupMember<ID>, C>>
pub fn current_state( &self, ) -> HashMap<ID, GroupMembersState<GroupMember<ID>, C>>
Current group states.
This method gets the state at all graph tips and then merges them together into one new state which represents the current state of the groups.
Sourcepub fn state_at(
&self,
dependencies: &HashSet<OP>,
) -> Result<HashMap<ID, GroupMembersState<GroupMember<ID>, C>>, GroupCrdtInnerError<OP>>
pub fn state_at( &self, dependencies: &HashSet<OP>, ) -> Result<HashMap<ID, GroupMembersState<GroupMember<ID>, C>>, GroupCrdtInnerError<OP>>
Get the state at a certain point in history.
Sourcepub fn members(&self, group_id: ID) -> Vec<(ID, Access<C>)>
pub fn members(&self, group_id: ID) -> Vec<(ID, Access<C>)>
Get all current individual members of a group.
Sourcepub fn groups(&self, group_id: ID) -> Vec<(ID, Access<C>)>
pub fn groups(&self, group_id: ID) -> Vec<(ID, Access<C>)>
Get all current transitive groups inside a group.
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.
Trait Implementations§
Source§impl<ID, OP, M: Clone, C: Clone> Clone for GroupCrdtInnerState<ID, OP, M, C>
Available on crate features test_utils only.
impl<ID, OP, M: Clone, C: Clone> Clone for GroupCrdtInnerState<ID, OP, M, C>
test_utils only.Source§fn clone(&self) -> GroupCrdtInnerState<ID, OP, M, C>
fn clone(&self) -> GroupCrdtInnerState<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 moreSource§impl<ID, OP, M, C> Default for GroupCrdtInnerState<ID, OP, M, C>
impl<ID, OP, M, C> Default for GroupCrdtInnerState<ID, OP, M, C>
Source§impl<'de, ID, OP, M, C> Deserialize<'de> for GroupCrdtInnerState<ID, OP, M, C>where
ID: Author,
OP: OperationId + Ord + Deserialize<'de>,
M: Deserialize<'de>,
C: Deserialize<'de>,
Available on crate features serde only.
impl<'de, ID, OP, M, C> Deserialize<'de> for GroupCrdtInnerState<ID, OP, M, C>where
ID: Author,
OP: OperationId + Ord + Deserialize<'de>,
M: Deserialize<'de>,
C: Deserialize<'de>,
serde only.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>,
Source§impl<ID, OP, M, C> Serialize for GroupCrdtInnerState<ID, OP, M, C>
Available on crate features serde only.
impl<ID, OP, M, C> Serialize for GroupCrdtInnerState<ID, OP, M, C>
serde only.