Skip to main content

Adapter

Trait Adapter 

Source
pub trait Adapter {
    // Required methods
    fn name(&self) -> &'static str;
    fn is_implemented(&self) -> bool;
    fn capabilities(&self) -> Capabilities;
    fn root(&self, config: &Config) -> Option<PathBuf>;
    fn discover(&self, root: &Path) -> Result<Vec<PathBuf>>;
    fn session_count(&self, root: &Path) -> Result<usize>;
    fn parse_line(&self, source: &Path, line: &str) -> Parsed;
}
Expand description

A source of events.

Required Methods§

Source

fn name(&self) -> &'static str

Stable adapter name, used as the agent field and the config key.

Source

fn is_implemented(&self) -> bool

Whether this adapter is implemented at all.

Source

fn capabilities(&self) -> Capabilities

KPIs this adapter can populate.

Source

fn root(&self, config: &Config) -> Option<PathBuf>

Log root for this adapter: the configured path, else its built-in default. None when no default can be determined.

Source

fn discover(&self, root: &Path) -> Result<Vec<PathBuf>>

Transcript files under root, in a deterministic order. Read-only.

Source

fn session_count(&self, root: &Path) -> Result<usize>

Number of distinct sessions visible under root, for doctor.

Source

fn parse_line(&self, source: &Path, line: &str) -> Parsed

Parse one line of source.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§