pub struct Sessions { /* private fields */ }Expand description
All live sessions, keyed by id.
Implementations§
Source§impl Sessions
impl Sessions
pub fn insert( &mut self, id: SessionId, name: String, port: u16, kind: StreamKind, view: SharedView, opts: RenderOptions, )
Sourcepub fn is_connected(&self, id: SessionId) -> bool
pub fn is_connected(&self, id: SessionId) -> bool
Whether a session currently has a client attached. Unknown ids read as disconnected, which is what Window > Cleanup wants: a window whose session is already gone is exactly a window to sweep away.
pub fn get_mut(&mut self, id: SessionId) -> Option<&mut SessionState>
pub fn remove(&mut self, id: SessionId) -> Option<SessionState>
Sourcepub fn feed(&mut self, id: SessionId, data: &[u8])
pub fn feed(&mut self, id: SessionId, data: &[u8])
Feeds bytes into a session’s renderer and view.
Sourcepub fn mark_reconnected(&mut self, id: SessionId)
pub fn mark_reconnected(&mut self, id: SessionId)
Draws a horizontal rule announcing a reattached client.
Sourcepub fn mark_attached(&mut self, id: SessionId, reattached: bool)
pub fn mark_attached(&mut self, id: SessionId, reattached: bool)
Reflects a ServerEvent::Attached: always marks the session
connected, but draws the “– reconnected –” rule only for a
genuine reattach (reattached), never for a brand-new session’s
first-ever attach — see defect 1 in
.superpowers/sdd/lifecycle-fixes-report.md.
pub fn mark_disconnected(&mut self, id: SessionId)
Sourcepub fn plain_text(&self, id: SessionId) -> Option<String>
pub fn plain_text(&self, id: SessionId) -> Option<String>
One session’s scrollback as plain text, for File > Save As.
Sourcepub fn select_all(&mut self, id: SessionId)
pub fn select_all(&mut self, id: SessionId)
Selects a session’s whole scrollback (Edit > Select All).
Sourcepub fn selected_text(&self, id: SessionId) -> Option<String>
pub fn selected_text(&self, id: SessionId) -> Option<String>
One session’s currently selected text, if any (Edit > Copy).
Sourcepub fn window_title(&self, id: SessionId) -> Option<String>
pub fn window_title(&self, id: SessionId) -> Option<String>
The title a session’s window should currently show, for reflecting connect/disconnect state after the fact (the window itself is not reachable from here — the caller owns the desktop).