pub struct ActionEnvelope {
pub id: ActionId,
pub action: EncodedAction,
pub base_heads: Vec<[u8; 32]>,
pub timestamp: i64,
pub locus: ExecutionLocus,
pub actor: Option<Vec<u8>>,
pub context: Option<ActionContext>,
}Expand description
One replayable action, ready to cross a boundary.
Fields§
§id: ActionIdUnique id; its bytes are also the Automerge actor used to commit the action’s change, so replay reproduces the exact same change hash.
action: EncodedActionThe serialized action.
base_heads: Vec<[u8; 32]>Document heads the action was authored against — a replica at exactly these heads replays to the identical document.
timestamp: i64Commit timestamp (unix seconds), pinned so the change is byte-identical on origin and every replaying replica.
locus: ExecutionLocusThe action’s declared execution locus, carried so the transport can honor it.
actor: Option<Vec<u8>>The member that authored this action, when named — a person, an
agent, or another session reached through crate::api.
These bytes become the Automerge actor the change commits under, so
an edit from outside attributes in history exactly like a typed one.
None is the app’s own dispatch (the ActionId-derived actor).
Replay stays byte-identical either way, since the actor rides on the
envelope rather than the applying replica. Optional on the wire so an
envelope written before attribution existed still deserializes.
context: Option<ActionContext>Human provenance used by history, search, and passive activity UI. It does not affect what the action is allowed to mutate; it is carried into the Automerge change message so it survives the transport log.
Implementations§
Source§impl ActionEnvelope
impl ActionEnvelope
Sourcepub fn recorded_content(&self) -> Result<ContentParts, ActionError>
pub fn recorded_content(&self) -> Result<ContentParts, ActionError>
The content the change’s recorded action names
(crate::executor::recorded_form), by reference: the large parts
of an action larger than a change documents whole, read from the
action as it ran. A device that applies the action keeps them in its content
store, sealed as their writer sealed them, so receivers can resolve
them to replay. Empty for an action recorded whole.
§Errors
[ActionError::Refused] when the recorded action is not this one.
Sourcepub fn base_change_hashes(&self) -> Vec<ChangeHash>
pub fn base_change_hashes(&self) -> Vec<ChangeHash>
The base heads as Automerge ChangeHashes.
Trait Implementations§
Source§impl Clone for ActionEnvelope
impl Clone for ActionEnvelope
Source§impl Debug for ActionEnvelope
impl Debug for ActionEnvelope
Source§impl<'de> Deserialize<'de> for ActionEnvelope
impl<'de> Deserialize<'de> for ActionEnvelope
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>,
impl Eq for ActionEnvelope
Source§impl PartialEq for ActionEnvelope
impl PartialEq for ActionEnvelope
Source§impl Serialize for ActionEnvelope
impl Serialize for ActionEnvelope
impl StructuralPartialEq for ActionEnvelope
Auto Trait Implementations§
impl Forget for ActionEnvelope
impl Freeze for ActionEnvelope
impl Move for ActionEnvelope
impl RefUnwindSafe for ActionEnvelope
impl Send for ActionEnvelope
impl Sync for ActionEnvelope
impl Unpin for ActionEnvelope
impl UnsafeUnpin for ActionEnvelope
impl UnwindSafe for ActionEnvelope
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