Skip to main content

ScreenState

Struct ScreenState 

Source
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,

Source

pub fn new(win: W, cmdbar: CommandBarState<I>) -> Self

Create state for a Screen widget.

Source

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.

Source

pub fn as_description(&self) -> TabbedLayoutDescription<I>

Get a description of the open tabs and their window layouts.

Source

pub fn push_message<T: ToString>(&mut self, msg: T, style: Style)

Push a new error or status message.

Source

pub fn push_error<T: ToString>(&mut self, msg: T)

Push an error message with a red foreground.

Source

pub fn push_info<T: Into<String>>(&mut self, msg: T)

Push an info message with a default Style.

Source

pub fn clear_message(&mut self)

Clear the displayed error or status message.

Source

pub fn command_bar( &mut self, act: &CommandBarAction<I>, ctx: &EditContext, ) -> EditResult<EditInfo, I>

Perform a command bar action.

Source

pub fn current_tab(&self) -> UIResult<&WindowLayoutState<W, I>, I>

Get a reference to the window layout for the current tab.

Source

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.

Source

pub fn current_window(&self) -> Option<&W>

Get a reference to the currently focused window.

Source

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>
where W: Window<I> + Editable<EditContext, Store<I>, I>, I: ApplicationInfo,

Source§

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>
where W: Window<I> + Jumpable<C, I>, I: ApplicationInfo,

Source§

fn jump( &mut self, list: PositionList, dir: MoveDir1D, count: usize, ctx: &C, ) -> UIResult<usize, I>

Move through a PositionList in MoveDir1D direction count times. Read more
Source§

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>

Execute a prompt action.
Source§

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>

Scroll the viewable content in this object.
Source§

impl<W, C, I> Searchable<C, Store<I>, I> for ScreenState<W, I>
where W: Window<I> + Searchable<C, Store<I>, I>, I: ApplicationInfo,

Source§

fn search( &mut self, dir: MoveDirMod, count: Count, ctx: &C, store: &mut Store<I>, ) -> UIResult<EditInfo, I>

Search for the nth result in MoveDirMod direction.
Source§

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>

Execute a tab action.
Source§

impl<W, I> TabCount for ScreenState<W, I>
where W: Window<I>, I: ApplicationInfo,

Source§

fn tabs(&self) -> usize

Number of currently open tabs.
Source§

impl<W, I> TerminalCursor for ScreenState<W, I>

Source§

fn get_term_cursor(&self) -> Option<(u16, u16)>

Returns the current offset of the cursor, relative to the upper left corner of the terminal.
Source§

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>

Execute a window action.
Source§

impl<W, I> WindowCount for ScreenState<W, I>
where W: Window<I>, I: ApplicationInfo,

Source§

fn windows(&self) -> usize

Number of currently open windows.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> Any for T
where T: Any,