pub struct AgentUsage { /* private fields */ }Expand description
One cache/lock per provider merges concurrent windows and manual refreshes. Nothing is persisted or placed in the portable backup.
Implementations§
Source§impl AgentUsage
impl AgentUsage
Sourcepub async fn consume_reset(
&self,
idempotency_key: String,
credit_id: Option<String>,
proxy: Option<String>,
) -> Result<ResetResult, UsageStatus>
pub async fn consume_reset( &self, idempotency_key: String, credit_id: Option<String>, proxy: Option<String>, ) -> Result<ResetResult, UsageStatus>
Serialize redemption with Codex queries and replace the cached quota immediately.
pub async fn query( &self, refresh: bool, proxy: Option<String>, ) -> Vec<ProviderUsage>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AgentUsage
impl !RefUnwindSafe for AgentUsage
impl !UnwindSafe for AgentUsage
impl Forget for AgentUsage
impl Move for AgentUsage
impl Send for AgentUsage
impl Sync for AgentUsage
impl Unpin for AgentUsage
impl UnsafeUnpin for AgentUsagewhere
PhantomData<Mutex<Waitlist>>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
PhantomData<*const Waiter>: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<UsageWindow>: UnsafeUnpin,
PhantomData<ResetCredit>: UnsafeUnpin,
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.