[−][src]Struct dino::Tree
The struct that allows you to create sub trees in the main tree in the database Sub trees do not auto insert in the main tree of the database You can do that by doing
Example
// Create the database instance let mut db = Database::new("./hello.dino"); // Load and create the database if does not exist db.load(); // Create a new sub Tree in the main Tree of the db let mut data_tree = Tree::new(); // Insert the [data_tree] under the main tree db.insert_tree("id", data_tree);
Where the key always need to be a String
Implementations
impl Tree
[src]
pub fn new() -> Tree
[src]
Create a new sub tree
pub fn from(value: &str) -> Tree
[src]
Create a new Tree from String value
pub fn insert(&mut self, key: &str, value: &str)
[src]
Insert data with String value type in the sub tree
pub fn insert_number(&mut self, key: &str, value: usize)
[src]
Insert data with usize value type in the sub tree
pub fn len(&mut self) -> usize
[src]
Return the length of items that are in the sub tree
pub fn remove(&mut self, key: &str)
[src]
Remove a key in the sub tree in the database with its value
pub fn find(&self, key: &str) -> Result<Value, String>
[src]
Find a value in the sub tree in the database
pub fn contains_key(&mut self, key: &str) -> bool
[src]
Check if the key exists in the sub tree of the main database
pub fn insert_tree(&mut self, key: &str, value: Tree)
[src]
Insert a key with a subtree in the subtree!
Trait Implementations
impl Debug for Tree
[src]
impl Display for Tree
[src]
impl Display for Tree So we can print the tree to the display
Auto Trait Implementations
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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>,