Struct ActionEnvelope
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 participant that authored this action, when named — a person, an
agent, or another session reached through crate::door.
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§
§impl ActionEnvelope
impl ActionEnvelope
pub 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): the large parts of an action
over the history budget, which the committing device keeps in its
content store so receivers can resolve them to replay. Empty for an
action recorded whole.
§Errors
A payload that is not JSON.
pub fn base_change_hashes(&self) -> Vec<ChangeHash>
pub fn base_change_hashes(&self) -> Vec<ChangeHash>
The base heads as Automerge ChangeHashes.
Trait Implementations§
§impl Clone for ActionEnvelope
impl Clone for ActionEnvelope
§fn clone(&self) -> ActionEnvelope
fn clone(&self) -> ActionEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ActionEnvelope
impl Debug for ActionEnvelope
§impl<'de> Deserialize<'de> for ActionEnvelope
impl<'de> Deserialize<'de> for ActionEnvelope
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for ActionEnvelope
impl PartialEq for ActionEnvelope
§impl Serialize for ActionEnvelope
impl Serialize for ActionEnvelope
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for ActionEnvelope
impl StructuralPartialEq for ActionEnvelope
Auto Trait Implementations§
impl Freeze 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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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