pub struct ActionId(pub Uuid);Expand description
A globally-unique id minted per dispatched action. Its 16 bytes double as the deterministic Automerge actor id, making replay content-addressed identical across replicas.
Tuple Fields§
§0: UuidImplementations§
Source§impl ActionId
impl ActionId
Sourcepub fn new() -> ActionId
pub fn new() -> ActionId
Mint a fresh id, ordered after every id this device minted before it.
Its bytes are the actor of the action’s change, and a document keeps its actors sorted:
an actor that sorts before others renumbers the actor of every op the document holds.
A time-ordered id (UUIDv7: milliseconds, then random bits) sorts after the actors a
document already has, so taking an action’s change in costs what the change holds.
The time is tilo_clock’s, which is the reading this process was given: an app model
runs as a WebAssembly module with no clock of its own, and what it stamps an action’s
change with is the host’s time.
Sourcepub fn actor_bytes(&self) -> [u8; 16]
pub fn actor_bytes(&self) -> [u8; 16]
The 16 raw bytes, used verbatim as the Automerge actor id.
Trait Implementations§
impl Copy for ActionId
Source§impl<'de> Deserialize<'de> for ActionId
impl<'de> Deserialize<'de> for ActionId
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ActionId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ActionId
Source§impl Serialize for ActionId
impl Serialize for ActionId
Source§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 StructuralPartialEq for ActionId
Auto Trait Implementations§
impl Forget for ActionId
impl Freeze for ActionId
impl Move for ActionId
impl RefUnwindSafe for ActionId
impl Send for ActionId
impl Sync for ActionId
impl Unpin for ActionId
impl UnsafeUnpin for ActionId
impl UnwindSafe for ActionId
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