[][src]Enum onc_rpc::auth::AuthFlavor

#[non_exhaustive]pub enum AuthFlavor<T> where
    T: AsRef<[u8]>, 
{ AuthNone(Option<T>), AuthUnix(AuthUnixParams<T>), AuthShort(T), Unknown { id: u32, data: T, }, }

A set of basic auth flavor types described in RFC 5531.

The deprecated AUTH_DH is not supported, nor is GSS.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
AuthNone(Option<T>)

AUTH_NONE with the opaque data the spec allows to be included (typically None).

AuthUnix(AuthUnixParams<T>)

AUTH_UNIX and the fields it contains.

AuthShort(T)

`AUTH_SHORT and its opaque identifier

Unknown

An authentication credential unknown to this library, but possibly valid and acceptable by the server.

Fields of Unknown

id: u32

The discriminator for this auth type.

data: T

The opaque data contained within the this flavor.

Implementations

impl<T> AuthFlavor<T> where
    T: AsRef<[u8]>, 
[src]

pub fn serialise_into(&self, buf: &mut Cursor<Vec<u8>>) -> Result<(), Error>[src]

Serialises this auth flavor and writes it into buf.

pub fn id(&self) -> u32[src]

Returns the ID value used to identify the variant in the wire protocol.

pub fn associated_data_len(&self) -> u32[src]

Returns the byte length of the associated auth data, if any.

pub fn serialised_len(&self) -> u32[src]

Returns the on-wire length of this auth flavor once serialised, including discriminator and length values.

Trait Implementations

impl<T: Debug> Debug for AuthFlavor<T> where
    T: AsRef<[u8]>, 
[src]

impl<T: PartialEq> PartialEq<AuthFlavor<T>> for AuthFlavor<T> where
    T: AsRef<[u8]>, 
[src]

impl<T> StructuralPartialEq for AuthFlavor<T> where
    T: AsRef<[u8]>, 
[src]

impl<'a> TryFrom<&'a [u8]> for AuthFlavor<&'a [u8]>[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<Bytes> for AuthFlavor<Bytes>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<T> RefUnwindSafe for AuthFlavor<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for AuthFlavor<T> where
    T: Send
[src]

impl<T> Sync for AuthFlavor<T> where
    T: Sync
[src]

impl<T> Unpin for AuthFlavor<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for AuthFlavor<T> where
    T: UnwindSafe
[src]

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, 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.