pub struct CodexState { /* private fields */ }Expand description
Per-worker Codex state: an in-memory access token + refresh backoff.
Codex auth.json carries no explicit expiry, so refresh is reactive:
the stored (or in-memory) access token is used until a Codex quota endpoint
401s, then it is refreshed and the rejected request is retried once.
Implementations§
Source§impl CodexState
impl CodexState
Sourcepub fn resolve(&mut self, client: &Client) -> QuotaOutcome<CodexQuotaSnapshot>
pub fn resolve(&mut self, client: &Client) -> QuotaOutcome<CodexQuotaSnapshot>
One worker tick: wham API with reactive refresh, else session fallback.
Trait Implementations§
Source§impl Default for CodexState
impl Default for CodexState
Source§fn default() -> CodexState
fn default() -> CodexState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodexState
impl RefUnwindSafe for CodexState
impl Send for CodexState
impl Sync for CodexState
impl Unpin for CodexState
impl UnsafeUnpin for CodexState
impl UnwindSafe for CodexState
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more