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_identity
crate.
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 copy 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 !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