Skip to main content

OpenWorkspace

Struct OpenWorkspace 

Source
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

Source

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.

Source

pub fn id(&self) -> &str

The workspace’s identifier, which is also what its containers are named after.

Source

pub fn name(&self) -> &str

The name the person gave the workspace.

Source

pub fn paths(&self) -> &WorkspacePaths

Where the workspace’s folders are.

Source

pub fn profiles(&self) -> &[Profile]

The profiles a new tab can open: every profile of the store, the ones the workspace carries first.

Source

pub fn carries(&self, name: &str) -> bool

Whether the workspace’s workspace.qcode names the profile name.

Source

pub fn tabs(&self) -> &[Tab]

The tabs open in this workspace, in the order they are shown.

Source

pub fn active_tab(&self) -> Option<&Tab>

The open tab, when there is one.

Source

pub fn files(&self) -> &FileManagerState

What the file manager knows about the workspace’s own folder.

Source

pub fn backup_skip(&self) -> &[String]

The folders and files inside the workspace its backup leaves out.

Source

pub fn backs_up_assets(&self) -> bool

Whether the workspace’s backup takes Assets/ too.

Source

pub fn containers(&self) -> &[Container]

The containers of this workspace, as the engine last listed them.

Source

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.

Source

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.

Source

pub fn is_bridged(&self) -> bool

Whether the workspace listens for its tabs’ agents.

Trait Implementations§

Source§

impl Debug for OpenWorkspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.