Skip to main content

ActionGroup

Struct ActionGroup 

Source
pub struct ActionGroup<A> {
    pub actions: Vec<A>,
}
Expand description

Several actions of one resource, applied in order as one change.

Replay is exact: members apply inside one transaction, and the ids a member mints from its ActionCx are seeded by the group and the member’s position, so every replica mints the same ones. A member that refuses refuses the whole group, and nothing is applied. Its payload is the list of its members; tilo_actions::group_form writes what they share once when it is encoded and restores it when it is read, on the encoded payload, so a group adds no serde code of its own per action type.

Fields§

§actions: Vec<A>

Trait Implementations§

Source§

impl<A> Action for ActionGroup<A>

Source§

fn risk(&self) -> RiskLevel

A group is as consequential as its most consequential member: one deletion in a gesture makes the gesture ask for confirmation.

Source§

fn describe(&self, doc: &Doc) -> Option<Described>

A gesture records each of its members, and the item they share.

Source§

fn made(&self, doc: &Doc) -> Option<ActionItem>

The first item a member made, which the members’ descriptions read before they applied could not name.

Source§

fn change_kind(&self) -> ChangeKind

A gesture is someone’s step when any member is: one content change makes it content. Otherwise it is external when any member is, and housekeeping when every member is.

Source§

fn incoming_message(&self) -> bool

A gesture that records a received message among others still records one.

Source§

fn irreversible(&self) -> bool

Undo cannot take a gesture back when it cannot take back a member.

Source§

fn apply(&self, doc: &mut Doc) -> Result<(), ActionError>

Apply this action’s mutation to doc. See the trait contract. Read more
Source§

fn locus(&self) -> ExecutionLocus

Where this action prefers to run. Defaults to ExecutionLocus::ClientLocal.
Source§

fn inverse_before(&self, doc: &AutoCommit) -> Option<Self>
where Self: Sized,

The document action that undoes this one when apply records an outside consequence in the document (an outbox entry, a filesystem op queue). Computed against the document before this action runs, so a delete can still read the row it removes. Read more
Source§

fn inverse_encoded(&self, doc: &AutoCommit) -> Option<EncodedAction>

inverse_before as an encoded action, so the API can undo through apply after the concrete type has been erased. Read more
Source§

fn action_kind(&self) -> ActionKind

What kind of action this value is: whether it only changes the document or also reaches outside it. Must be a pure function of self. An action that records an outside consequence in the document (an outbox entry) is Outside; the default is Undoable.
Source§

fn readers(&self) -> Option<Vec<MemberId>>

The members who alone read what this value changes, when what it changes says who reads it (a direct conversation); None when every member who reads the record reads it. The executor marks its change with READERS_FACET. Must be a pure function of self.
Source§

fn compensates(&self) -> bool

Whether this value’s undo is its own code’s to compute (inverse_encoded may answer one): a device applying it from an app’s model module, which does not compute undo, writes no entry another device would check that undo against. Must be a pure function of self.
Source§

fn steps(&self, doc: &AutoCommit) -> Option<Vec<(Box<dyn Action>, Vec<u8>)>>

The actions this value is, one for each step it takes, when it stands for several: an undo of three steps is three undos of one, newest first. The executor applies each as an action of its own, so every change names the one step it moved, and a peer replays it as that one action. Each is its payload under this value’s type, with the action it decodes to. None for a value that is one step, as almost every value is. Read from doc before anything applies.
Source§

impl<A: Clone> Clone for ActionGroup<A>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<A: Debug> Debug for ActionGroup<A>

Source§

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

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

impl<'de, A> Deserialize<'de> for ActionGroup<A>
where A: 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<A: PartialEq> PartialEq for ActionGroup<A>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<A> Serialize for ActionGroup<A>
where A: 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<A: PartialEq> StructuralPartialEq for ActionGroup<A>

Auto Trait Implementations§

§

impl<A> Forget for ActionGroup<A>

§

impl<A> Freeze for ActionGroup<A>
where Vec<A>: Freeze,

§

impl<A> Move for ActionGroup<A>

§

impl<A> RefUnwindSafe for ActionGroup<A>
where Vec<A>: RefUnwindSafe,

§

impl<A> Send for ActionGroup<A>
where Vec<A>: Send,

§

impl<A> Sync for ActionGroup<A>
where Vec<A>: Sync,

§

impl<A> Unpin for ActionGroup<A>
where Vec<A>: Unpin,

§

impl<A> UnsafeUnpin for ActionGroup<A>
where Vec<A>: UnsafeUnpin,

§

impl<A> UnwindSafe for ActionGroup<A>
where Vec<A>: 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more