GroupControlMessage

Struct GroupControlMessage 

Source
pub struct GroupControlMessage<ID, C> {
    pub group_id: ID,
    pub action: GroupAction<ID, C>,
}
Expand description

Control messages which are processed in order to update group state.

There are two variants, one containing a group action and the ID of the group to which the action should be applied. The other is a special message which can be used to “undo” a message which has been previously applied to the group.

Fields§

§group_id: ID§action: GroupAction<ID, C>

Implementations§

Source§

impl<ID, C> GroupControlMessage<ID, C>
where ID: Copy,

Source

pub fn is_create(&self) -> bool

Return true if this is a create control message.

Source

pub fn group_id(&self) -> ID

Return the ID of the group this message should be applied to.

Trait Implementations§

Source§

impl<ID: Clone, C: Clone> Clone for GroupControlMessage<ID, C>

Source§

fn clone(&self) -> GroupControlMessage<ID, C>

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: Debug, C: Debug> Debug for GroupControlMessage<ID, C>

Source§

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

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

impl<'de, ID, C> Deserialize<'de> for GroupControlMessage<ID, C>
where ID: Deserialize<'de>, C: 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 Operation<char, u32, GroupControlMessage<char, ()>> for TestOperation

Source§

fn id(&self) -> u32

Id of this operation.
Source§

fn author(&self) -> char

ID of the author of this operation.
Source§

fn dependencies(&self) -> Vec<u32>

Auth dependencies.
Source§

fn payload(&self) -> GroupControlMessage<char, ()>

Payload of this operation.
Source§

impl Orderer<char, u32, GroupControlMessage<char, ()>> for TestOrderer

Source§

type State = ()

Source§

type Operation = TestOperation

Source§

type Error = Infallible

Source§

fn next_message( _y: Self::State, _payload: &GroupControlMessage<MemberId, Conditions>, ) -> Result<(Self::State, Self::Operation), Self::Error>

Create a next message with generic payload based on current local state, relevant meta-data is attached to the message.
Source§

fn queue( _y: Self::State, _message: &Self::Operation, ) -> Result<Self::State, Self::Error>

Queue up a new local or remote message.
Source§

fn next_ready_message( _y: Self::State, ) -> Result<(Self::State, Option<Self::Operation>), Self::Error>

Retrieve the next ready message.
Source§

impl Orderer<char, u32, GroupControlMessage<char, ()>> for TestOrderer

Source§

fn next_message( y: Self::State, control_message: &GroupControlMessage<MemberId, Conditions>, ) -> Result<(Self::State, Self::Operation), Self::Error>

Construct the next operation which should include meta-data required for establishing order between different operations.

In this implementation causal order is established between operations using a graph structure. Every operation contains a pointer to both the previous operations in a single auth group graph, and also the tips of any sub-group graphs.

Source§

type State = TestOrdererState

Source§

type Error = OrdererError

Source§

type Operation = TestOperation

Source§

fn queue( y: Self::State, message: &Self::Operation, ) -> Result<Self::State, Self::Error>

Queue up a new local or remote message.
Source§

fn next_ready_message( y: Self::State, ) -> Result<(Self::State, Option<Self::Operation>), Self::Error>

Retrieve the next ready message.
Source§

impl<ID: PartialEq, C: PartialEq> PartialEq for GroupControlMessage<ID, C>

Source§

fn eq(&self, other: &GroupControlMessage<ID, C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<ID, C> Serialize for GroupControlMessage<ID, C>
where ID: Serialize, C: Serialize,

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
Source§

impl<ID: Eq, C: Eq> Eq for GroupControlMessage<ID, C>

Source§

impl<ID, C> StructuralPartialEq for GroupControlMessage<ID, C>

Auto Trait Implementations§

§

impl<ID, C> Freeze for GroupControlMessage<ID, C>
where ID: Freeze, C: Freeze,

§

impl<ID, C> RefUnwindSafe for GroupControlMessage<ID, C>

§

impl<ID, C> Send for GroupControlMessage<ID, C>
where ID: Send, C: Send,

§

impl<ID, C> Sync for GroupControlMessage<ID, C>
where ID: Sync, C: Sync,

§

impl<ID, C> Unpin for GroupControlMessage<ID, C>
where ID: Unpin, C: Unpin,

§

impl<ID, C> UnwindSafe for GroupControlMessage<ID, C>
where 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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>,