Struct sanakirja_core::btree::Cursor[][src]

pub struct Cursor<K: ?Sized, V: ?Sized, P: BTreePage<K, V>> { /* fields omitted */ }

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]

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]

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]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.