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.
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.
The same caveats as for Utmpx::iter_all_records apply.
Auto Trait Implementations§
impl Freeze for Utmpx
impl RefUnwindSafe for Utmpx
impl Send for Utmpx
impl Sync for Utmpx
impl Unpin for Utmpx
impl UnwindSafe for Utmpx
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more