[][src]Struct mongodb::options::Credential

pub struct Credential {
    pub username: Option<String>,
    pub source: Option<String>,
    pub password: Option<String>,
    pub mechanism: Option<AuthMechanism>,
    pub mechanism_properties: Option<Document>,
}

A struct containing authentication information.

Some fields (mechanism and source) may be omitted and will either be negotiated or assigned a default value, depending on the values of other fields in the credential.

Fields

username: Option<String>

The username to authenticate with. This applies to all mechanisms but may be omitted when authenticating via MONGODB-X509.

source: Option<String>

The database used to authenticate. This applies to all mechanisms and defaults to "admin" in SCRAM authentication mechanisms and "$external" for GSSAPI, MONGODB-X509 and PLAIN.

password: Option<String>

The password to authenticate with. This does not apply to all mechanisms.

mechanism: Option<AuthMechanism>

Which authentication mechanism to use. If not provided, one will be negotiated with the server.

mechanism_properties: Option<Document>

Additional properties for the given mechanism.

Implementations

impl Credential[src]

pub fn builder() -> TypedBuilder_BuilderFor_Credential<(), (), (), (), ()>[src]

Create a builder for building Credential. On the builder, call .username(...)(optional), .source(...)(optional), .password(...)(optional), .mechanism(...)(optional), .mechanism_properties(...)(optional) to set the values of the fields(they accept Into values). Finally, call .build() to create the instance of Credential.

Trait Implementations

impl Clone for Credential[src]

impl Debug for Credential[src]

impl Default for Credential[src]

impl PartialEq<Credential> for Credential[src]

impl StructuralPartialEq for Credential[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,