pub struct JournalEventIntent { /* private fields */ }Expand description
Stable idempotent request to append one semantic event.
Retrying the same EventId is successful only when every intent field and
its digest match the existing event. Reusing an ID with different content is
a conflict, never last-write-wins behavior.
Implementations§
Source§impl JournalEventIntent
impl JournalEventIntent
Sourcepub fn control_plane(
tenant_id: TenantId,
run_id: RunId,
event_id: EventId,
payload: JournalPayload,
) -> Result<Self, JournalIntentError>
pub fn control_plane( tenant_id: TenantId, run_id: RunId, event_id: EventId, payload: JournalPayload, ) -> Result<Self, JournalIntentError>
Constructs a control-plane event intent.
§Errors
Returns JournalIntentError::Integrity if the small typed digest
preimage unexpectedly cannot be canonicalized.
Sourcepub fn worker(
tenant_id: TenantId,
run_id: RunId,
event_id: EventId,
fence: RunFence,
payload: JournalPayload,
) -> Result<Self, JournalIntentError>
pub fn worker( tenant_id: TenantId, run_id: RunId, event_id: EventId, fence: RunFence, payload: JournalPayload, ) -> Result<Self, JournalIntentError>
Constructs a worker event intent bound to its run-scoped fence.
§Errors
Returns JournalIntentError if the fence crosses the supplied tenant
or run, or the digest preimage cannot be canonicalized.
Sourcepub const fn source(&self) -> &JournalEventSource
pub const fn source(&self) -> &JournalEventSource
Returns the trusted source marker.
Sourcepub const fn payload(&self) -> &JournalPayload
pub const fn payload(&self) -> &JournalPayload
Returns the schema-bound payload.
Sourcepub const fn intent_digest(&self) -> Digest
pub const fn intent_digest(&self) -> Digest
Returns the domain-separated digest of the complete append intent.
Trait Implementations§
Source§impl Clone for JournalEventIntent
impl Clone for JournalEventIntent
Source§impl Debug for JournalEventIntent
impl Debug for JournalEventIntent
Source§impl<'de> Deserialize<'de> for JournalEventIntent
impl<'de> Deserialize<'de> for JournalEventIntent
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for JournalEventIntent
Source§impl JsonSchema for JournalEventIntent
impl JsonSchema for JournalEventIntent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for JournalEventIntent
impl PartialEq for JournalEventIntent
Source§impl Serialize for JournalEventIntent
impl Serialize for JournalEventIntent
impl StructuralPartialEq for JournalEventIntent
Auto Trait Implementations§
impl Forget for JournalEventIntent
impl Freeze for JournalEventIntent
impl Move for JournalEventIntent
impl RefUnwindSafe for JournalEventIntent
impl Send for JournalEventIntent
impl Sync for JournalEventIntent
impl Unpin for JournalEventIntent
impl UnsafeUnpin for JournalEventIntent
impl UnwindSafe for JournalEventIntent
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
Mutably borrows from an owned value. Read more