pub struct CommandLogs {
pub entries: Vec<CommandLogEntry>,
pub scroll: u16,
pub max_scroll: u16,
pub x_scroll: u16,
pub max_x_scroll: u16,
}Expand description
Owned state for the Command Logs overlay: the snapshotted entries and the (vertical + horizontal) scroll cursor with its renderer-published bounds.
Fields§
§entries: Vec<CommandLogEntry>Snapshot of the global command log, oldest-first (the renderer paints
it newest-first). Refreshed by Self::sync.
scroll: u16Vertical scroll offset, in rows. Clamped to max_scroll.
max_scroll: u16Maximum vertical scroll offset, republished by the renderer each
frame as content_rows.saturating_sub(viewport_rows).
x_scroll: u16Horizontal scroll offset, in columns. Clamped to max_x_scroll.
max_x_scroll: u16Maximum horizontal scroll offset, republished by the renderer.
Implementations§
Source§impl CommandLogs
impl CommandLogs
Sourcepub fn sync(&mut self)
pub fn sync(&mut self)
Copy the global command log into Self::entries. Cheap clone of a
bounded ring (≤ command_log::MAX_ENTRIES); called on open and per
tick while the overlay is up so it tracks commands that finish (e.g.
an off-thread GitHub fetch) while the user is reading.
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down one row, never past the last line.
Sourcepub fn scroll_right(&mut self)
pub fn scroll_right(&mut self)
Scroll right one column, never past the widest line.
Sourcepub fn scroll_left(&mut self)
pub fn scroll_left(&mut self)
Scroll left one column, never before the first.
Sourcepub fn scroll_to_top(&mut self)
pub fn scroll_to_top(&mut self)
Jump to the first row (g).
Sourcepub fn scroll_to_bottom(&mut self)
pub fn scroll_to_bottom(&mut self)
Jump to the last row (G).
Trait Implementations§
Source§impl Debug for CommandLogs
impl Debug for CommandLogs
Source§impl Default for CommandLogs
impl Default for CommandLogs
Source§fn default() -> CommandLogs
fn default() -> CommandLogs
Auto Trait Implementations§
impl Freeze for CommandLogs
impl RefUnwindSafe for CommandLogs
impl Send for CommandLogs
impl Sync for CommandLogs
impl Unpin for CommandLogs
impl UnsafeUnpin for CommandLogs
impl UnwindSafe for CommandLogs
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
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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