Skip to main content

ResourceRegistrar

Trait ResourceRegistrar 

Source
pub trait ResourceRegistrar {
    type Error;

    // Required methods
    fn begin(
        &self,
        intent: CanonicalResourceIntent,
    ) -> Result<RegistrationSnapshot, Self::Error>;
    fn get(
        &self,
        operation_id: OperationId,
    ) -> Result<RegistrationSnapshot, Self::Error>;
    fn finalize(
        &self,
        operation_id: OperationId,
        fence: FencingToken,
        intent: &CanonicalResourceIntent,
        attestations: &DualAttestation,
        content_cid: Option<&Cid>,
    ) -> Result<FinalizedResource, Self::Error>;
    fn resolve(
        &self,
        operation_id: OperationId,
        fence: FencingToken,
        resolution: Resolution,
    ) -> Result<RegistrationSnapshot, Self::Error>;
}

Required Associated Types§

Required Methods§

Source

fn begin( &self, intent: CanonicalResourceIntent, ) -> Result<RegistrationSnapshot, Self::Error>

Source

fn get( &self, operation_id: OperationId, ) -> Result<RegistrationSnapshot, Self::Error>

Source

fn finalize( &self, operation_id: OperationId, fence: FencingToken, intent: &CanonicalResourceIntent, attestations: &DualAttestation, content_cid: Option<&Cid>, ) -> Result<FinalizedResource, Self::Error>

Implementations revalidate MAC immediately before their linearizable CAS, sign a finalization statement, verify it into FinalizedResource, and durably record the exact Resolution returned to identical retries.

Source

fn resolve( &self, operation_id: OperationId, fence: FencingToken, resolution: Resolution, ) -> Result<RegistrationSnapshot, Self::Error>

Commits the immutable terminal Resolution. When the resolution references an accounting effect (Voided, Compensated, or the losing side’s disposition in RejectedConflict), the implementation MUST durably confirm the referenced transfer with the economic authority before committing the resolution; until then the operation remains nonterminal.

Implementors§