pub struct Refresher { /* private fields */ }Expand description
The refresh grants of one credential on the client its proxy selects. It owns everything it needs, so a refresh can outlive the request that started it.
Implementations§
Source§impl Refresher
impl Refresher
Sourcepub async fn prepare(
&self,
credential: &Credential,
) -> Result<MetadataPatch, ExecError>
pub async fn prepare( &self, credential: &Credential, ) -> Result<MetadataPatch, ExecError>
Refreshes the due partitions. Go refreshes Codex only in the background and never blocks a request on it, so a failed refresh while the token requests use is still valid keeps the credential usable; the failure is cached for five minutes by the OAuth service.
Sourcepub async fn refresh_now(
&self,
credential: &Credential,
) -> Result<MetadataPatch, ExecError>
pub async fn refresh_now( &self, credential: &Credential, ) -> Result<MetadataPatch, ExecError>
Refreshes after an upstream rejected the token requests use (Go marks it
RejectedAccessToken): that partition (the Sign in with ChatGPT one when
use_siwc is on) and any due one. With neither able to refresh, every partition
that can (Go’s explicit unscheduled refresh). Nothing without a refresh token.
Sourcepub async fn refresh_all(
&self,
credential: &Credential,
) -> Result<MetadataPatch, ExecError>
pub async fn refresh_all( &self, credential: &Credential, ) -> Result<MetadataPatch, ExecError>
A management refresh (Go IsForceRefreshContext): every partition that can refresh.
Sourcepub async fn refresh_locked(
&self,
memory: &Credential,
disk: &Map<String, Value>,
mode: RefreshMode,
) -> Result<RefreshPatch, ExecError>
pub async fn refresh_locked( &self, memory: &Credential, disk: &Map<String, Value>, mode: RefreshMode, ) -> Result<RefreshPatch, ExecError>
Go refreshLocked with the credential file (disk) read under its lock: a token
partition another process rotated there replaces the memory snapshot’s before
anything refreshes, so its refresh token is not spent twice, and the refresh
mode asks for then runs on the result. The answer names each partition adopted
or refreshed with its baselines, for RefreshPatch::apply, and whether a grant
was attempted; with one adopted, a failed refresh still answers with it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Refresher
impl !UnwindSafe for Refresher
impl Forget for Refresher
impl Freeze for Refresher
impl Move for Refresher
impl Send for Refresher
impl Sync for Refresher
impl Unpin for Refresher
impl UnsafeUnpin for Refresher
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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