Skip to main content

GroupCrdtState

Struct GroupCrdtState 

Source
pub struct GroupCrdtState<ID, OP, C, ORD>
where ID: IdentityHandle, OP: OperationId + Ord, ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Debug, ORD::Operation: Clone,
{ pub inner: GroupCrdtInnerState<ID, OP, C, ORD::Operation>, pub orderer_y: ORD::State, }
Expand description

State object for GroupCrdt containing an orderer state and the inner state.

Fields§

§inner: GroupCrdtInnerState<ID, OP, C, ORD::Operation>

Inner groups state.

§orderer_y: ORD::State

State for the orderer.

Implementations§

Source§

impl<ID, OP, C, ORD> GroupCrdtState<ID, OP, C, ORD>
where ID: IdentityHandle, OP: OperationId + Ord, C: Conditions, ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Debug, ORD::Operation: Clone,

Source

pub fn new(orderer_y: ORD::State) -> Self

Instantiate a new state.

Source

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.

Source

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.

Source

pub fn has_group(&self, group_id: ID) -> bool

Returns true if the passed group exists in the current state.

Source§

impl<ID, OP, C, ORD> GroupCrdtState<ID, OP, C, ORD>
where ID: IdentityHandle + Ord + Display, OP: OperationId + Ord + Display, C: Conditions, ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Clone + Debug, ORD::State: Clone, ORD::Operation: Clone,

Source

pub fn display(&self, group_id: ID) -> String

Print an auth group graph in DOT format for visualizing the group operation DAG.

Trait Implementations§

Source§

impl<ID, OP, C: Clone, ORD> Clone for GroupCrdtState<ID, OP, C, ORD>
where ID: IdentityHandle + Clone, OP: OperationId + Ord + Clone, ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Debug + Clone, ORD::Operation: Clone + Clone, ORD::State: Clone,

Source§

fn clone(&self) -> GroupCrdtState<ID, OP, C, ORD>

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, ORD> Debug for GroupCrdtState<ID, OP, C, ORD>
where ID: IdentityHandle + Debug, OP: OperationId + Ord + Debug, ORD: Orderer<ID, OP, GroupControlMessage<ID, C>> + Debug + Debug, ORD::Operation: Clone + Debug, ORD::State: Debug,

Source§

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

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

impl<'de, ID, OP, C, ORD> Deserialize<'de> for GroupCrdtState<ID, OP, C, ORD>

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, ORD> Serialize for GroupCrdtState<ID, OP, C, ORD>

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, ORD> Freeze for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: Freeze,

§

impl<ID, OP, C, ORD> RefUnwindSafe for GroupCrdtState<ID, OP, C, ORD>

§

impl<ID, OP, C, ORD> Send for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized + Send, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: Send, OP: Send, ID: Send, C: Send,

§

impl<ID, OP, C, ORD> Sync for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized + Sync, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: Sync, OP: Sync, ID: Sync, C: Sync,

§

impl<ID, OP, C, ORD> Unpin for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized + Unpin, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: Unpin, OP: Unpin, ID: Unpin, C: Unpin,

§

impl<ID, OP, C, ORD> UnsafeUnpin for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: UnsafeUnpin,

§

impl<ID, OP, C, ORD> UnwindSafe for GroupCrdtState<ID, OP, C, ORD>
where <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::Operation: Sized + UnwindSafe, <ORD as Orderer<ID, OP, GroupControlMessage<ID, C>>>::State: UnwindSafe, OP: 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>,