pub struct Shell { /* private fields */ }Expand description
The frame.
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn new(
spec: ShellSpec,
window: &mut Window,
cx: &mut Context<'_, Self>,
) -> Self
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.
Sourcepub fn workspace(&self) -> &WorkspaceSpec
pub fn workspace(&self) -> &WorkspaceSpec
The workspace shown.
Sourcepub fn set_workspace(&mut self, id: &str, cx: &mut Context<'_, Self>) -> bool
pub fn set_workspace(&mut self, id: &str, cx: &mut Context<'_, Self>) -> bool
Shows the workspace id; whether there is one.
Sourcepub fn workspace_id(&self) -> SharedString
pub fn workspace_id(&self) -> SharedString
The id of the workspace shown.
Sourcepub fn current_view(&self) -> Option<SharedString>
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).
Sourcepub fn open_picker(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
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.
Sourcepub fn picker(&self) -> Option<Entity<FilePickerView>>
pub fn picker(&self) -> Option<Entity<FilePickerView>>
The file picker, while it is open.
Sourcepub fn toggle_drawer(&mut self, cx: &mut Context<'_, Self>)
pub fn toggle_drawer(&mut self, cx: &mut Context<'_, Self>)
Opens or closes the Panels drawer.
Sourcepub fn drawer_open(&self) -> bool
pub fn drawer_open(&self) -> bool
Whether the Panels drawer is open.
Replaces the menu row of the workspace id; whether there is one.
Sourcepub fn set_overlay(
&mut self,
view: Option<AnyView>,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
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).
Sourcepub fn has_overlay(&self) -> bool
pub fn has_overlay(&self) -> bool
Whether an overlay is shown.
Sourcepub fn settings_index(&self, title: &str) -> Option<usize>
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).
Sourcepub fn set_status(
&mut self,
status: impl Into<SharedString>,
cx: &mut Context<'_, Self>,
)
pub fn set_status( &mut self, status: impl Into<SharedString>, cx: &mut Context<'_, Self>, )
Sets the status line.
Sourcepub fn status(&self) -> &SharedString
pub fn status(&self) -> &SharedString
The status line.
Sourcepub fn set_project(
&mut self,
project: Option<SharedString>,
cx: &mut Context<'_, Self>,
)
pub fn set_project( &mut self, project: Option<SharedString>, cx: &mut Context<'_, Self>, )
Sets the project named in the title bar (None: none open).
Sourcepub fn open_search(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
pub fn open_search(&mut self, window: &mut Window, cx: &mut Context<'_, Self>)
Opens the search over every command.
Sourcepub fn open_search_with(
&mut self,
filter: Option<(SharedString, Filter)>,
window: &mut Window,
cx: &mut Context<'_, Self>,
)
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.
Sourcepub fn settings_section(&self) -> Option<usize>
pub fn settings_section(&self) -> Option<usize>
The Settings section shown, when Settings is open (0 is Appearance).
Trait Implementations§
impl EventEmitter<ShellEvent> for Shell
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 Shellwhere
&'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 Shellwhere
&'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 Shellwhere
&'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> 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.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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