[][src]Enum umanux::user::gecos_fields::Gecos

pub enum Gecos {
    Detail {
        full_name: String,
        room: String,
        phone_work: String,
        phone_home: String,
        other: Option<Vec<String>>,
    },
    Simple {
        comment: String,
    },
}

The gecos field of a user.

In the /etc/passwd file this field is a , sepparated list of items. The first 4 values are more or less standardised to be full name, room, phone at work and phone at home. After that there can be some extra fields often containing the emailadress and even additional information.

This enum represents the first 4 values by name and adds the other values to a list of strings Gecos::Detail. If only one field is found and no , at all this value is used as a human readable comment Gecos::Simple.

Variants

Detail

Fields of Detail

full_name: Stringroom: Stringphone_work: Stringphone_home: Stringother: Option<Vec<String>>
Simple

Fields of Simple

comment: String

Implementations

impl Gecos[src]

#[must_use]pub fn get_comment(&self) -> Option<&str>[src]

#[must_use]pub fn get_full_name(&self) -> Option<&str>[src]

#[must_use]pub fn get_room(&self) -> Option<&str>[src]

#[must_use]pub fn get_phone_work(&self) -> Option<&str>[src]

#[must_use]pub fn get_phone_home(&self) -> Option<&str>[src]

#[must_use]pub const fn get_other(&self) -> Option<&Vec<String>>[src]

Trait Implementations

impl Clone for Gecos[src]

impl Debug for Gecos[src]

impl Display for Gecos[src]

impl Eq for Gecos[src]

impl PartialEq<Gecos> for Gecos[src]

impl StructuralEq for Gecos[src]

impl StructuralPartialEq for Gecos[src]

impl TryFrom<String> for Gecos[src]

type Error = UserLibError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Gecos

impl Send for Gecos

impl Sync for Gecos

impl Unpin for Gecos

impl UnwindSafe for Gecos

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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.