pub struct ProviderBalanceSnapshot {Show 28 fields
pub provider_id: String,
pub station_name: Option<String>,
pub upstream_index: Option<usize>,
pub source: String,
pub fetched_at_ms: u64,
pub stale_after_ms: Option<u64>,
pub stale: bool,
pub status: BalanceSnapshotStatus,
pub exhausted: Option<bool>,
pub exhaustion_affects_routing: bool,
pub plan_name: Option<String>,
pub total_balance_usd: Option<String>,
pub subscription_balance_usd: Option<String>,
pub paygo_balance_usd: Option<String>,
pub monthly_budget_usd: Option<String>,
pub monthly_spent_usd: Option<String>,
pub quota_period: Option<String>,
pub quota_remaining_usd: Option<String>,
pub quota_limit_usd: Option<String>,
pub quota_used_usd: Option<String>,
pub unlimited_quota: Option<bool>,
pub total_used_usd: Option<String>,
pub today_used_usd: Option<String>,
pub total_requests: Option<u64>,
pub today_requests: Option<u64>,
pub total_tokens: Option<u64>,
pub today_tokens: Option<u64>,
pub error: Option<String>,
}Fields§
§provider_id: String§station_name: Option<String>§upstream_index: Option<usize>§source: String§fetched_at_ms: u64§stale_after_ms: Option<u64>§stale: bool§status: BalanceSnapshotStatus§exhausted: Option<bool>§exhaustion_affects_routing: bool§plan_name: Option<String>§total_balance_usd: Option<String>§subscription_balance_usd: Option<String>§paygo_balance_usd: Option<String>§monthly_budget_usd: Option<String>§monthly_spent_usd: Option<String>§quota_period: Option<String>§quota_remaining_usd: Option<String>§quota_limit_usd: Option<String>§quota_used_usd: Option<String>§unlimited_quota: Option<bool>§total_used_usd: Option<String>§today_used_usd: Option<String>§total_requests: Option<u64>§today_requests: Option<u64>§total_tokens: Option<u64>§today_tokens: Option<u64>§error: Option<String>Implementations§
Source§impl ProviderBalanceSnapshot
impl ProviderBalanceSnapshot
pub fn new( provider_id: impl Into<String>, station_name: impl Into<String>, upstream_index: usize, source: impl Into<String>, fetched_at_ms: u64, stale_after_ms: Option<u64>, ) -> Self
pub fn with_error(self, error: impl Into<String>) -> Self
pub fn refresh_status(&mut self, now_ms: u64)
pub fn stale_at(&self, now_ms: u64) -> bool
pub fn status_at(&self, now_ms: u64) -> BalanceSnapshotStatus
pub fn routing_exhausted(&self) -> bool
pub fn routing_ignored_exhaustion(&self) -> bool
pub fn amount_summary(&self) -> String
Trait Implementations§
Source§impl Clone for ProviderBalanceSnapshot
impl Clone for ProviderBalanceSnapshot
Source§fn clone(&self) -> ProviderBalanceSnapshot
fn clone(&self) -> ProviderBalanceSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderBalanceSnapshot
impl Debug for ProviderBalanceSnapshot
Source§impl Default for ProviderBalanceSnapshot
impl Default for ProviderBalanceSnapshot
Source§impl<'de> Deserialize<'de> for ProviderBalanceSnapshot
impl<'de> Deserialize<'de> for ProviderBalanceSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProviderBalanceSnapshot
impl PartialEq for ProviderBalanceSnapshot
Source§fn eq(&self, other: &ProviderBalanceSnapshot) -> bool
fn eq(&self, other: &ProviderBalanceSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProviderBalanceSnapshot
impl Serialize for ProviderBalanceSnapshot
impl Eq for ProviderBalanceSnapshot
impl StructuralPartialEq for ProviderBalanceSnapshot
Auto Trait Implementations§
impl Freeze for ProviderBalanceSnapshot
impl RefUnwindSafe for ProviderBalanceSnapshot
impl Send for ProviderBalanceSnapshot
impl Sync for ProviderBalanceSnapshot
impl Unpin for ProviderBalanceSnapshot
impl UnsafeUnpin for ProviderBalanceSnapshot
impl UnwindSafe for ProviderBalanceSnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.