GroupCrdtInnerState

Struct GroupCrdtInnerState 

Source
pub struct GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle, OP: OperationId + Ord,
{ 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, C, M> GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle, OP: OperationId + Ord, C: Conditions, M: Operation<ID, OP, GroupControlMessage<ID, C>>,

Source

pub fn heads(&self) -> HashSet<OP>

Current tips for the groups operation graph.

Source

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.

Source

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.

Source

pub fn members(&self, group_id: ID) -> Vec<(ID, Access<C>)>

Get all current members of a group.

Trait Implementations§

Source§

impl<ID, OP, C: Clone, M: Clone> Clone for GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle + Clone, OP: OperationId + Ord + Clone,

Source§

fn clone(&self) -> GroupCrdtInnerState<ID, OP, C, M>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<ID, OP, C: Debug, M: Debug> Debug for GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle + Debug, OP: OperationId + Ord + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<ID, OP, C, M> Default for GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle, OP: OperationId + Ord,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, ID, OP, C, M> Deserialize<'de> for GroupCrdtInnerState<ID, OP, C, M>
where ID: IdentityHandle + Deserialize<'de>, OP: OperationId + Ord + Deserialize<'de>, C: Deserialize<'de>, M: Deserialize<'de>,

Source§

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, C, M> Serialize for GroupCrdtInnerState<ID, OP, C, M>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<ID, OP, C, M> Freeze for GroupCrdtInnerState<ID, OP, C, M>

§

impl<ID, OP, C, M> RefUnwindSafe for GroupCrdtInnerState<ID, OP, C, M>

§

impl<ID, OP, C, M> Send for GroupCrdtInnerState<ID, OP, C, M>
where OP: Send, M: Send, ID: Send, C: Send,

§

impl<ID, OP, C, M> Sync for GroupCrdtInnerState<ID, OP, C, M>
where OP: Sync, M: Sync, ID: Sync, C: Sync,

§

impl<ID, OP, C, M> Unpin for GroupCrdtInnerState<ID, OP, C, M>
where OP: Unpin, M: Unpin, ID: Unpin, C: Unpin,

§

impl<ID, OP, C, M> UnwindSafe for GroupCrdtInnerState<ID, OP, C, M>
where OP: UnwindSafe, M: UnwindSafe, ID: UnwindSafe, C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,