pub struct WorkspaceScreen { /* private fields */ }Expand description
The workspace screen.
Implementations§
Source§impl WorkspaceScreen
impl WorkspaceScreen
Sourcepub fn new(
engine: Option<Engine>,
user: HostUser,
workspaces: Vec<OpenWorkspace>,
) -> Self
pub fn new( engine: Option<Engine>, user: HostUser, workspaces: Vec<OpenWorkspace>, ) -> Self
A screen showing workspaces, entering their containers through engine.
Without an engine the screen still opens: the design asks that a missing engine leave the application usable, so every action that would touch a container is drawn faint and says why instead of failing when it is pressed.
Sourcepub fn watching(self, live: bool) -> Self
pub fn watching(self, live: bool) -> Self
The same screen following the disk when live is true: the folders the open workspace’s
tree shows are watched, and what other programs change in them shows at once.
It is off unless asked for because a watch waits for the disk on a background thread, and a test harness runs background work in line, where that wait would never end. Tests of the watch bound each wait instead.
Sourcepub fn bridging(self, bridging: bool) -> Self
pub fn bridging(self, bridging: bool) -> Self
The same screen, listening for the agents of each open workspace’s tabs when bridging is
true, so they can send each other messages.
It is off unless asked for for the same reason as WorkspaceScreen::watching: a listener
waits on a background thread, which a test harness would run in line. Tests hand the
screen its calls by hand instead.
Sourcepub fn with_registry(self, path: Option<PathBuf>) -> Self
pub fn with_registry(self, path: Option<PathBuf>) -> Self
The same screen, noting every container it starts in the list at path, which is what
lets them be stopped once no QCode is open. None notes nothing.
Sourcepub fn with_providers_path(self, path: Option<PathBuf>) -> Self
pub fn with_providers_path(self, path: Option<PathBuf>) -> Self
The same screen, reading providers.toml at path rather than this machine’s own data
folder before a provider tab starts, so a test can say what it holds without ever
touching a real one.
Sourcepub fn with_upstream(self, upstream: Upstream) -> Self
pub fn with_upstream(self, upstream: Upstream) -> Self
The same screen, asking every provider of every open workspace with upstream rather than
over the network, which is what lets a test say what a provider answers without one.
It is set before a workspace opens its relay, since that is the moment the relay is opened with it; afterwards the listeners already running keep the upstream they were given.
Sourcepub fn backing_up(self, every: BackupEvery) -> Self
pub fn backing_up(self, every: BackupEvery) -> Self
The same screen, backing its workspaces up as often as every says.
Sourcepub fn backup_every(&self) -> BackupEvery
pub fn backup_every(&self) -> BackupEvery
How often the open workspaces are backed up.
Sourcepub fn workspace(&self) -> Option<&OpenWorkspace>
pub fn workspace(&self) -> Option<&OpenWorkspace>
The workspace the rail has open.
Sourcepub fn workspaces(&self) -> &[OpenWorkspace]
pub fn workspaces(&self) -> &[OpenWorkspace]
Every workspace of the rail, in its order.
Sourcepub fn set_editor(&mut self, editor: Editor)
pub fn set_editor(&mut self, editor: Editor)
Makes editor the one a file opens in from now on. Tabs already open keep the editor
they started with until they are opened again.
Sourcepub fn set_sound(&mut self, sound: Sound)
pub fn set_sound(&mut self, sound: Sound)
Makes sound what opening a sound does from now on. A sound tab already open keeps what
it does until it is started again.
Sourcepub fn set_ask_first(&mut self, ask: bool)
pub fn set_ask_first(&mut self, ask: bool)
Makes the first message from one tab to another ask the person when ask is true, and
go without asking otherwise. What the person already answered about a pair still holds.
Sourcepub fn ask_first(&self) -> bool
pub fn ask_first(&self) -> bool
Whether the first message from one tab to another asks the person.
Sourcepub fn set_freeze_idle(&mut self, freeze: bool)
pub fn set_freeze_idle(&mut self, freeze: bool)
Makes a profile whose container is doing nothing be frozen in the background, and its
memory written out to swap, when freeze is true; nothing of the kind when it is false.
Sourcepub fn freezes_idle(&self) -> bool
pub fn freezes_idle(&self) -> bool
Whether a quiet profile’s container is frozen in the background.
Sourcepub fn settled(&mut self) -> Command<Msg>
pub fn settled(&mut self) -> Command<Msg>
Asks on the screen’s own account whether this machine can freeze a container at all, which is asked once, on a background thread, the first time the screen is opened, and then keeps the answer. Without an engine there is nothing to ask and the answer stays unknown, which runs no timer at all.
Sourcepub fn hearing_in(self, runtime: Option<PathBuf>) -> Self
pub fn hearing_in(self, runtime: Option<PathBuf>) -> Self
The same screen, looking for the sound server’s socket in runtime rather than in the
runtime folder this process was given.
Sourcepub fn showing_on(self, display: Result<Display, NoDisplay>) -> Self
pub fn showing_on(self, display: Result<Display, NoDisplay>) -> Self
The same screen, opening windows on display rather than on the session this process was
started in.
The application never calls this: the screen reads the session itself. It exists so that what a window’s tab does can be checked on a machine with no compositor, and what it says when there is none on a machine that has one.
Sourcepub fn set_active(&mut self, index: usize)
pub fn set_active(&mut self, index: usize)
Opens the workspace at index of the rail, when there is one there.
Sourcepub fn restore_tabs(&mut self, index: usize, record: &SessionWorkspace)
pub fn restore_tabs(&mut self, index: usize, record: &SessionWorkspace)
Gives the workspace at index the tabs record lists, each waiting to be shown before it
starts, with the tab the record had open open again.
A profile tab whose profile is gone from the store is left out: there is no container it could enter, and a tab that can only ever fail is not worth bringing back. A blank tab comes back blank; it never had a container. A tab of one of the workspace’s files comes back whether or not the file is still there, and says so when it is shown; one whose path climbs out of the workspace is left out, because nothing QCode wrote would name one.
A tab keeps the id and the name it had. One whose id the record does not give, or gives to an earlier tab as well, is given a new one after every id the record gives.
Sourcepub fn session(&self) -> Session
pub fn session(&self) -> Session
What is open, in the shape the session file keeps it: the workspaces in rail order, the one that is open, and the tabs of each.
Sourcepub fn launch_command(&self, key: TabKey) -> Option<EngineCommand>
pub fn launch_command(&self, key: TabKey) -> Option<EngineCommand>
The command the tab key spawns, which is always the engine entering a container.
This is the one place a tab’s program is decided, so a test can read it back and see for itself that no tab runs anything on the machine QCode runs on.
Sourcepub fn read_command(&self, key: TabKey) -> Option<EngineCommand>
pub fn read_command(&self, key: TabKey) -> Option<EngineCommand>
The command that takes the text out of the file the tab key shows, which is always the
engine running a program in the workspace’s own container, without a terminal; None for a
tab that shows no such text.
Source§impl WorkspaceScreen
impl WorkspaceScreen
Sourcepub fn attach(&mut self, key: TabKey, session: TerminalSession)
pub fn attach(&mut self, key: TabKey, session: TerminalSession)
Attaches session to the tab key and marks the tab running, which is what the screen
does itself once a tab’s container is up. A program started some other way, such as the
shell of a demonstration, is shown in the tab the same way.
Sourcepub fn reading(&self, profile: &str) -> u64
pub fn reading(&self, profile: &str) -> u64
The number of the reading of profile’s conversations last started in the open workspace.
An answer, Msg::HistoryRead, is only taken when it carries this number.
Sourcepub fn backups_reading(&self) -> u64
pub fn backups_reading(&self) -> u64
The number of the reading of the list of backups last started. An answer,
Msg::BackupsRead, is only taken when it carries this number.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for WorkspaceScreen
impl !UnwindSafe for WorkspaceScreen
impl Freeze for WorkspaceScreen
impl Send for WorkspaceScreen
impl Sync for WorkspaceScreen
impl Unpin for WorkspaceScreen
impl UnsafeUnpin for WorkspaceScreen
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> 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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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