pub enum Credentials {
SqlServer {
username: Cow<'static, str>,
password: Cow<'static, str>,
},
AzureAccessToken {
token: Cow<'static, str>,
},
}Expand description
Credentials for SQL Server authentication.
This enum represents the various authentication methods supported. Credentials are designed to minimize copying of sensitive data.
Variants§
SqlServer
SQL Server authentication with username and password.
AzureAccessToken
Azure Active Directory / Entra ID access token.
Implementations§
Source§impl Credentials
impl Credentials
Sourcepub fn sql_server(
username: impl Into<Cow<'static, str>>,
password: impl Into<Cow<'static, str>>,
) -> Credentials
pub fn sql_server( username: impl Into<Cow<'static, str>>, password: impl Into<Cow<'static, str>>, ) -> Credentials
Create SQL Server credentials.
Sourcepub fn azure_token(token: impl Into<Cow<'static, str>>) -> Credentials
pub fn azure_token(token: impl Into<Cow<'static, str>>) -> Credentials
Create Azure access token credentials.
Sourcepub fn is_sql_auth(&self) -> bool
pub fn is_sql_auth(&self) -> bool
Check if these credentials use SQL authentication.
Sourcepub fn is_azure_ad(&self) -> bool
pub fn is_azure_ad(&self) -> bool
Check if these credentials use Azure AD.
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Get the authentication method name.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
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 Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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