kts-etl 0.1.12

Extract, transform and load data from your local environment.
Documentation
use std::rc::Rc;

use kts_analyze::FlatTable;

/// The type of information for this provider.
#[derive(PartialEq)]
pub enum Kind {
    Browser,
    Shell,
    ShellCd,
}

/// Metadata about this provider.
pub struct Info {
    pub name: String,
    pub size: usize,
    pub kind: Kind,
}

/// Type of errors, right now keep it simple.
pub type Error = String;

/// Trait to be implemented by all providers.
pub trait Provider {
    // Metadata about the provider.
    fn info(&self) -> &Info;

    // Provider specific (and possibly more efficient) search.
    fn search(&self, term: &str) -> Result<Vec<String>, Error>;

    // Table provider to integrate in bigger pipelines.
    fn flat_table(&self) -> Result<Rc<FlatTable>, Error>;
}