pub struct LogViewerState {
pub content: Vec<String>,
pub scroll_y: usize,
pub scroll_x: usize,
pub visible_height: usize,
pub visible_width: usize,
pub search: SearchState,
}Expand description
State for the log viewer widget
Fields§
§content: Vec<String>Content lines
scroll_y: usizeVertical scroll position
scroll_x: usizeHorizontal scroll position
visible_height: usizeVisible viewport height (set during render)
visible_width: usizeVisible viewport width (set during render)
search: SearchStateSearch state
Implementations§
Source§impl LogViewerState
impl LogViewerState
Sourcepub fn set_content(&mut self, content: Vec<String>)
pub fn set_content(&mut self, content: Vec<String>)
Set content
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down by one line
Sourcepub fn scroll_left(&mut self)
pub fn scroll_left(&mut self)
Scroll left
Sourcepub fn scroll_right(&mut self)
pub fn scroll_right(&mut self)
Scroll right
Sourcepub fn go_to_bottom(&mut self)
pub fn go_to_bottom(&mut self)
Go to bottom
Sourcepub fn go_to_line(&mut self, line: usize)
pub fn go_to_line(&mut self, line: usize)
Go to a specific line (0-indexed)
Sourcepub fn start_search(&mut self)
pub fn start_search(&mut self)
Start search mode
Sourcepub fn cancel_search(&mut self)
pub fn cancel_search(&mut self)
Cancel search mode
Sourcepub fn update_search(&mut self)
pub fn update_search(&mut self)
Update search with new query
Sourcepub fn next_match(&mut self)
pub fn next_match(&mut self)
Go to next search match
Sourcepub fn prev_match(&mut self)
pub fn prev_match(&mut self)
Go to previous search match
Trait Implementations§
Source§impl Clone for LogViewerState
impl Clone for LogViewerState
Source§fn clone(&self) -> LogViewerState
fn clone(&self) -> LogViewerState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LogViewerState
impl RefUnwindSafe for LogViewerState
impl Send for LogViewerState
impl Sync for LogViewerState
impl Unpin for LogViewerState
impl UnwindSafe for LogViewerState
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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