pub struct Terminal {
inner: Arc<Inner>,
thread: Mutex<Option<JoinHandle<()>>>,
}Expand description
One terminal.
Fields§
§inner: Arc<Inner>§thread: Mutex<Option<JoinHandle<()>>>Implementations§
Source§impl Terminal
impl Terminal
Sourcepub fn spawn(config: &TerminalConfig) -> Result<Self, Error>
pub fn spawn(config: &TerminalConfig) -> Result<Self, Error>
Spawn a shell on a fresh PTY.
Sourcepub fn write_bytes(&self, bytes: &[u8]) -> Result<(), Error>
pub fn write_bytes(&self, bytes: &[u8]) -> Result<(), Error>
Type raw bytes as-is: a client’s own keystrokes, which are already the bytes the PTY wants.
Sourcepub fn read(
&self,
since: Option<u64>,
max_lines: usize,
max_bytes: usize,
) -> ReadResult
pub fn read( &self, since: Option<u64>, max_lines: usize, max_bytes: usize, ) -> ReadResult
A bounded read of the scrollback and the screen.
Sourcepub fn repaint_and_seq(&self) -> (Vec<u8>, u32)
pub fn repaint_and_seq(&self) -> (Vec<u8>, u32)
The visible screen as a VT stream, with the sequence the next chunk will carry - both read under the term’s lock, because the sequence is bumped under it after each parse. So every chunk below the sequence is already in the repaint, and no chunk at or above it is.
Sourcepub fn subscribe(&self) -> Receiver<OutputChunk>
pub fn subscribe(&self) -> Receiver<OutputChunk>
The output stream, from the next chunk.
Sourcepub fn state_stream(&self) -> Receiver<State>
pub fn state_stream(&self) -> Receiver<State>
The state stream, from the current value.
Sourcepub fn exit_stream(&self) -> Receiver<bool>
pub fn exit_stream(&self) -> Receiver<bool>
A stream that fires once, when the shell exits.
Sourcepub fn shell_exit(&self) -> Option<Exit>
pub fn shell_exit(&self) -> Option<Exit>
The shell’s own exit, once it has one.
pub fn cols(&self) -> u16
pub fn rows(&self) -> u16
pub fn shell(&self) -> &str
pub fn cwd(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Terminal
impl !RefUnwindSafe for Terminal
impl !UnwindSafe for Terminal
impl Send for Terminal
impl Sync for Terminal
impl Unpin for Terminal
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more