Struct sanakirja_core::btree::Cursor [−][src]
A position in a B tree.
Implementations
impl<K: ?Sized + Storable, V: ?Sized + Storable, P: BTreePage<K, V>> Cursor<K, V, P>
[src]
pub fn new<T: LoadPage>(txn: &T, db: &Db_<K, V, P>) -> Result<Self, T::Error>
[src]
Create a new cursor, initialised to the first entry of the B tree.
pub fn reset<'a, T: LoadPage>(&mut self)
[src]
Reset the cursor to the first element of the database.
pub fn set<'a, T: LoadPage>(
&mut self,
txn: &'a T,
k: &K,
v: Option<&V>
) -> Result<Option<(&'a K, &'a V)>, T::Error>
[src]
&mut self,
txn: &'a T,
k: &K,
v: Option<&V>
) -> Result<Option<(&'a K, &'a V)>, T::Error>
Set the cursor to the first position larger than or equal to the specified key and value.
pub fn set_last<'a, T: LoadPage>(&mut self, txn: &'a T) -> Result<(), T::Error>
[src]
Set the cursor after the last element, so that Self::next
returns None
, and Self::prev
returns the last element.
pub fn current<'a, T: LoadPage>(
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
[src]
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
Return the current position of the cursor.
pub fn next<'a, T: LoadPage>(
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
[src]
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
Return the current position of the cursor, and move the cursor to the next position.
pub fn prev<'a, T: LoadPage>(
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
[src]
&mut self,
txn: &'a T
) -> Result<Option<(&'a K, &'a V)>, T::Error>
Move the cursor to the previous entry, and return the current entry. If the cursor is initially after all the entries, this moves it back by two steps.
Trait Implementations
impl<K: Debug + ?Sized, V: Debug + ?Sized, P: Debug + BTreePage<K, V>> Debug for Cursor<K, V, P>
[src]
Auto Trait Implementations
impl<K, V, P> !Send for Cursor<K, V, P>
impl<K, V, P> !Sync for Cursor<K, V, P>
impl<K: ?Sized, V: ?Sized, P> Unpin for Cursor<K, V, P> where
<P as BTreePage<K, V>>::Cursor: Unpin,
<P as BTreePage<K, V>>::Cursor: Unpin,
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, 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>,