pub struct Session {
pub terminal: Terminal,
/* private fields */
}Expand description
A persistent terminal session.
Tracks connected clients, buffers recent output for replay on reconnect, and detects when the session becomes orphaned.
Fields§
§terminal: TerminalImplementations§
Source§impl Session
impl Session
Sourcepub fn new(
terminal: Terminal,
output_rx: Receiver<Vec<u8>>,
scrollback_limit: usize,
orphan_timeout: Duration,
) -> Arc<Self> ⓘ
pub fn new( terminal: Terminal, output_rx: Receiver<Vec<u8>>, scrollback_limit: usize, orphan_timeout: Duration, ) -> Arc<Self> ⓘ
Create a new session.
orphan_timeout controls how long a session with no attached clients
survives before the reaper removes it (default: DEFAULT_ORPHAN_TIMEOUT).
Sourcepub fn attach(&self) -> AttachResult
pub fn attach(&self) -> AttachResult
Attach a client: increment the counter, subscribe to live output, and return the scrollback event log. The subscription and snapshot are taken under the same lock so no output is lost.
Sourcepub fn set_window_size(&self, rows: u16, cols: u16)
pub fn set_window_size(&self, rows: u16, cols: u16)
Update the current PTY window size (broadcast to viewers) and record the resize in the scrollback log so replay clients see it too.
Sourcepub fn client_count(&self) -> usize
pub fn client_count(&self) -> usize
Number of currently attached clients.
Auto Trait Implementations§
impl !Freeze for Session
impl !RefUnwindSafe for Session
impl !UnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more