pub struct Stamped<O> {
pub operation: O,
pub now_ms: i64,
}Expand description
A record operation with the origin’s time attached: the replayable action
of a #[resource] record.
Fields§
§operation: O§now_ms: i64Implementations§
Trait Implementations§
Source§impl<O: Operation> Action for Stamped<O>
impl<O: Operation> Action for Stamped<O>
Source§fn apply(&self, doc: &mut Doc) -> Result<(), ActionError>
fn apply(&self, doc: &mut Doc) -> Result<(), ActionError>
Read the record, run the method, write back what changed
(apply_operation).
Source§fn change_kind(&self) -> ChangeKind
fn change_kind(&self) -> ChangeKind
An outbox settlement is content from outside and forgetting a settled entry is housekeeping: neither is anyone’s undo step, so an undo never sends a mail twice.
Source§fn inverse_encoded(&self, doc: &Doc) -> Option<EncodedAction>
fn inverse_encoded(&self, doc: &Doc) -> Option<EncodedAction>
A verb that declares its undo is undone by applying that verb, and a change of a record that queues by applying the edits that restore it: either queues the compensating outside consequence.
Source§fn describe(&self, doc: &Doc) -> Option<Described>
fn describe(&self, doc: &Doc) -> Option<Described>
A field edit with the value before and after, or a verb with its plain arguments, and the item either addressed.
Source§fn made(&self, doc: &Doc) -> Option<ActionItem>
fn made(&self, doc: &Doc) -> Option<ActionItem>
The item this verb made, read once it wrote: the record’s item it
added (a note, an issue, a message), or the item the app named as it
ran (a file a device will write). The document before the verb applied
held neither, so [Self::describe] could not name it.
Source§fn locus(&self) -> ExecutionLocus
fn locus(&self) -> ExecutionLocus
ExecutionLocus::ClientLocal.Source§fn risk(&self) -> RiskLevel
fn risk(&self) -> RiskLevel
Destructive,
trimming one is not), and the host asks for the same confirmation a
declared destructive action gets whenever
requires_confirmation
holds. Must be a pure function of self. Defaults to
Low.Source§fn action_kind(&self) -> ActionKind
fn action_kind(&self) -> ActionKind
Source§fn incoming_message(&self) -> bool
fn incoming_message(&self) -> bool
INCOMING_MESSAGE_FACET. Must be a
pure function of self.Source§fn irreversible(&self) -> bool
fn irreversible(&self) -> bool
IRREVERSIBLE_TAG. 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 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 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 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<'de, O: DeserializeOwned> Deserialize<'de> for Stamped<O>
impl<'de, O: DeserializeOwned> Deserialize<'de> for Stamped<O>
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Auto Trait Implementations§
impl<O> Forget for Stamped<O>
impl<O> Freeze for Stamped<O>where
O: Freeze,
impl<O> Move for Stamped<O>
impl<O> RefUnwindSafe for Stamped<O>where
O: RefUnwindSafe,
impl<O> Send for Stamped<O>where
O: Send,
impl<O> Sync for Stamped<O>where
O: Sync,
impl<O> Unpin for Stamped<O>where
O: Unpin,
impl<O> UnsafeUnpin for Stamped<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for Stamped<O>where
O: 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