pub struct Utmpx { /* private fields */ }Expand description
A login record
Implementations§
Source§impl Utmpx
impl Utmpx
Sourcepub fn record_type(&self) -> i16
pub fn record_type(&self) -> i16
A.K.A. ut.ut_type
Sourcepub fn terminal_suffix(&self) -> String
pub fn terminal_suffix(&self) -> String
A.K.A. ut.ut_id
Sourcepub fn tty_device(&self) -> String
pub fn tty_device(&self) -> String
A.K.A. ut.ut_line
Sourcepub fn login_time(&self) -> OffsetDateTime
pub fn login_time(&self) -> OffsetDateTime
A.K.A. ut.ut_tv
Sourcepub fn exit_status(&self) -> (i16, i16)
pub fn exit_status(&self) -> (i16, i16)
A.K.A. ut.ut_exit
Return (e_termination, e_exit)
Sourcepub fn into_inner(self) -> utmpx
pub fn into_inner(self) -> utmpx
Consumes the Utmpx, returning the underlying C struct utmpx
Sourcepub fn is_user_process(&self) -> bool
pub fn is_user_process(&self) -> bool
check if the record is a user process
Sourcepub fn canon_host(&self) -> IOResult<String>
pub fn canon_host(&self) -> IOResult<String>
Canonicalize host name using DNS
Sourcepub fn iter_all_records() -> UtmpxIter ⓘ
pub fn iter_all_records() -> UtmpxIter ⓘ
Iterate through all the utmp records.
This will use the default location, or the path Utmpx::iter_all_records_from
was most recently called with.
On systems with systemd-logind feature enabled at compile time, this will use systemd-logind instead of traditional utmp files.
Only one instance of UtmpxIter may be active at a time. This
function will block as long as one is still active. Beware!
Sourcepub fn iter_all_records_from<P: AsRef<Path>>(path: P) -> UtmpxIter ⓘ
pub fn iter_all_records_from<P: AsRef<Path>>(path: P) -> UtmpxIter ⓘ
Iterate through all the utmp records from a specific file.
No failure is reported or detected.
This function affects subsequent calls to Utmpx::iter_all_records.
On systems with systemd-logind feature enabled at compile time, if the path matches the default utmp file, this will use systemd-logind instead of traditional utmp files.
The same caveats as for Utmpx::iter_all_records apply.