[][src]Struct dino::Database

pub struct Database {
    pub path: String,
    // some fields omitted
}

The main struct of Dino. The Database struct is responsible for creating the storage instance that will store this database's documents, managing the database tables as well as providing access to the default table.

Fields

path: String

The path of the file in a String format

Implementations

impl Database[src]

pub fn new(path: &str) -> Database[src]

Create a new instance of the Database

pub fn load(&mut self)[src]

Load the database from the file and initialize variables

pub fn insert_tree(&self, key: &str, value: Tree)[src]

Insert a key with a subtree in the database

pub fn insert(&self, key: &str, value: &str)[src]

Insert a key and a value in the database

pub fn insert_number(&self, key: &str, value: usize)[src]

Insert a key and a value in the database

pub fn remove(&self, key: &str)[src]

Remove a key in the database with its value

pub fn find(&self, key: &str) -> Result<Value, String>[src]

Find a value in the db

pub fn contains_key(&self, key: &str) -> bool[src]

Check if the key exists in the database

pub fn len(&self) -> usize[src]

Return the length of items that are in the main tree

Trait Implementations

impl Display for Database[src]

impl Display for database So we can print the whole tree to the display

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.