pub enum PimdirAction {
Add {
link_id: Option<ReplicaLinkId>,
flags: ReplicaFlags,
object: Option<ReplicaHash>,
meta: Option<ReplicaMeta>,
handle: Option<ReplicaHandle>,
},
SetFlags {
seq: i64,
flags: ReplicaFlags,
},
Remove {
seq: i64,
},
Move {
seq: i64,
to: ReplicaCollectionId,
},
Copy {
seq: i64,
to: ReplicaCollectionId,
},
Update {
seq: i64,
object: ReplicaHash,
meta: Option<ReplicaMeta>,
},
Unknown {
kind: String,
payload: String,
object_hash: Option<ReplicaHash>,
},
}Expand description
A queued mutation request (spec §15.3): what a producer appends to the
queue table and the owner applies to the store.
The kinds mirror io-replica’s mutation vocabulary on purpose: the
queue is the cross-process projection of the engine’s mutate verb.
Existing items are addressed by their public seq (spec §9.1), the
identifier a reading client already holds, which the owner resolves
back to the internal link id.
Variants§
Add
Create an item in the collection, staged as a local creation for
the sync layer to push. A duplicate live link_id parks the
action, the item already existing.
Fields
link_id: Option<ReplicaLinkId>The item’s cross-source link id; None derives it from object.
flags: ReplicaFlagsThe initial flag set.
object: Option<ReplicaHash>The body’s content hash, matching the row’s object_hash; the
producer wrote the blob durably before enqueueing.
meta: Option<ReplicaMeta>The item’s summary (spec Annex A), or None when not
projected.
handle: Option<ReplicaHandle>The provisional handle the create is staged under; None lets
the owner derive one.
SetFlags
Replace the item’s flag set: absolute, never a delta, so reapplication is idempotent.
Remove
Remove the item from the collection; already-absent is success, not an error.
Move
Refile the item into another collection: a target create plus a source removal.
Copy
Copy the item into another collection: a move without the removal.
Update
Repoint a mutable-content item’s body (a contact or event edit).
Fields
object: ReplicaHashThe new body’s content hash; the producer wrote the blob durably before enqueueing.
meta: Option<ReplicaMeta>The refreshed summary, or None to keep the cached one.
Unknown
An action this crate defines no semantics for: an owner-defined intent, a mail submission, carried by the same queue as the store mutations above.
The store cannot apply it, so its drain skips the row rather than
parking it: the action is not unappliable, only unappliable here.
An owner that recognises the kind performs it out of band and
acknowledges it with drop_action. Only a malformed payload
parks.
Fields
payload: StringThe raw versioned JSON payload, verbatim: only its owner knows the shape, so nothing here re-encodes it.
object_hash: Option<ReplicaHash>The body hash the payload’s object field names, by the same
convention as the known kinds, so an intent carrying a body
pins it against garbage collection like any other.
Implementations§
Source§impl PimdirAction
impl PimdirAction
Sourcepub fn object_hash(&self) -> Option<&ReplicaHash>
pub fn object_hash(&self) -> Option<&ReplicaHash>
The body hash the payload references, if any: the value the
enqueue carries in queue.object_hash so the pending body is
pinned against garbage collection (spec §15.1).
Trait Implementations§
Source§impl Clone for PimdirAction
impl Clone for PimdirAction
Source§fn clone(&self) -> PimdirAction
fn clone(&self) -> PimdirAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more