#[non_exhaustive]pub enum AuthFlavor<T>{
AuthNone(Option<T>),
AuthUnix(AuthUnixParams<T>),
AuthShort(T),
Unknown {
id: u32,
data: T,
},
}Expand description
A set of basic auth flavor types described in RFC 5531.
The deprecated AUTH_DH is not supported, nor is GSS.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AuthNone(Option<T>)
AUTH_NONE with the opaque data the spec allows to be included
(typically None).
The provided opaque auth payload must not exceed 200 bytes in length.
AuthUnix(AuthUnixParams<T>)
AUTH_UNIX and the fields it contains.
AuthShort(T)
AUTH_SHORT and its opaque identifier
The provided opaque auth payload must not exceed 200 bytes in length.
Unknown
An authentication credential unknown to this library, but possibly valid and acceptable by the server.
Implementations§
Source§impl<T> AuthFlavor<T>
impl<T> AuthFlavor<T>
Sourcepub fn serialise_into<W: Write>(&self, buf: W) -> Result<(), Error>
pub fn serialise_into<W: Write>(&self, buf: W) -> Result<(), Error>
Serialises this auth flavor and writes it into buf.
§Panics
Panics if an associated byte payload is provided that exceeds 200 bytes.
Sourcepub fn id(&self) -> u32
pub fn id(&self) -> u32
Returns the ID value used to identify the variant in the wire protocol.
Sourcepub fn associated_data_len(&self) -> u32
pub fn associated_data_len(&self) -> u32
Returns the byte length of the associated auth data, if any.
Sourcepub fn serialised_len(&self) -> u32
pub fn serialised_len(&self) -> u32
Returns the on-wire length of this auth flavor once serialised, including discriminator and length values.
Trait Implementations§
Source§impl<T> Clone for AuthFlavor<T>
impl<T> Clone for AuthFlavor<T>
Source§fn clone(&self) -> AuthFlavor<T>
fn clone(&self) -> AuthFlavor<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more