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,
spend_time: OffsetDateTime,
) -> Pin<Box<dyn Future<Output = Result<Option<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;
fn attempt_revert_spending<'life0, 'async_trait>(
&'life0 self,
metadata: PreparedCredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<bool, BandwidthControllerError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
fn get_ecash_ticket<'life0, 'async_trait>(
&'life0 self,
ticket_type: TicketType,
gateway_id: PublicKey,
tickets_to_spend: u32,
spend_time: OffsetDateTime,
) -> Pin<Box<dyn Future<Output = Result<Option<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,
fn attempt_revert_spending<'life0, 'async_trait>(
&'life0 self,
metadata: PreparedCredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<bool, BandwidthControllerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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".