Struct sage_mqtt::Authentication[][src]

pub struct Authentication {
    pub method: String,
    pub data: Vec<u8>,
}
Expand description

By default, Connect packets provide optional user_name and password fields which can be used to provide basic authentication. Enhanced authentication can be provided by using an Authentication structure which will initialize a challenge / response style authentication. Ii might imply the exchange of several Auth with reason code ContinueAuthentication until eventually one is send with either Success or any relevant error code and, in that case, close the connection. The authentication method which is used as an agreement on how authentication exchanges will perform. Authentication data can be sent at any moment according to this agreement. See the section 4.12 (Enhanced Authentication) of the MQTT 5 specifications for examples.

Fields

method: String

Specifies the authentication method, such as “SCRAM-SHA-1” or “GS2-KRB5”. The actual support for a given authentication method is up to the server. If the server does not support the requested method, it will respond with a Connack packet with reason code NotAuthorized or BadAuthenticationMethod and close the connection.

data: Vec<u8>

Authentication may contains data. The content depends on the authentication method.

Implementations

Write authentication data into writer, returning the written size in case of success.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.