Struct tendermint_light_client::store::sled::utils::HeightIndexedDb
source · pub struct HeightIndexedDb<V> { /* private fields */ }
Available on crate feature
lightstore-sled
only.Expand description
Provides a view over the database for storing key/value pairs at the given prefix.
Implementations§
source§impl<V> HeightIndexedDb<V>
impl<V> HeightIndexedDb<V>
source§impl<V> HeightIndexedDb<V>where
V: Serialize + DeserializeOwned,
impl<V> HeightIndexedDb<V>where
V: Serialize + DeserializeOwned,
sourcepub fn get(&self, height: Height) -> Result<Option<V>, Error>
pub fn get(&self, height: Height) -> Result<Option<V>, Error>
Get the value associated with the given height within this tree
sourcepub fn contains_key(&self, height: Height) -> Result<bool, Error>
pub fn contains_key(&self, height: Height) -> Result<bool, Error>
Check whether there exists a value associated with the given height within this tree
sourcepub fn insert(&self, height: Height, value: &V) -> Result<(), Error>
pub fn insert(&self, height: Height, value: &V) -> Result<(), Error>
Insert a value associated with a height within this tree
sourcepub fn remove(&self, height: Height) -> Result<(), Error>
pub fn remove(&self, height: Height) -> Result<(), Error>
Remove the value associated with a height within this tree
sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = V>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = V>
Return an iterator over all values within this tree
sourcepub fn range<R>(&self, range: R) -> impl DoubleEndedIterator<Item = V>where
R: RangeBounds<Height>,
pub fn range<R>(&self, range: R) -> impl DoubleEndedIterator<Item = V>where
R: RangeBounds<Height>,
Return an iterator over the given range
Trait Implementations§
source§impl<V: Clone> Clone for HeightIndexedDb<V>
impl<V: Clone> Clone for HeightIndexedDb<V>
source§fn clone(&self) -> HeightIndexedDb<V>
fn clone(&self) -> HeightIndexedDb<V>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<V> Freeze for HeightIndexedDb<V>
impl<V> !RefUnwindSafe for HeightIndexedDb<V>
impl<V> Send for HeightIndexedDb<V>where
V: Send,
impl<V> Sync for HeightIndexedDb<V>where
V: Sync,
impl<V> Unpin for HeightIndexedDb<V>where
V: Unpin,
impl<V> !UnwindSafe for HeightIndexedDb<V>
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