Struct DB

Source
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

Source

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

Source

pub fn get_all_products(&self) -> Vec<String>

Returns a vector containing the names of all the products that are known to the database.

Source

pub fn get_db_directories(&self) -> Vec<PathBuf>

Returns the paths to the system and (optionally if one exists) user databases

Source

pub fn product_versions(&self, product: &String) -> Vec<String>

Produces a vector of all the versions of the specified product

Source

pub fn product_tags(&self, product: &String) -> Vec<String>

Outputs a vector of all tags corresponding to the specified product

Source

pub fn get_table_from_version( &self, product: &String, version: &String, ) -> Option<Table>

Looks up the table corresponding to the product, version combination specified.

Source

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

Source

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

Source

pub fn get_table_from_tag( &self, product: &String, tag: Vec<&String>, ) -> Option<Table>

Looks up a table file given a product and tag

Source

pub fn has_product(&self, product: &String) -> bool

Look up if a given product exists in the database

Trait Implementations§

Source§

impl Debug for DB

Describes how the db will be shown when written in a formatted

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for DB

§

impl !RefUnwindSafe for DB

§

impl Send for DB

§

impl !Sync for DB

§

impl Unpin for DB

§

impl UnwindSafe for DB

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.