pub struct DbTree {
pub tree: Tree,
}
Expand description
DbTree is a wrapper around the sled::Tree type providing convenience functions
Fields§
§tree: Tree
Implementations§
Source§impl DbTree
impl DbTree
pub fn open(db: &Db, tree: DbTrees<'_>) -> Result<Arc<Self>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter
pub fn contains_key<K: AsRef<[u8]>>(&self, key: K) -> Result<bool>
pub fn flush(&self) -> Result<usize>
pub fn apply_batch(&self, batch: &mut DbBatch) -> Result<()>
pub fn insert<T>(&self, value: &T) -> Result<Option<IVec>>where
T: BorshSerialize + DbKey,
pub fn get<K: AsRef<[u8]>>(&self, key: K) -> Result<Option<IVec>>
pub fn deserialize<K: AsRef<[u8]>, T>(&self, key: K) -> Result<T>where
T: BorshDeserialize,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DbTree
impl !RefUnwindSafe for DbTree
impl Send for DbTree
impl Sync for DbTree
impl Unpin for DbTree
impl !UnwindSafe for DbTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more