pub trait UsageProvider: Send + Sync {
// Required methods
fn metadata(&self) -> &ProviderMetadata;
fn fetch_usage<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<UsageSnapshot, SpendPanelError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn detect_credentials(&self) -> bool { ... }
}Expand description
Trait every usage provider must implement.
Required Methods§
Sourcefn metadata(&self) -> &ProviderMetadata
fn metadata(&self) -> &ProviderMetadata
Returns the provider metadata.
Sourcefn fetch_usage<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<UsageSnapshot, SpendPanelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_usage<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<UsageSnapshot, SpendPanelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetches usage data.
Provided Methods§
Sourcefn detect_credentials(&self) -> bool
fn detect_credentials(&self) -> bool
Whether credentials for this provider are detectable on this machine (used to auto-enable providers without an explicit toggle).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".