[][src]Struct coreutils_core::os::passwd::Passwd

pub struct Passwd { /* fields omitted */ }

This struct holds the information of a user in UNIX/UNIX-like systems.

Contains sys/types.h passwd struct attributes as Rust more common types.

Methods

impl Passwd[src]

pub fn effective() -> Result<Self>[src]

Creates a new Passwd getting the current process user passwd as default using the effective user id.

Errors

If there is a error ocurrence when getting passwd (C struct) or converting it into Passwd, an error variant is returned.

pub fn real() -> Result<Self>[src]

Creates a new Passwd getting the current process user passwd as default using the real user id.

Errors

If there is a error ocurrence when getting passwd (C struct) or converting it into Passwd, an error variant is returned.

pub fn from_uid(id: Uid) -> Result<Self>[src]

Creates a new Passwd using a id to get all attributes.

Errors

If there is a error ocurrence when getting passwd (C struct) or converting it into Passwd, an error variant is returned.

pub fn from_name(name: &str) -> Result<Self>[src]

Creates a new Passwd using a name to get all attributes.

Errors

If there is a error ocurrence when getting passwd (C struct) or converting it into Passwd, an error variant is returned.

pub fn name(&self) -> &BStr[src]

Returns the Passwd (user) login name.

pub fn passwd(&self) -> &BStr[src]

Returns the Passwd (user) encrypted password.

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

Returns the Passwd (user) user ID.

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

Returns the Passwd (user) primary group ID.

pub fn gecos(&self) -> &BStr[src]

Returns the Passwd (user) full name.

pub fn dir(&self) -> &BStr[src]

Returns the Passwd (user) directory.

pub fn shell(&self) -> &BStr[src]

Returns the Passwd (user) shell.

pub fn belongs_to(&self) -> Result<Groups>[src]

Returns Groups that the Passwd (user) belongs to.

Errors

If it fails to get the Groups where Passwd (user) belongs, an error variant is returned.

Trait Implementations

impl Clone for Passwd[src]

impl Debug for Passwd[src]

impl Display for Passwd[src]

impl Eq for Passwd[src]

impl From<Passwd> for passwd[src]

impl Hash for Passwd[src]

impl Ord for Passwd[src]

impl PartialEq<Passwd> for Passwd[src]

impl PartialOrd<Passwd> for Passwd[src]

impl StructuralEq for Passwd[src]

impl StructuralPartialEq for Passwd[src]

impl TryFrom<passwd> for Passwd[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Passwd

impl Send for Passwd

impl Sync for Passwd

impl Unpin for Passwd

impl UnwindSafe for Passwd

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.