Enum tiberius::AuthMethod

source ·
pub enum AuthMethod {
    SqlServer(SqlServerAuth),
    Windows(WindowsAuth),
    Integrated,
    AADToken(String),
    // some variants omitted
}
Expand description

Defines the method of authentication to the server.

Variants§

§

SqlServer(SqlServerAuth)

Authenticate directly with SQL Server.

§

Windows(WindowsAuth)

Available on Windows and crate feature winauth only.

Authenticate with Windows credentials.

§

Integrated

Available on Windows, or Unix and crate feature integrated-auth-gssapi only.

Authenticate as the currently logged in user. On Windows uses SSPI and Kerberos on Unix platforms.

§

AADToken(String)

Authenticate with an AAD token. The token should encode an AAD user/service principal which has access to SQL Server.

Implementations§

source§

impl AuthMethod

source

pub fn sql_server(user: impl ToString, password: impl ToString) -> Self

Construct a new SQL Server authentication configuration.

source

pub fn windows(user: impl AsRef<str>, password: impl ToString) -> Self

Available on Windows and crate feature winauth only.

Construct a new Windows authentication configuration.

source

pub fn aad_token(token: impl ToString) -> Self

Construct a new configuration with AAD auth token.

Trait Implementations§

source§

impl Clone for AuthMethod

source§

fn clone(&self) -> AuthMethod

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuthMethod

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<AuthMethod> for AuthMethod

source§

fn eq(&self, other: &AuthMethod) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for AuthMethod

source§

impl StructuralEq for AuthMethod

source§

impl StructuralPartialEq for AuthMethod

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more