pub struct StaticBearerToken { /* private fields */ }Expand description
One token for exactly one authority. Use on a RegistryClient that
talks to a single registry.
Implementations§
Source§impl StaticBearerToken
impl StaticBearerToken
Sourcepub fn new(authority: impl Into<String>, token: BearerToken) -> Self
pub fn new(authority: impl Into<String>, token: BearerToken) -> Self
Present token to authority and to no other.
Trait Implementations§
Source§impl AuthProvider for StaticBearerToken
impl AuthProvider for StaticBearerToken
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 StaticBearerToken
impl Clone for StaticBearerToken
Auto Trait Implementations§
impl Freeze for StaticBearerToken
impl RefUnwindSafe for StaticBearerToken
impl Send for StaticBearerToken
impl Sync for StaticBearerToken
impl Unpin for StaticBearerToken
impl UnsafeUnpin for StaticBearerToken
impl UnwindSafe for StaticBearerToken
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