pub enum Credential {
Anonymous,
Basic {
username: String,
password: String,
},
Bearer(String),
IdentityToken(String),
}Expand description
A credential for authenticating to a container registry.
Variants§
Anonymous
Anonymous access (no authentication).
Basic
Basic authentication with username and password.
Bearer(String)
Bearer token authentication.
IdentityToken(String)
Identity token (used by some credential helpers).
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self
pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Self
Creates a basic auth credential.
Sourcepub fn identity_token(token: impl Into<String>) -> Self
pub fn identity_token(token: impl Into<String>) -> Self
Creates an identity token credential.
Sourcepub fn is_anonymous(&self) -> bool
pub fn is_anonymous(&self) -> bool
Returns true if this is anonymous (no auth).
Returns the HTTP Authorization header value for this credential.
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Credential
impl Debug for Credential
Source§impl Default for Credential
impl Default for Credential
Source§fn default() -> Credential
fn default() -> Credential
Returns the “default value” for a type. Read more
Source§impl PartialEq for Credential
impl PartialEq for Credential
impl Eq for Credential
impl StructuralPartialEq for Credential
Auto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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