pub trait LogStore {
// Required methods
fn add_log(
&self,
log_id: &str,
log_source: Arc<Box<dyn LogSource + Send + Sync>>,
format: Option<&String>,
enabled: bool,
);
fn add_line(&self, log_id: &str, line: &str);
fn add_lines(&self, log_id: &str, lines: &[String]) -> Range<usize>;
fn get_format(&self, log_id: &str) -> Option<String>;
fn get_logs(&self) -> Vec<(bool, String, Option<String>)>;
fn get_source(
&self,
id: &str,
) -> Option<Arc<Box<dyn LogSource + Send + Sync>>>;
fn get_lines(&self, log_id: &str) -> Vec<String>;
fn extract_lines(&self, log_id: &str) -> Vec<String>;
fn get_total_lines(&self) -> usize;
fn toggle_log(&self, log_id: &str);
}Expand description
Store holding raw information
Manages raw lines and associated format
Required Methods§
Sourcefn add_log(
&self,
log_id: &str,
log_source: Arc<Box<dyn LogSource + Send + Sync>>,
format: Option<&String>,
enabled: bool,
)
fn add_log( &self, log_id: &str, log_source: Arc<Box<dyn LogSource + Send + Sync>>, format: Option<&String>, enabled: bool, )
Add a new log to the store
Sourcefn add_lines(&self, log_id: &str, lines: &[String]) -> Range<usize>
fn add_lines(&self, log_id: &str, lines: &[String]) -> Range<usize>
Add a many lines to the given log id
Sourcefn get_format(&self, log_id: &str) -> Option<String>
fn get_format(&self, log_id: &str) -> Option<String>
Get the format associated to the given log id
Sourcefn get_logs(&self) -> Vec<(bool, String, Option<String>)>
fn get_logs(&self) -> Vec<(bool, String, Option<String>)>
Get a list of (enabled, log_id, format(if any))
Sourcefn get_source(&self, id: &str) -> Option<Arc<Box<dyn LogSource + Send + Sync>>>
fn get_source(&self, id: &str) -> Option<Arc<Box<dyn LogSource + Send + Sync>>>
Get the log source associated to the log id
Sourcefn get_lines(&self, log_id: &str) -> Vec<String>
fn get_lines(&self, log_id: &str) -> Vec<String>
Get a list of all the lines for the requested log. WARNING: clones
Sourcefn extract_lines(&self, log_id: &str) -> Vec<String>
fn extract_lines(&self, log_id: &str) -> Vec<String>
Get a list of all the lines for the requested log. WARNING: moves
Sourcefn get_total_lines(&self) -> usize
fn get_total_lines(&self) -> usize
Get the count of all the lines
Sourcefn toggle_log(&self, log_id: &str)
fn toggle_log(&self, log_id: &str)
Change the enabled state of the given log
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".