pub struct OpenWorkspace { /* private fields */ }Expand description
One workspace the rail can switch to, with its own tabs and its own panel content.
Implementations§
Source§impl OpenWorkspace
impl OpenWorkspace
Sourcepub fn new(
file: &WorkspaceFile,
paths: WorkspacePaths,
profiles: Vec<Profile>,
) -> Self
pub fn new( file: &WorkspaceFile, paths: WorkspacePaths, profiles: Vec<Profile>, ) -> Self
A workspace as its own file describes it, living at paths, offering profiles.
The profiles are every profile of the store, already read: this screen shows
profiles and enters their containers, it does not go looking for their definitions. The
ones the workspace’s workspace.qcode names come first; any other one is added to the workspace
the first time a tab of it is opened, so a profile made after the workspace needs no hand
edit to be used in it.
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The workspace’s identifier, which is also what its containers are named after.
Sourcepub fn paths(&self) -> &WorkspacePaths
pub fn paths(&self) -> &WorkspacePaths
Where the workspace’s folders are.
Sourcepub fn profiles(&self) -> &[Profile]
pub fn profiles(&self) -> &[Profile]
The profiles a new tab can open: every profile of the store, the ones the workspace carries first.
Sourcepub fn carries(&self, name: &str) -> bool
pub fn carries(&self, name: &str) -> bool
Whether the workspace’s workspace.qcode names the profile name.
Sourcepub fn active_tab(&self) -> Option<&Tab>
pub fn active_tab(&self) -> Option<&Tab>
The open tab, when there is one.
Sourcepub fn files(&self) -> &FileManagerState
pub fn files(&self) -> &FileManagerState
What the file manager knows about the workspace’s own folder.
Sourcepub fn backup_skip(&self) -> &[String]
pub fn backup_skip(&self) -> &[String]
The folders and files inside the workspace its backup leaves out.
Sourcepub fn backs_up_assets(&self) -> bool
pub fn backs_up_assets(&self) -> bool
Whether the workspace’s backup takes Assets/ too.
Sourcepub fn containers(&self) -> &[Container]
pub fn containers(&self) -> &[Container]
The containers of this workspace, as the engine last listed them.
Sourcepub fn plan(&self, kind: &TabKind) -> Option<ContainerPlan>
pub fn plan(&self, kind: &TabKind) -> Option<ContainerPlan>
The container a tab of kind enters. A picture, a file in the editor, a PDF and an
office document are opened in the workspace’s own container, the one its shell runs in; a
Markdown document needs none, and a sound plays in a container made for it each time it
plays, which no tab enters.
Sourcepub fn program(&self, tab: &Tab, editor: Editor) -> Option<Vec<String>>
pub fn program(&self, tab: &Tab, editor: Editor) -> Option<Vec<String>>
What tab runs inside its container: a login shell, the harness of the profile with the
arguments that let it work without asking, opening the tab’s conversation when it shows
one and a new conversation otherwise, chafa drawing a picture or a page of a PDF, or
editor on a file. A PDF whose text is shown runs nothing in a terminal.
Sourcepub fn is_bridged(&self) -> bool
pub fn is_bridged(&self) -> bool
Whether the workspace listens for its tabs’ agents.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OpenWorkspace
impl RefUnwindSafe for OpenWorkspace
impl Send for OpenWorkspace
impl Sync for OpenWorkspace
impl Unpin for OpenWorkspace
impl UnsafeUnpin for OpenWorkspace
impl UnwindSafe for OpenWorkspace
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