[−][src]Struct meli::state::State
A State object to manage and own components and components of the UI. State
is responsible for
managing the terminal and interfacing with melib
Fields
cols: usize
rows: usize
grid: CellBuffer
overlay_grid: CellBuffer
draw_rate_limit: RateLimit
stdout: Option<StateStdout>
mouse: bool
child: Option<ForkType>
draw_horizontal_segment_fn: fn(_: &mut CellBuffer, _: &mut StateStdout, _: usize, _: usize, _: usize)
mode: UIMode
overlay: Vec<Box<dyn Component>>
components: Vec<Box<dyn Component>>
context: Context
timer: JoinHandle<()>
display_messages: SmallVec<[DisplayMessage; 8]>
display_messages_expiration_start: Option<UnixTimestamp>
display_messages_active: bool
display_messages_dirty: bool
display_messages_initialised: bool
display_messages_pos: usize
display_messages_area: Area
Implementations
impl State
[src]
pub fn new(
settings: Option<Settings>,
sender: Sender<ThreadEvent>,
receiver: Receiver<ThreadEvent>
) -> Result<Self>
[src]
settings: Option<Settings>,
sender: Sender<ThreadEvent>,
receiver: Receiver<ThreadEvent>
) -> Result<Self>
pub fn refresh_event(&mut self, event: RefreshEvent)
[src]
pub fn switch_to_main_screen(&mut self)
[src]
Switch back to the terminal's main screen (The command line the user sees before opening the application)
pub fn switch_to_alternate_screen(&mut self)
[src]
pub fn set_mouse(&mut self, value: bool)
[src]
pub fn receiver(&self) -> Receiver<ThreadEvent>
[src]
pub fn sender(&self) -> Sender<ThreadEvent>
[src]
pub fn restore_input(&mut self)
[src]
pub fn update_size(&mut self)
[src]
On SIGWNICH
the State
redraws itself according to the new terminal size.
pub fn redraw(&mut self)
[src]
Force a redraw for all dirty components.
fn draw_horizontal_segment(
grid: &mut CellBuffer,
stdout: &mut StateStdout,
x_start: usize,
x_end: usize,
y: usize
)
[src]
grid: &mut CellBuffer,
stdout: &mut StateStdout,
x_start: usize,
x_end: usize,
y: usize
)
Draw only a specific area
on the screen.
fn draw_horizontal_segment_no_color(
grid: &mut CellBuffer,
stdout: &mut StateStdout,
x_start: usize,
x_end: usize,
y: usize
)
[src]
grid: &mut CellBuffer,
stdout: &mut StateStdout,
x_start: usize,
x_end: usize,
y: usize
)
pub fn render(&mut self)
[src]
Draw the entire screen from scratch.
pub fn draw_component(&mut self, idx: usize)
[src]
pub fn can_quit_cleanly(&mut self) -> bool
[src]
pub fn register_component(&mut self, component: Box<dyn Component>)
[src]
fn exec_command(&mut self, cmd: Action)
[src]
Convert user commands to actions/method calls.
pub fn rcv_event(&mut self, event: UIEvent)
[src]
The application's main loop sends UIEvents
to state via this method.
pub fn try_wait_on_child(&mut self) -> Option<bool>
[src]
fn flush(&mut self)
[src]
fn stdout(&mut self) -> &mut StateStdout
[src]
pub fn check_accounts(&mut self)
[src]
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl !UnwindSafe for State
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,