[][src]Struct onc_rpc::auth::AuthUnixParams

pub struct AuthUnixParams<T> where
    T: AsRef<[u8]>, 
{ /* fields omitted */ }

AuthUnixParams represents the structures referred to as both AUTH_UNIX and AUTH_SYS in the various RFCs, used to idenitfy the client as a Unix user.

The structure is implemented as specified in APPENDIX A of RFC1831.

These values are trivial to forge and provide no actual security.

Implementations

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

pub fn new(
    stamp: u32,
    machine_name: T,
    uid: u32,
    gid: u32,
    gids: Option<SmallVec<[u32; 16]>>
) -> Self
[src]

Initialise a new AuthUnixParams instance containing the specified unix account identifiers.

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

Serialises this AuthUnixParams into buf, advancing the cursor position by serialised_len bytes.

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

An arbitrary ID generated by the caller.

pub fn machine_name(&self) -> &[u8][src]

The hostname of the caller's machine.

pub fn machine_name_str(&self) -> &str[src]

The hostname of the caller's machine as a reference to a UTF8 string.

# Panics

If the machine name cannot be expressed as a valid UTF8 string, this method panics.

Callers should probably make use of machine_name in general.

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

The caller's Unix user ID.

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

The caller's primary Unix group ID.

pub fn gids(&self) -> Option<&SmallVec<[u32; 16]>>[src]

Returns a copy of the gids array, a set of Unix group IDs the caller is a member of.

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

Returns the on-wire length of this message once serialised, including the message header.

Trait Implementations

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

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

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

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

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for AuthUnixParams<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.