Enum utwt::UtmpEntry

source ·
#[non_exhaustive]
pub enum UtmpEntry { Empty, RunLevel { kernel_version: String, time_in_micros: i64, }, BootTime { kernel_version: String, time_in_micros: i64, }, ShutdownTime { kernel_version: String, time_in_micros: i64, }, NewTime(i64), OldTime(i64), InitProcess { pid: pid_t, time_in_micros: i64, }, LoginProcess { pid: pid_t, time_in_micros: i64, }, UserProcess { pid: pid_t, line: String, user: String, host: String, session: pid_t, time_in_micros: i64, }, DeadProcess { pid: pid_t, line: String, time_in_micros: i64, }, Accounting, }
Expand description

Parsed utmp entry.

Variants (Non-exhaustive)§

This enum is marked as 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.
§

Empty

Record does not contain valid info

§

RunLevel

Fields

§kernel_version: String

Kernel version

§time_in_micros: i64

Time entry was made

Change in system run-level (see init(8))

§

BootTime

Fields

§kernel_version: String

Kernel version

§time_in_micros: i64

Time entry was made

Time of system boot

§

ShutdownTime

Fields

§kernel_version: String

Kernel version

§time_in_micros: i64

Time entry was made

Time of system shutdown

§

NewTime(i64)

Time after system clock change

§

OldTime(i64)

Time before system clock change

§

InitProcess

Fields

§pid: pid_t

PID of the init process

§time_in_micros: i64

Time entry was made

Process spawned by init(8)

§

LoginProcess

Fields

§pid: pid_t

PID of the login process

§time_in_micros: i64

Time entry was made

Session leader process for user login

§

UserProcess

Fields

§pid: pid_t

PID of login process

§line: String

Device name of tty

§user: String

Username

§host: String

Hostname for remote login

§session: pid_t

Session ID (getsid(2))

§time_in_micros: i64

Time entry was made

Normal process

§

DeadProcess

Fields

§pid: pid_t

PID of the terminated process

§line: String

Device name of tty

§time_in_micros: i64

Time entry was made

Terminated process

§

Accounting

Not implemented

Trait Implementations§

source§

impl Clone for UtmpEntry

source§

fn clone(&self) -> UtmpEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for UtmpEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<UtmpEntry> for UtmpEntry

source§

fn eq(&self, other: &UtmpEntry) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> TryFrom<&'a utmp> for UtmpEntry

§

type Error = UtmpError

The type returned in the event of a conversion error.
source§

fn try_from(from: &utmp64) -> Result<Self, UtmpError>

Performs the conversion.
source§

impl<'a> TryFrom<&'a utmp> for UtmpEntry

§

type Error = UtmpError

The type returned in the event of a conversion error.
source§

fn try_from(from: &utmp32) -> Result<Self, UtmpError>

Performs the conversion.
source§

impl Eq for UtmpEntry

source§

impl StructuralEq for UtmpEntry

source§

impl StructuralPartialEq for UtmpEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.