pub trait SealProtocolAsync<Seal>
where Seal: Sync + Send, Self: Send + Sync,
{ type Witness: Sync + Send; type Message; type PublicationId: Sync; type Error: Error; // Required method fn get_seal_status_async<'life0, 'life1, 'async_trait>( &'life0 self, seal: &'life1 Seal ) -> Pin<Box<dyn Future<Output = Result<SealStatus, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn publish_witness_async<'life0, 'life1, 'async_trait>( &'life0 mut self, _witness: &'life1 Self::Witness ) -> Pin<Box<dyn Future<Output = Result<Self::PublicationId, SealMediumError<Self::Error>>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_witness_publication_id_async<'life0, 'life1, 'async_trait>( &'life0 self, _witness: &'life1 Self::Witness ) -> Pin<Box<dyn Future<Output = Result<Option<Self::PublicationId>, SealMediumError<Self::Error>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn validate_publication_id_async<'life0, 'life1, 'async_trait>( &'life0 self, _publication_id: &'life1 Self::PublicationId ) -> Pin<Box<dyn Future<Output = Result<bool, SealMediumError<Self::Error>>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } }
Expand description

Asynchronous version of the SealProtocol trait.

Required Associated Types§

source

type Witness: Sync + Send

Associated type for the witness produced by the single-use-seal close procedure

source

type Message

Message type that is supported by the current single-use-seal

source

type PublicationId: Sync

Publication id that may be used for referencing publication of witness data in the medium. By default set (), so SealProtocolAsync may not implement publication id and related functions

source

type Error: Error

Error type that contains reasons of medium access failure

Required Methods§

source

fn get_seal_status_async<'life0, 'life1, 'async_trait>( &'life0 self, seal: &'life1 Seal ) -> Pin<Box<dyn Future<Output = Result<SealStatus, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks the status for a given seal in proof-of-publication medium

Provided Methods§

source

fn publish_witness_async<'life0, 'life1, 'async_trait>( &'life0 mut self, _witness: &'life1 Self::Witness ) -> Pin<Box<dyn Future<Output = Result<Self::PublicationId, SealMediumError<Self::Error>>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Publishes witness data to the medium. Function has default implementation doing nothing and returning SealMediumError::PublicationNotSupported error.

source

fn get_witness_publication_id_async<'life0, 'life1, 'async_trait>( &'life0 self, _witness: &'life1 Self::Witness ) -> Pin<Box<dyn Future<Output = Result<Option<Self::PublicationId>, SealMediumError<Self::Error>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns Self::PublicationId for a given witness, if any; the id is returned as an option. Function has default implementation doing nothing and just returning SealMediumError::PublicationNotSupported error.

source

fn validate_publication_id_async<'life0, 'life1, 'async_trait>( &'life0 self, _publication_id: &'life1 Self::PublicationId ) -> Pin<Box<dyn Future<Output = Result<bool, SealMediumError<Self::Error>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validates whether a given publication id is present in the medium. Function has default implementation doing nothing and returning SealMediumError::PublicationNotSupported error.

Implementors§