Skip to main content

CredentialFetcher

Trait CredentialFetcher 

Source
pub trait CredentialFetcher:
    CredentialPublicDataFetcher
    + Send
    + Sync {
    // Required methods
    fn fetch_ticketbooks<'life0, 'async_trait>(
        &'life0 self,
        ticketbook_type: TicketType,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<NymCredential>, CredentialFetcherError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reset<'async_trait>(
        self,
    ) -> Pin<Box<dyn Future<Output = Result<(), CredentialFetcherError>> + Send + 'async_trait>>
       where Self: 'async_trait;
}

Required Methods§

Source

fn fetch_ticketbooks<'life0, 'async_trait>( &'life0 self, ticketbook_type: TicketType, ) -> Pin<Box<dyn Future<Output = Result<Vec<NymCredential>, CredentialFetcherError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetches (or recovers) ticketbooks of the given type. The controller does not retry on failure - retrying transient errors is the fetcher’s responsibility. Recovery can yield several ticketbooks of the same type, hence the Vec.

Source

fn cleanup<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Persists any in-progress state (e.g. closing storage) before the fetcher is dropped, such that it can be resumed later.

Source

fn reset<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = Result<(), CredentialFetcherError>> + Send + 'async_trait>>
where Self: 'async_trait,

Wipes the fetcher’s long-term data (e.g. removes its storage).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§