pub struct ScreenState<W, I = EmptyInfo>where
W: Window<I>,
I: ApplicationInfo,{ /* private fields */ }Expand description
Persistent state for Screen.
Implementations§
Source§impl<W, I> ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
impl<W, I> ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
Sourcepub fn new(win: W, cmdbar: CommandBarState<I>) -> Self
pub fn new(win: W, cmdbar: CommandBarState<I>) -> Self
Create state for a Screen widget.
Sourcepub fn from_list(
tabs: FocusList<WindowLayoutState<W, I>>,
cmdbar: CommandBarState<I>,
) -> Self
pub fn from_list( tabs: FocusList<WindowLayoutState<W, I>>, cmdbar: CommandBarState<I>, ) -> Self
Create state for a Screen widget from an existing set of tabs.
Sourcepub fn as_description(&self) -> TabbedLayoutDescription<I>
pub fn as_description(&self) -> TabbedLayoutDescription<I>
Get a description of the open tabs and their window layouts.
Sourcepub fn push_message<T: ToString>(&mut self, msg: T, style: Style)
pub fn push_message<T: ToString>(&mut self, msg: T, style: Style)
Push a new error or status message.
Sourcepub fn push_error<T: ToString>(&mut self, msg: T)
pub fn push_error<T: ToString>(&mut self, msg: T)
Push an error message with a red foreground.
Sourcepub fn push_info<T: Into<String>>(&mut self, msg: T)
pub fn push_info<T: Into<String>>(&mut self, msg: T)
Push an info message with a default Style.
Sourcepub fn clear_message(&mut self)
pub fn clear_message(&mut self)
Clear the displayed error or status message.
Sourcepub fn command_bar(
&mut self,
act: &CommandBarAction<I>,
ctx: &EditContext,
) -> EditResult<EditInfo, I>
pub fn command_bar( &mut self, act: &CommandBarAction<I>, ctx: &EditContext, ) -> EditResult<EditInfo, I>
Perform a command bar action.
Sourcepub fn current_tab(&self) -> UIResult<&WindowLayoutState<W, I>, I>
pub fn current_tab(&self) -> UIResult<&WindowLayoutState<W, I>, I>
Get a reference to the window layout for the current tab.
Sourcepub fn current_tab_mut(&mut self) -> UIResult<&mut WindowLayoutState<W, I>, I>
pub fn current_tab_mut(&mut self) -> UIResult<&mut WindowLayoutState<W, I>, I>
Get a mutable reference to the window layout for the current tab.
Sourcepub fn current_window(&self) -> Option<&W>
pub fn current_window(&self) -> Option<&W>
Get a reference to the currently focused window.
Sourcepub fn current_window_mut(&mut self) -> UIResult<&mut W, I>
pub fn current_window_mut(&mut self) -> UIResult<&mut W, I>
Get a mutable reference to the currently focused window.
Trait Implementations§
Source§impl<W, I> Editable<EditContext, Store<I>, I> for ScreenState<W, I>
impl<W, I> Editable<EditContext, Store<I>, I> for ScreenState<W, I>
Source§fn editor_command(
&mut self,
act: &EditorAction,
ctx: &EditContext,
store: &mut Store<I>,
) -> EditResult<EditInfo, I>
fn editor_command( &mut self, act: &EditorAction, ctx: &EditContext, store: &mut Store<I>, ) -> EditResult<EditInfo, I>
Execute an editor action.
Source§impl<W, C, I> Jumpable<C, I> for ScreenState<W, I>
impl<W, C, I> Jumpable<C, I> for ScreenState<W, I>
Source§impl<W, I> Promptable<EditContext, Store<I>, I> for ScreenState<W, I>
impl<W, I> Promptable<EditContext, Store<I>, I> for ScreenState<W, I>
Source§fn prompt(
&mut self,
act: &PromptAction,
ctx: &EditContext,
store: &mut Store<I>,
) -> EditResult<Vec<(Action<I>, EditContext)>, I>
fn prompt( &mut self, act: &PromptAction, ctx: &EditContext, store: &mut Store<I>, ) -> EditResult<Vec<(Action<I>, EditContext)>, I>
Execute a prompt action.
Source§impl<W, I> Scrollable<EditContext, Store<I>, I> for ScreenState<W, I>
impl<W, I> Scrollable<EditContext, Store<I>, I> for ScreenState<W, I>
Source§fn scroll(
&mut self,
style: &ScrollStyle,
ctx: &EditContext,
store: &mut Store<I>,
) -> EditResult<EditInfo, I>
fn scroll( &mut self, style: &ScrollStyle, ctx: &EditContext, store: &mut Store<I>, ) -> EditResult<EditInfo, I>
Scroll the viewable content in this object.
Source§impl<W, C, I> Searchable<C, Store<I>, I> for ScreenState<W, I>
impl<W, C, I> Searchable<C, Store<I>, I> for ScreenState<W, I>
Source§impl<W, I> TabContainer<EditContext, Store<I>, I> for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
impl<W, I> TabContainer<EditContext, Store<I>, I> for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
Source§fn tab_command(
&mut self,
act: &TabAction<I>,
ctx: &EditContext,
store: &mut Store<I>,
) -> UIResult<EditInfo, I>
fn tab_command( &mut self, act: &TabAction<I>, ctx: &EditContext, store: &mut Store<I>, ) -> UIResult<EditInfo, I>
Execute a tab action.
Source§impl<W, I> TabCount for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
impl<W, I> TabCount for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
Source§impl<W, I> TerminalCursor for ScreenState<W, I>
impl<W, I> TerminalCursor for ScreenState<W, I>
Source§impl<W, I> WindowContainer<EditContext, Store<I>, I> for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
impl<W, I> WindowContainer<EditContext, Store<I>, I> for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
Source§fn window_command(
&mut self,
act: &WindowAction<I>,
ctx: &EditContext,
store: &mut Store<I>,
) -> UIResult<EditInfo, I>
fn window_command( &mut self, act: &WindowAction<I>, ctx: &EditContext, store: &mut Store<I>, ) -> UIResult<EditInfo, I>
Execute a window action.
Source§impl<W, I> WindowCount for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
impl<W, I> WindowCount for ScreenState<W, I>where
W: Window<I>,
I: ApplicationInfo,
Auto Trait Implementations§
impl<W, I> Freeze for ScreenState<W, I>
impl<W, I> RefUnwindSafe for ScreenState<W, I>where
<I as ApplicationInfo>::Action: RefUnwindSafe,
<I as ApplicationInfo>::WindowId: RefUnwindSafe,
I: RefUnwindSafe,
W: RefUnwindSafe,
impl<W, I> Send for ScreenState<W, I>
impl<W, I> Sync for ScreenState<W, I>where
<I as ApplicationInfo>::Action: Sync,
<I as ApplicationInfo>::ContentId: Sync,
<I as ApplicationInfo>::WindowId: Sync,
I: Send + Sync,
W: Sync,
impl<W, I> Unpin for ScreenState<W, I>
impl<W, I> UnsafeUnpin for ScreenState<W, I>
impl<W, I> UnwindSafe for ScreenState<W, I>where
<I as ApplicationInfo>::Action: UnwindSafe,
<I as ApplicationInfo>::WindowId: UnwindSafe,
I: UnwindSafe,
W: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
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 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>
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