pub struct Session {
pub id: SessionId,
pub user_id: u64,
pub username: String,
pub vt_number: u8,
pub state: SessionState,
pub foreground_group: u64,
pub background_groups: Vec<u64>,
pub login_time: u64,
pub process_ids: Vec<u64>,
}Expand description
A user session containing process groups, VT assignment, and metadata.
Fields§
§id: SessionIdUnique session identifier.
user_id: u64User ID of the session owner.
username: StringUsername of the session owner.
vt_number: u8Virtual terminal number assigned to this session.
state: SessionStateCurrent state.
foreground_group: u64Process group ID that currently owns the terminal (foreground).
background_groups: Vec<u64>Background process group IDs.
login_time: u64TSC tick count at login time.
process_ids: Vec<u64>Process IDs belonging to this session.
Implementations§
Source§impl Session
impl Session
Sourcepub fn contains_process(&self, pid: u64) -> bool
pub fn contains_process(&self, pid: u64) -> bool
Check whether the given process belongs to this session.
Sourcepub fn process_count(&self) -> usize
pub fn process_count(&self) -> usize
Return the number of processes in this session.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnwindSafe for Session
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)