pub struct Registry {
pub sessions: BTreeMap<SessionId, TearSession>,
}Expand description
The complete registry of sessions / windows / panes. Stored flat
at the registry level — every entity is reachable in O(log N) via
its id, and the TearSession struct holds child windows/panes
by id for the typed-domain consumers.
Fields§
§sessions: BTreeMap<SessionId, TearSession>Implementations§
Source§impl Registry
impl Registry
Sourcepub fn sessions_in_order(&self) -> Vec<TearSession>
pub fn sessions_in_order(&self) -> Vec<TearSession>
Sorted list of sessions, oldest-first.
Sourcepub fn create_session(&mut self, name: &str) -> SessionId
pub fn create_session(&mut self, name: &str) -> SessionId
Insert a freshly minted session with no windows yet — caller is expected to add at least one window before returning.
Sourcepub fn add_window(
&mut self,
session_id: SessionId,
name: &str,
shell: &str,
args: &[String],
cwd: Option<&str>,
env: &[(String, String)],
size_cells: (u16, u16),
yurai: Yurai,
) -> Option<(WindowId, PaneId)>
pub fn add_window( &mut self, session_id: SessionId, name: &str, shell: &str, args: &[String], cwd: Option<&str>, env: &[(String, String)], size_cells: (u16, u16), yurai: Yurai, ) -> Option<(WindowId, PaneId)>
Insert a window into a session, with a single seed-pane.
args / cwd / env are recorded on the seed TearPane
so the pane’s typed record matches what was actually spawned.
They used to be hardcoded vec![] / None / vec![] here,
which is what made a captured-then-replayed session lose its
arguments: praca’s from_live read these fields faithfully,
but they had never been populated in the first place.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe for Registry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.