Trait below_view::stats_view::ViewBridge [−][src]
pub trait ViewBridge {
type StateType: Default + StateCommon;
fn get_view_name() -> &'static str;
fn get_title_vec(&self) -> Vec<String>ⓘ;
fn get_rows(
&mut self,
state: &Self::StateType,
offset: Option<usize>
) -> Vec<(StyledString, String)>ⓘ;
}
Expand description
ViewBridge defines how a ConcreteView will relate to StatsView
Associated Types
type StateType: Default + StateCommon
Required methods
fn get_view_name() -> &'static str
fn get_view_name() -> &'static str
Return the name of the view, this function will help StatsView to query view by name.
Return a vec of the view column names or title. This function will
call the below_derive trait get_title_piped
function and split by ‘|’.
We cannot default implement this function since below_derive
is not a trait.
The essential function that defines how a StatsView should fill the data. This function will iterate through the data, apply filter and sorting, return a Vec of (Stats String Line, Key) tuple.
Arguments
state
: The concrete view stateoffset
: Indicates how many columns we should pass after the first column when generating a line.