pub struct Session {
pub leader: pid_t,
pub mutable_state: LockDepRwLock<SessionMutableState, SessionMutableStateLock>,
}Expand description
A session is a collection of ProcessGroup objects that are related to each other. Each
session has a session ID (sid), which is a unique identifier for the session.
The session leader is the first ProcessGroup in a session. It is responsible for managing the
session, including sending signals to all processes in the session and controlling the
foreground and background process groups.
When a ProcessGroup is created, it is automatically added to the session of its parent.
See setsid(2) for information about creating sessions.
A session can be destroyed when the session leader exits or when all process groups in the session are destroyed.
Fields§
§leader: pid_tThe leader of the session
mutable_state: LockDepRwLock<SessionMutableState, SessionMutableStateLock>The mutable state of the Session.
Implementations§
Source§impl Session
impl Session
pub fn new(leader: pid_t) -> Arc<Session> ⓘ
Sourcepub fn disassociate_controlling_terminal<L>(&self, locked: &mut Locked<L>)where
L: LockBefore<ProcessGroupState>,
pub fn disassociate_controlling_terminal<L>(&self, locked: &mut Locked<L>)where
L: LockBefore<ProcessGroupState>,
Disassociates the controlling terminal from the session.
pub fn read(&self) -> impl Deref<Target = SessionMutableState>
pub fn write(&self) -> impl DerefMut<Target = SessionMutableState>
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 UnsafeUnpin for Session
impl !UnwindSafe for Session
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more