Skip to main content

BandwidthTicketProvider

Trait BandwidthTicketProvider 

Source
pub trait BandwidthTicketProvider: Send + Sync {
    // Required methods
    fn get_ecash_ticket<'life0, 'async_trait>(
        &'life0 self,
        ticket_type: TicketType,
        gateway_id: PublicKey,
        tickets_to_spend: u32,
    ) -> Pin<Box<dyn Future<Output = Result<PreparedCredential, BandwidthControllerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_upgrade_mode_token<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, BandwidthControllerError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn close<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn get_ecash_ticket<'life0, 'async_trait>( &'life0 self, ticket_type: TicketType, gateway_id: PublicKey, tickets_to_spend: u32, ) -> Pin<Box<dyn Future<Output = Result<PreparedCredential, BandwidthControllerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_upgrade_mode_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, BandwidthControllerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: BandwidthTicketProvider + ?Sized + Send> BandwidthTicketProvider for Box<T>

Source§

fn get_ecash_ticket<'life0, 'async_trait>( &'life0 self, ticket_type: TicketType, gateway_id: PublicKey, tickets_to_spend: u32, ) -> Pin<Box<dyn Future<Output = Result<PreparedCredential, BandwidthControllerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_upgrade_mode_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<String>, BandwidthControllerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

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

Implementors§