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§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable adapter name, used as the agent field and the config key.
Sourcefn is_implemented(&self) -> bool
fn is_implemented(&self) -> bool
Whether this adapter is implemented at all.
Sourcefn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
KPIs this adapter can populate.
Sourcefn root(&self, config: &Config) -> Option<PathBuf>
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.
Sourcefn discover(&self, root: &Path) -> Result<Vec<PathBuf>>
fn discover(&self, root: &Path) -> Result<Vec<PathBuf>>
Transcript files under root, in a deterministic order. Read-only.
Sourcefn session_count(&self, root: &Path) -> Result<usize>
fn session_count(&self, root: &Path) -> Result<usize>
Number of distinct sessions visible under root, for doctor.
Sourcefn parse_line(&self, source: &Path, line: &str) -> Parsed
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".