pub enum Credential {
Unauthenticated,
Pat(String),
TokenCredential(Arc<dyn TokenCredential>),
}Expand description
A credential for authenticating with Azure DevOps.
Supports:
- Azure DevOps Personal Access Token (PAT).
- OAuth token credential obtained via the
azure_identitycrate.
Variants§
Implementations§
Source§impl Credential
impl Credential
Sourcepub fn unauthenticated() -> Self
pub fn unauthenticated() -> Self
Creates a new Credential for unauthenticated operations.
Sourcepub fn from_pat(pat: impl Into<String>) -> Self
pub fn from_pat(pat: impl Into<String>) -> Self
Creates a new Credential using the supplied PAT token.
Sourcepub fn from_token_credential<T>(token_credential: Arc<T>) -> Selfwhere
T: TokenCredential + 'static,
pub fn from_token_credential<T>(token_credential: Arc<T>) -> Selfwhere
T: TokenCredential + 'static,
Creates a new Credential using the supplied object that implements TokenCredential.
Note that the supplied object must be wrapped in an Arc<...>.
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 moreAuto Trait Implementations§
impl Freeze for Credential
impl !RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin 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