[−][src]Struct dino::Database
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
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,