pub struct Terminal {
pub dev_pts_root: DirEntryHandle,
pub fscred: FsCred,
pub id: u32,
/* private fields */
}Expand description
State of a given terminal. This object handles both the main and the replica terminal.
Fields§
§dev_pts_root: DirEntryHandleThe root of the devpts fs responsible for this terminal.
fscred: FsCredThe owner of the terminal.
id: u32The identifier of the terminal.
Implementations§
Source§impl Terminal
impl Terminal
pub fn new( state: Arc<TtyState>, dev_pts_root: DirEntryHandle, fscred: FsCred, id: u32, ) -> Arc<Self>
pub fn to_owned(&self) -> Arc<Terminal>
Sourcepub fn set_termios<L>(&self, locked: &mut Locked<L>, termios: termios)where
L: LockBefore<ProcessGroupState>,
pub fn set_termios<L>(&self, locked: &mut Locked<L>, termios: termios)where
L: LockBefore<ProcessGroupState>,
Sets the terminal configuration.
Sourcepub fn main_close(&self)
pub fn main_close(&self)
close implementation of the main side of the terminal.
Sourcepub fn main_wait_async(
&self,
waiter: &Waiter,
events: FdEvents,
handler: EventHandler,
) -> WaitCanceler
pub fn main_wait_async( &self, waiter: &Waiter, events: FdEvents, handler: EventHandler, ) -> WaitCanceler
wait_async implementation of the main side of the terminal.
Sourcepub fn main_query_events(&self) -> FdEvents
pub fn main_query_events(&self) -> FdEvents
query_events implementation of the main side of the terminal.
Sourcepub fn main_read<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn OutputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
pub fn main_read<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn OutputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
read implementation of the main side of the terminal.
Sourcepub fn main_write<L>(
&self,
locked: &mut Locked<L>,
data: &mut dyn InputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
pub fn main_write<L>(
&self,
locked: &mut Locked<L>,
data: &mut dyn InputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
write implementation of the main side of the terminal.
Sourcepub fn replica_close(&self)
pub fn replica_close(&self)
close implementation of the replica side of the terminal.
Sourcepub fn replica_open(&self)
pub fn replica_open(&self)
Called when a new reference to the replica side of this terminal is made.
Sourcepub fn replica_wait_async(
&self,
waiter: &Waiter,
events: FdEvents,
handler: EventHandler,
) -> WaitCanceler
pub fn replica_wait_async( &self, waiter: &Waiter, events: FdEvents, handler: EventHandler, ) -> WaitCanceler
wait_async implementation of the replica side of the terminal.
Sourcepub fn replica_query_events(&self) -> FdEvents
pub fn replica_query_events(&self) -> FdEvents
query_events implementation of the replica side of the terminal.
Sourcepub fn replica_read<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn OutputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
pub fn replica_read<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn OutputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
read implementation of the replica side of the terminal.
Sourcepub fn replica_write<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn InputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
pub fn replica_write<L>(
&self,
_locked: &mut Locked<L>,
data: &mut dyn InputBuffer,
) -> Result<usize, Errno>where
L: LockBefore<ProcessGroupState>,
write implementation of the replica side of the terminal.
pub fn device(&self) -> DeviceType
pub fn read<'a>(self: &'a Terminal) -> TerminalReadGuard<'a>
pub fn write<'a>(self: &'a Terminal) -> TerminalWriteGuard<'a>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Terminal
impl !RefUnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl !UnwindSafe for Terminal
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<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