Skip to main content

PublishCommit

Struct PublishCommit 

Source
pub struct PublishCommit<'a> {
    pub req: &'a PublishRequest,
    pub authority: &'a str,
    pub idempotency: Option<PendingIdempotencyCommit<'a>>,
    pub tenant: Option<&'a str>,
    pub receipt_minter: Option<&'a (dyn Fn(&Body) -> Result<Value, AcdpError> + Send + Sync)>,
}
Expand description

Single-shot atomic publish input (FEAT-01).

Passed to RegistryStore::commit_publish so the predecessor lookup, supersession check, body insertion, predecessor supersession marking, and idempotency record are all done under one critical section. Eliminates TOCTOU races between two concurrent publishes that target the same supersedes ctx_id or share an idempotency_key.

Fields§

§req: &'a PublishRequest

The validated, signature-verified publish request.

§authority: &'a str

The hostname the registry serves — used to mint ctx_ids and stored verbatim into body.origin_registry (BUG-01).

§idempotency: Option<PendingIdempotencyCommit<'a>>

Idempotency wiring, present iff the registry advertises caps.supports_idempotency_key and the request carries an Idempotency-Key.

§tenant: Option<&'a str>

Tenant this publish is scoped to, if the registry is multi-tenant. None means untenanted (single-tenant / V0). A multi-tenant store MUST persist this atomically with the context row so the tenancy is never observable as the default bucket (and never stranded there on a crash between insert and a separate stamping UPDATE). Stores that do not implement tenancy ignore it.

§receipt_minter: Option<&'a (dyn Fn(&Body) -> Result<Value, AcdpError> + Send + Sync)>

Receipt minting hook (ACDP 0.2, RFC-ACDP-0010). When present, the store MUST invoke it with the fully assigned Body (ctx_id / lineage_id / created_at populated) inside the same critical section / transaction as the insert, persist the returned receipt with the context, and include it in the response. A context published under the acdp-registry-receipts profile must never exist without its receipt — a crash between insert and mint must not be observable. None for receipt-less (0.1.0-mode) registries.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PublishCommit<'a>

§

impl<'a> !UnwindSafe for PublishCommit<'a>

§

impl<'a> Freeze for PublishCommit<'a>

§

impl<'a> Send for PublishCommit<'a>

§

impl<'a> Sync for PublishCommit<'a>

§

impl<'a> Unpin for PublishCommit<'a>

§

impl<'a> UnsafeUnpin for PublishCommit<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.