Struct broot::app::Panel

source ·
pub struct Panel {
    pub id: PanelId,
    pub areas: Areas,
    pub purpose: PanelPurpose,
    /* private fields */
}
Expand description

A colon on screen containing a stack of states, the top one being visible

Fields§

§id: PanelId§areas: Areas§purpose: PanelPurpose

Implementations§

source§

impl Panel

source

pub fn new(
id: PanelId,
state: Box<dyn PanelState>,
areas: Areas,
con: &AppContext
) -> Self

source

pub fn set_error(&mut self, text: String)

source

pub fn set_message<S: Into<String>>(&mut self, md: S)

source

pub fn apply_command<'c>(
&mut self,
w: &'c mut W,
cmd: &'c Command,
app_state: &mut AppState,
app_cmd_context: &'c AppCmdContext<'c>
) -> Result<CmdResult, ProgramError>

apply a command on the current state, with no effect on screen

source

pub fn refresh_input_status<'c>(
&mut self,
app_state: &AppState,
app_cmd_context: &'c AppCmdContext<'c>
)

called on focusing the panel and before the display, this updates the status from the command read in the input

source

pub fn do_pending_task(
&mut self,
app_state: &mut AppState,
screen: Screen,
con: &AppContext,
dam: &mut Dam
) -> Result<(), ProgramError>

do the next pending task stopping as soon as there’s an event in the dam

source

pub fn has_pending_task(&self) -> bool

source

pub fn add_event(
&mut self,
w: &mut W,
event: TimedEvent,
app_state: &AppState,
con: &AppContext
) -> Result<Command, ProgramError>

return a new command Update the input field

source

pub fn push_state(&mut self, new_state: Box<dyn PanelState>)

source

pub fn mut_state(&mut self) -> &mut dyn PanelState

source

pub fn state(&self) -> &dyn PanelState

source

pub fn clear_input(&mut self)

source

pub fn clear_input_invocation(&mut self, con: &AppContext)

remove the verb invocation from the input but keep the filter if there’s one

source

pub fn set_input_content(&mut self, content: &str)

source

pub fn get_input_content(&self) -> String

source

pub fn set_input_arg(&mut self, arg: String)

change the argument of the verb in the input, if there’s one

source

pub fn remove_state(&mut self) -> bool

return true when the element has been removed

source

pub fn display(
&mut self,
w: &mut W,
disc: &DisplayContext<'_>
) -> Result<(), ProgramError>

render the whole panel (state, status, purpose, input, flags)

Auto Trait Implementations§

§

impl !RefUnwindSafe for Panel

§

impl !Send for Panel

§

impl !Sync for Panel

§

impl Unpin for Panel

§

impl !UnwindSafe for Panel

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.