Skip to main content

Shell

Struct Shell 

Source
pub struct Shell { /* private fields */ }
Expand description

The frame.

Implementations§

Source§

impl Shell

Source

pub fn new( spec: ShellSpec, window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self

The frame for spec; adds the frame’s commands to the registry and focuses the frame. Bind the keys after (Registry::bind_keys), once every command is registered.

Source

pub fn registry(&self) -> &Registry

The registry (the app’s commands and the frame’s).

Source

pub fn workspace(&self) -> &WorkspaceSpec

The workspace shown.

Source

pub fn set_workspace(&mut self, id: &str, cx: &mut Context<'_, Self>) -> bool

Shows the workspace id; whether there is one.

Source

pub fn workspace_id(&self) -> SharedString

The id of the workspace shown.

Source

pub fn current_view(&self) -> Option<SharedString>

The view of the app’s shown, if the workspace shown is one (None while a shared one, Pipeline or Code, is open).

Source

pub fn open_picker(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)

Opens the file picker (File → Open…); nothing when the app opens no files.

Source

pub fn picker(&self) -> Option<Entity<FilePickerView>>

The file picker, while it is open.

Source

pub fn toggle_drawer(&mut self, cx: &mut Context<'_, Self>)

Opens or closes the Panels drawer.

Source

pub fn drawer_open(&self) -> bool

Whether the Panels drawer is open.

Source

pub fn set_menus( &mut self, id: &str, menus: Vec<MenuSpec>, cx: &mut Context<'_, Self>, ) -> bool

Replaces the menu row of the workspace id; whether there is one.

Source

pub fn set_overlay( &mut self, view: Option<AnyView>, window: &mut Window, cx: &mut Context<'_, Self>, )

Shows view over everything (a help sheet, a dialog), or takes it away (None).

Source

pub fn has_overlay(&self) -> bool

Whether an overlay is shown.

Source

pub fn settings_index(&self, title: &str) -> Option<usize>

Whether the Settings section title exists (0 is Appearance, then the app’s, then People when the app records who works).

Source

pub fn set_status( &mut self, status: impl Into<SharedString>, cx: &mut Context<'_, Self>, )

Sets the status line.

Source

pub fn status(&self) -> &SharedString

The status line.

Source

pub fn set_project( &mut self, project: Option<SharedString>, cx: &mut Context<'_, Self>, )

Sets the project named in the title bar (None: none open).

Source

pub fn search(&self) -> Option<Entity<Search>>

The search, when open.

Opens the search over every command.

Source

pub fn open_search_with( &mut self, filter: Option<(SharedString, Filter)>, window: &mut Window, cx: &mut Context<'_, Self>, )

Opens the search over the commands filter accepts, titled title (Process ▸ “Find an operation…”: one kind of command); every command when None. Open already: closes it.

Source

pub fn settings_section(&self) -> Option<usize>

The Settings section shown, when Settings is open (0 is Appearance).

Source

pub fn show_settings( &mut self, section: Option<usize>, window: &mut Window, cx: &mut Context<'_, Self>, )

Opens Settings at section (0: Appearance, then the app’s in order), or closes it.

Source

pub fn set_look(&mut self, look: Look, cx: &mut Context<'_, Self>)

Sets the look and tells the app.

Trait Implementations§

Source§

impl EventEmitter<ShellEvent> for Shell

Source§

impl Render for Shell

Source§

fn render( &mut self, window: &mut Window, cx: &mut Context<'_, Self>, ) -> impl IntoElement

Render this view into an element tree.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Shell

§

impl !Send for Shell

§

impl !Sync for Shell

§

impl !UnwindSafe for Shell

§

impl Forget for Shell

§

impl Freeze for Shell
where &'static str: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const RcInner<RefCell<Vec<CommandSpec>>> is !null: Freeze, PhantomData<RcInner<RefCell<Vec<CommandSpec>>>>: Freeze, *const RcInner<RefCell<Vec<(SharedString, Rc<dyn Fn(&App) -> Vec<MenuItem>>)>>> is !null: Freeze, PhantomData<RcInner<RefCell<Vec<(SharedString, Rc<dyn Fn(&App) -> Vec<MenuItem>>)>>>>: Freeze, *const u8 is !null: Freeze, PhantomData<MenuItem>: Freeze, PhantomData<FileKind>: Freeze, PhantomData<u8>: Freeze, *const RcInner<dyn Fn(&App) -> Vec<PathBuf>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&App) -> Vec<PathBuf>>>: Freeze, *const RcInner<dyn Fn(PathBuf, &mut Window, &mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(PathBuf, &mut Window, &mut App)>>: Freeze, NonZero<u32>: Freeze, *const (): Freeze, *const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: Freeze, PhantomData<fn(FilePickerView) -> FilePickerView>: Freeze, *const dyn FnOnce() is !null: Freeze, PhantomData<dyn FnOnce()>: Freeze, PhantomData<WorkspaceSpec>: Freeze, PhantomData<SettingsSection>: Freeze, PhantomData<SharedString>: Freeze, PhantomData<fn(PeopleSettings) -> PeopleSettings>: Freeze, *const RcInner<dyn Fn(&mut Window, &mut App) -> AnyElement> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut Window, &mut App) -> AnyElement>>: Freeze, PhantomData<fn(Search) -> Search>: Freeze, PhantomData<fn(AccentPicker) -> AccentPicker>: Freeze, *const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: Freeze, PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: Freeze, PhantomData<Subscription>: Freeze,

§

impl Move for Shell

§

impl Unpin for Shell
where &'static str: Unpin, Arc<str>: Unpin, Rc<RefCell<Vec<CommandSpec>>>: Unpin, Rc<RefCell<Vec<(SharedString, Rc<dyn Fn(&App) -> Vec<MenuItem>>)>>>: Unpin, *const u8 is !null: Unpin, Rc<dyn Fn(&App) -> Vec<PathBuf>>: Unpin, Rc<dyn Fn(PathBuf, &mut Window, &mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, *const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: Unpin, Box<dyn FnOnce()>: Unpin, Rc<dyn Fn(&App) -> usize>: Unpin, Rc<dyn Fn(&mut Window, &mut App) -> AnyElement>: Unpin, Arc<RwLock<RawRwLock, FocusMap>>: Unpin,

§

impl UnsafeUnpin for Shell
where &'static str: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const RcInner<RefCell<Vec<CommandSpec>>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<Vec<CommandSpec>>>>: UnsafeUnpin, *const RcInner<RefCell<Vec<(SharedString, Rc<dyn Fn(&App) -> Vec<MenuItem>>)>>> is !null: UnsafeUnpin, PhantomData<RcInner<RefCell<Vec<(SharedString, Rc<dyn Fn(&App) -> Vec<MenuItem>>)>>>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<MenuItem>: UnsafeUnpin, PhantomData<FileKind>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const RcInner<dyn Fn(&App) -> Vec<PathBuf>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&App) -> Vec<PathBuf>>>: UnsafeUnpin, *const RcInner<dyn Fn(PathBuf, &mut Window, &mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(PathBuf, &mut Window, &mut App)>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const (): UnsafeUnpin, *const ArcInner<RwLock<RawRwLock, EntityRefCounts>> is !null: UnsafeUnpin, PhantomData<fn(FilePickerView) -> FilePickerView>: UnsafeUnpin, *const dyn FnOnce() is !null: UnsafeUnpin, PhantomData<dyn FnOnce()>: UnsafeUnpin, PhantomData<WorkspaceSpec>: UnsafeUnpin, PhantomData<SettingsSection>: UnsafeUnpin, PhantomData<SharedString>: UnsafeUnpin, PhantomData<fn(PeopleSettings) -> PeopleSettings>: UnsafeUnpin, *const RcInner<dyn Fn(&mut Window, &mut App) -> AnyElement> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut Window, &mut App) -> AnyElement>>: UnsafeUnpin, PhantomData<fn(Search) -> Search>: UnsafeUnpin, PhantomData<fn(AccentPicker) -> AccentPicker>: UnsafeUnpin, *const ArcInner<RwLock<RawRwLock, FocusMap>> is !null: UnsafeUnpin, PhantomData<ArcInner<RwLock<RawRwLock, FocusMap>>>: UnsafeUnpin, PhantomData<Subscription>: UnsafeUnpin,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more