Struct App

Source
pub struct App {
Show 26 fields pub log_analyzer: Box<Arc<dyn LogAnalyzer>>, pub color: Color, pub selected_module: Module, pub show_source_popup: bool, pub show_filter_popup: bool, pub show_error_message: bool, pub show_navigation_popup: bool, pub show_log_options_popup: bool, pub input_buffers: Vec<Input>, pub input_buffer_index: usize, pub formats: StatefulList<String>, pub source_type: usize, pub filter_type: usize, pub filter_color: usize, pub sources: StatefulTable<(bool, String, Option<String>)>, pub filters: StatefulTable<(bool, String)>, pub log_lines: LazyStatefulTable<LogLine>, pub search_lines: LazyStatefulTable<LogLineStyled>, pub horizontal_offset: usize, pub side_main_size_percentage: u16, pub log_filter_size_percentage: u16, pub log_search_size_percentage: u16, pub log_columns: Vec<(String, bool)>, pub auto_scroll: bool, pub popup: PopupInteraction, pub processing: Processing, /* private fields */
}
Expand description

This struct holds the current state of the app. In particular, it has the items field which is a wrapper around ListState. Keeping track of the items state let us render the associated widget with its state and have access to features such as natural scrolling.

Fields§

§log_analyzer: Box<Arc<dyn LogAnalyzer>>

Api to the backend processor

§color: Color

Primary color

§selected_module: Module

Currently selected module. Used to manage inputs and highlight focus

§show_source_popup: bool

Display the new source popup

§show_filter_popup: bool

Display the new filter popup

§show_error_message: bool

Display an error message

§show_navigation_popup: bool

Display the navigation popup

§show_log_options_popup: bool

Display the navigation popup

§input_buffers: Vec<Input>

Vector of user input. Entries are uniquely assigned to each UI input, and the selection is performed with the input_buffer_index

§input_buffer_index: usize

Currently selected input buffer

§formats: StatefulList<String>

Stateful list of all the current formats to be displayed in the source popup

§source_type: usize

Tab selector index for Source Type

§filter_type: usize

Tab selector index for Filter Type

§filter_color: usize

Tab selector index for Filter Type

§sources: StatefulTable<(bool, String, Option<String>)>§filters: StatefulTable<(bool, String)>§log_lines: LazyStatefulTable<LogLine>

Lazy widget for the main view of the logs

§search_lines: LazyStatefulTable<LogLineStyled>

Lazy widget for the main view of the search

§horizontal_offset: usize

Apply an offset to the logs to simulate horizontal scrolling

§side_main_size_percentage: u16

Resizing of the side_menu to the main view

§log_filter_size_percentage: u16

Resizing on the side_menu between sources and filters

§log_search_size_percentage: u16

Resizing on the main view between logs and searchs

§log_columns: Vec<(String, bool)>

Active log columns to display in the log and the search

§auto_scroll: bool

Auto scroll to the last receive elements. Used for live logs

§popup: PopupInteraction

Manage the popup interaction

§processing: Processing

Manage the processing popup

Implementations§

Source§

impl App

Source

pub async fn new( log_analyzer: Box<Arc<dyn LogAnalyzer>>, primary_color: Color, ) -> App

Source

pub async fn add_log(&mut self) -> Result<()>

Source

pub async fn update_formats(&mut self)

Source

pub async fn update_sources(&mut self)

Source

pub async fn update_filters(&mut self)

Source

pub async fn on_tick(&mut self)

Source

pub async fn handle_input(&mut self, key: KeyEvent)

Source

pub fn navigate(&mut self, direction: KeyCode)

Source

pub fn get_column_lenght(&self, column: &str) -> u16

Auto Trait Implementations§

§

impl Freeze for App

§

impl !RefUnwindSafe for App

§

impl !Send for App

§

impl !Sync for App

§

impl Unpin for App

§

impl !UnwindSafe for App

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more