Trait single_use_seals::SealProtocolAsync
source · pub trait SealProtocolAsync<Seal>{
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§
sourcetype Witness: Sync + Send
type Witness: Sync + Send
Associated type for the witness produced by the single-use-seal close procedure
sourcetype PublicationId: Sync
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
Required Methods§
sourcefn 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,
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§
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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,
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.