pub struct CopilotState;Expand description
Per-worker Copilot state. Copilot’s token is long-lived with no refresh, so there is no in-memory token cache or refresh backoff to keep.
Implementations§
Source§impl CopilotState
impl CopilotState
Sourcepub fn resolve(&mut self, client: &Client) -> QuotaOutcome<CopilotQuotaSnapshot>
pub fn resolve(&mut self, client: &Client) -> QuotaOutcome<CopilotQuotaSnapshot>
One worker tick: read the token, call the usage API.
Trait Implementations§
Source§impl Default for CopilotState
impl Default for CopilotState
Source§fn default() -> CopilotState
fn default() -> CopilotState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CopilotState
impl RefUnwindSafe for CopilotState
impl Send for CopilotState
impl Sync for CopilotState
impl Unpin for CopilotState
impl UnsafeUnpin for CopilotState
impl UnwindSafe for CopilotState
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