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>
impl<A> Action for ActionGroup<A>
Source§fn risk(&self) -> RiskLevel
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>
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>
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
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
fn incoming_message(&self) -> bool
A gesture that records a received message among others still records one.
Source§fn irreversible(&self) -> bool
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>
fn apply(&self, doc: &mut Doc) -> Result<(), ActionError>
doc. See the trait contract. Read moreSource§fn locus(&self) -> ExecutionLocus
fn locus(&self) -> ExecutionLocus
ExecutionLocus::ClientLocal.Source§fn inverse_before(&self, doc: &AutoCommit) -> Option<Self>where
Self: Sized,
fn inverse_before(&self, doc: &AutoCommit) -> Option<Self>where
Self: Sized,
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 moreSource§fn inverse_encoded(&self, doc: &AutoCommit) -> Option<EncodedAction>
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 moreSource§fn action_kind(&self) -> ActionKind
fn action_kind(&self) -> ActionKind
Source§fn readers(&self) -> Option<Vec<MemberId>>
fn readers(&self) -> Option<Vec<MemberId>>
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
fn compensates(&self) -> bool
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>)>>
fn steps(&self, doc: &AutoCommit) -> Option<Vec<(Box<dyn Action>, Vec<u8>)>>
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>
impl<A: Clone> Clone for ActionGroup<A>
Source§impl<A: Debug> Debug for ActionGroup<A>
impl<A: Debug> Debug for ActionGroup<A>
Source§impl<'de, A> Deserialize<'de> for ActionGroup<A>where
A: Deserialize<'de>,
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>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<A: PartialEq> PartialEq for ActionGroup<A>
impl<A: PartialEq> PartialEq for ActionGroup<A>
Source§impl<A> Serialize for ActionGroup<A>where
A: Serialize,
impl<A> Serialize for ActionGroup<A>where
A: Serialize,
impl<A: PartialEq> StructuralPartialEq for ActionGroup<A>
Auto Trait Implementations§
impl<A> Forget for ActionGroup<A>
impl<A> Freeze for ActionGroup<A>
impl<A> Move for ActionGroup<A>
impl<A> RefUnwindSafe for ActionGroup<A>where
Vec<A>: RefUnwindSafe,
impl<A> Send for ActionGroup<A>
impl<A> Sync for ActionGroup<A>
impl<A> Unpin for ActionGroup<A>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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