pub struct StrongRemove<ID, OP, C, ORD, GS> { /* private fields */ }Expand description
An implementation of GroupResolver trait which follows strong remove ruleset.
Concurrent operations are identified and processed, any which should be invalidated are added to the operation filter and not applied to the group state. Once an operation has been filtered, any operations which depended on any resulting state will not be applied to group state either. Ruleset for Concurrent Operations
The following ruleset is applied when choosing which operations to “filter” when concurrent operations are processed. It can be assumed that the behavior is equivalent for an admin member being removed, or demoted from admin to a lower access level.
§Strong Remove Concurrency Rules
§Removals
If a removal has occurred, filter any concurrent operations by the removed member, as long as it’s 1) not a predecessor of the remove operation, and 2) not a mutual removal (removal of the remover by the removed member).
§Mutual removals
Mutual removals result in both members being removed from the group, and any dependent concurrent branches are not applied to group state. We imagine further implementations taking different approaches, like resolving by seniority, hash id, quorum or some other parameter.
If a mutual removal has occurred, we want to retain the removal operations but filter all concurrent operations performed by the removed members (keeping predecessors of the remove).
§Re-adding member concurrently
If Alice removes Charlie and Bob removes then adds Charlie concurrently, Charlie is still in the group. However, if Charlie performed any concurrent actions, these will be filtered along with any dependent operations.
§Filtering of transitively dependent operations
When an operation is “explicitly” filtered it may cause dependent operations to become invalid, these operations will not be applied to the group state.
Trait Implementations§
Source§impl<ID: Clone, OP: Clone, C: Clone, ORD: Clone, GS: Clone> Clone for StrongRemove<ID, OP, C, ORD, GS>
impl<ID: Clone, OP: Clone, C: Clone, ORD: Clone, GS: Clone> Clone for StrongRemove<ID, OP, C, ORD, GS>
Source§fn clone(&self) -> StrongRemove<ID, OP, C, ORD, GS>
fn clone(&self) -> StrongRemove<ID, OP, C, ORD, GS>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<ID: Debug, OP: Debug, C: Debug, ORD: Debug, GS: Debug> Debug for StrongRemove<ID, OP, C, ORD, GS>
impl<ID: Debug, OP: Debug, C: Debug, ORD: Debug, GS: Debug> Debug for StrongRemove<ID, OP, C, ORD, GS>
Source§impl<ID: Default, OP: Default, C: Default, ORD: Default, GS: Default> Default for StrongRemove<ID, OP, C, ORD, GS>
impl<ID: Default, OP: Default, C: Default, ORD: Default, GS: Default> Default for StrongRemove<ID, OP, C, ORD, GS>
Source§fn default() -> StrongRemove<ID, OP, C, ORD, GS>
fn default() -> StrongRemove<ID, OP, C, ORD, GS>
Source§impl GroupStore<char, u32, (), StrongRemove<char, u32, (), TestOrderer, TestGroupStore>, TestOrderer> for TestGroupStore
impl GroupStore<char, u32, (), StrongRemove<char, u32, (), TestOrderer, TestGroupStore>, TestOrderer> for TestGroupStore
Source§impl<ID, OP, C, ORD, GS> Resolver<ID, OP, C, ORD, GS> for StrongRemove<ID, OP, C, ORD, GS>where
ID: IdentityHandle + Display + Ord,
OP: OperationId + Display + Ord,
C: Clone + Debug + PartialEq + PartialOrd,
ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Clone + Debug,
ORD::Operation: Clone,
ORD::State: Clone,
GS: GroupStore<ID, OP, C, Self, ORD> + Debug + Clone,
impl<ID, OP, C, ORD, GS> Resolver<ID, OP, C, ORD, GS> for StrongRemove<ID, OP, C, ORD, GS>where
ID: IdentityHandle + Display + Ord,
OP: OperationId + Display + Ord,
C: Clone + Debug + PartialEq + PartialOrd,
ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Clone + Debug,
ORD::Operation: Clone,
ORD::State: Clone,
GS: GroupStore<ID, OP, C, Self, ORD> + Debug + Clone,
Source§fn rebuild_required(
y: &GroupCrdtState<ID, OP, C, Self, ORD, GS>,
operation: &ORD::Operation,
) -> Result<bool, GroupCrdtError<ID, OP, C, Self, ORD, GS>>
fn rebuild_required( y: &GroupCrdtState<ID, OP, C, Self, ORD, GS>, operation: &ORD::Operation, ) -> Result<bool, GroupCrdtError<ID, OP, C, Self, ORD, GS>>
Identify if an operation should trigger a group state rebuild.
Source§fn process(
y: GroupCrdtState<ID, OP, C, Self, ORD, GS>,
) -> Result<GroupCrdtState<ID, OP, C, Self, ORD, GS>, GroupCrdtError<ID, OP, C, Self, ORD, GS>>
fn process( y: GroupCrdtState<ID, OP, C, Self, ORD, GS>, ) -> Result<GroupCrdtState<ID, OP, C, Self, ORD, GS>, GroupCrdtError<ID, OP, C, Self, ORD, GS>>
Process the group operation graph, producing a new filter and re-building all state accordingly.