pub struct PerAuthorityTokens { /* private fields */ }Expand description
A token per authority, replaceable at runtime — the shape a
CrossRegistryResolver walk across
several registries needs. Cheap to clone (an Arc handle); a clone
shares the table, so a background task can refresh tokens with
Self::set while readers use them.
Implementations§
Source§impl PerAuthorityTokens
impl PerAuthorityTokens
Sourcepub fn with(self, authority: impl Into<String>, token: BearerToken) -> Self
pub fn with(self, authority: impl Into<String>, token: BearerToken) -> Self
Present token to authority, replacing any previous token.
Sourcepub fn set(&self, authority: impl Into<String>, token: BearerToken)
pub fn set(&self, authority: impl Into<String>, token: BearerToken)
Present token to authority, replacing any previous token.
Trait Implementations§
Source§impl AuthProvider for PerAuthorityTokens
impl AuthProvider for PerAuthorityTokens
Source§fn bearer_token<'a>(&'a self, authority: &'a str) -> AuthFuture<'a>
fn bearer_token<'a>(&'a self, authority: &'a str) -> AuthFuture<'a>
The token to present to
authority (host, plus port when
non-default — the same value as
RegistryClient::authority).Source§fn token_rejected(&self, authority: &str)
fn token_rejected(&self, authority: &str)
Called when
authority answered a read that carried this
provider’s token with HTTP 401 or 403 — the token may have expired
or been revoked. Drop any cached token for authority here so the
next read fetches a fresh one. The rejected read itself is not
retried. Default: no-op.Source§impl Clone for PerAuthorityTokens
impl Clone for PerAuthorityTokens
Source§impl Debug for PerAuthorityTokens
impl Debug for PerAuthorityTokens
Auto Trait Implementations§
impl Freeze for PerAuthorityTokens
impl RefUnwindSafe for PerAuthorityTokens
impl Send for PerAuthorityTokens
impl Sync for PerAuthorityTokens
impl Unpin for PerAuthorityTokens
impl UnsafeUnpin for PerAuthorityTokens
impl UnwindSafe for PerAuthorityTokens
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