pub struct DB { /* private fields */ }
Expand description
Database object that library consumers interact though. This DB encodes all the relations between products, versions, tags, and tables that are encoded in the filesystem besed database.
Implementations§
source§impl DB
impl DB
sourcepub fn new(
db_path: Option<&str>,
user_tag_root: Option<&str>,
def_stack_root: Option<&str>,
preload: Option<DBLoadControl>
) -> DB
pub fn new(
db_path: Option<&str>,
user_tag_root: Option<&str>,
def_stack_root: Option<&str>,
preload: Option<DBLoadControl>
) -> DB
Creates a new DB object. Optionally takes the path to a system database, a user database, and where the products themselves are located. Another optional argument is a DBLoadControl, which specifies which products are to be preloaded from disk at database creation time. Set the option to None if no products are to be loaded and
sourcepub fn get_all_products(&self) -> Vec<String> ⓘ
pub fn get_all_products(&self) -> Vec<String> ⓘ
Returns a vector containing the names of all the products that are known to the database.
sourcepub fn get_db_directories(&self) -> Vec<PathBuf> ⓘ
pub fn get_db_directories(&self) -> Vec<PathBuf> ⓘ
Returns the paths to the system and (optionally if one exists) user databases
sourcepub fn product_versions(&self, product: &String) -> Vec<String> ⓘ
pub fn product_versions(&self, product: &String) -> Vec<String> ⓘ
Produces a vector of all the versions of the specified product
Outputs a vector of all tags corresponding to the specified product
sourcepub fn get_table_from_version(
&self,
product: &String,
version: &String
) -> Option<Table>
pub fn get_table_from_version(
&self,
product: &String,
version: &String
) -> Option<Table>
Looks up the table corresponding to the product, version combination specified.
sourcepub fn get_flavors_from_version(
&self,
product: &String,
version: &String
) -> Vec<String> ⓘ
pub fn get_flavors_from_version(
&self,
product: &String,
version: &String
) -> Vec<String> ⓘ
Lists the flavors of a product corresponding to a specified product and version
sourcepub fn get_versions_from_tag(
&self,
product: &String,
tag: Vec<&String>
) -> Vec<String> ⓘ
pub fn get_versions_from_tag(
&self,
product: &String,
tag: Vec<&String>
) -> Vec<String> ⓘ
Looks up all the versions which correspond to specified prodcut and tag
sourcepub fn get_table_from_tag(
&self,
product: &String,
tag: Vec<&String>
) -> Option<Table>
pub fn get_table_from_tag(
&self,
product: &String,
tag: Vec<&String>
) -> Option<Table>
Looks up a table file given a product and tag
sourcepub fn has_product(&self, product: &String) -> bool
pub fn has_product(&self, product: &String) -> bool
Look up if a given product exists in the database