Trait sanakirja::btree::BTreePage [−][src]
pub trait BTreePage<K, V> where
K: ?Sized,
V: ?Sized, { type Cursor: Clone + Copy + Debug;}Show methods
fn is_empty(c: &Self::Cursor) -> bool; fn is_init(c: &Self::Cursor) -> bool; fn cursor_before(p: &CowPage) -> Self::Cursor; fn cursor_after(p: &CowPage) -> Self::Cursor; fn move_next(c: &mut Self::Cursor) -> bool; fn move_prev(c: &mut Self::Cursor) -> bool; fn current<T>(
txn: &T,
p: Page<'a>,
c: &Self::Cursor
) -> Option<(&'a K, &'a V, u64)>
where
T: LoadPage; fn left_child(p: Page<'_>, c: &Self::Cursor) -> u64; fn right_child(p: Page<'_>, c: &Self::Cursor) -> u64; fn set_cursor<T>(
txn: &'a T,
page: Page<'_>,
c: &mut Self::Cursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize>
where
T: LoadPage; fn split_at(c: &Self::Cursor) -> (Self::Cursor, Self::Cursor); fn cursor_first(p: &CowPage) -> Self::Cursor { ... } fn cursor_last(p: &CowPage) -> Self::Cursor { ... } fn next<T>(
txn: &T,
p: Page<'b>,
c: &mut Self::Cursor
) -> Option<(&'b K, &'b V, u64)>
where
T: LoadPage, { ... } fn prev<T>(
txn: &T,
p: Page<'b>,
c: &mut Self::Cursor
) -> Option<(&'b K, &'b V, u64)>
where
T: LoadPage, { ... }
Associated Types
Required methods
fn cursor_before(p: &CowPage) -> Self::Cursor
[src]
fn cursor_before(p: &CowPage) -> Self::Cursor
[src]Returns a cursor set before the first element of the page (i.e. set to -1).
fn cursor_after(p: &CowPage) -> Self::Cursor
[src]
fn cursor_after(p: &CowPage) -> Self::Cursor
[src]Returns a cursor set after the last element of the page (i.e. to element n)
fn move_next(c: &mut Self::Cursor) -> bool
[src]
fn move_next(c: &mut Self::Cursor) -> bool
[src]Move the cursor to the next position. Returns whether the
cursor was actually moved (i.e. true
if and only if the
cursor isn’t already after the last element).
fn move_prev(c: &mut Self::Cursor) -> bool
[src]
fn move_prev(c: &mut Self::Cursor) -> bool
[src]Move the cursor to the previous position. Returns whether the
cursor was actually moved (i.e. true
if and only if the
cursor isn’t strictly before the page).
fn current<T>(
txn: &T,
p: Page<'a>,
c: &Self::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
[src]
fn current<T>(
txn: &T,
p: Page<'a>,
c: &Self::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
[src]Returns the current element, if the cursor is pointing at one.
fn left_child(p: Page<'_>, c: &Self::Cursor) -> u64
[src]
fn left_child(p: Page<'_>, c: &Self::Cursor) -> u64
[src]Returns the left child of the entry pointed to by the cursor.
fn right_child(p: Page<'_>, c: &Self::Cursor) -> u64
[src]
fn right_child(p: Page<'_>, c: &Self::Cursor) -> u64
[src]Returns the right child of the entry pointed to by the cursor.
fn set_cursor<T>(
txn: &'a T,
page: Page<'_>,
c: &mut Self::Cursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,
[src]
fn set_cursor<T>(
txn: &'a T,
page: Page<'_>,
c: &mut Self::Cursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,
[src]Sets the cursor to the last element less than or equal to k0
if v0.is_none()
, and to (k0, v0)
if v0.is_some()
.
fn split_at(c: &Self::Cursor) -> (Self::Cursor, Self::Cursor)
[src]
Provided methods
fn cursor_first(p: &CowPage) -> Self::Cursor
[src]
fn cursor_first(p: &CowPage) -> Self::Cursor
[src]Returns a cursor set to the first element of the page (i.e. 0). If the page is empty, the returned cursor might be empty.
fn cursor_last(p: &CowPage) -> Self::Cursor
[src]
fn cursor_last(p: &CowPage) -> Self::Cursor
[src]Returns a cursor set to the last element of the page. If the
cursor is empty, this is the same as cursor_before
.
Implementors
impl<K, V> BTreePage<K, V> for sanakirja::btree::page::Page<K, V> where
K: Storable,
V: Storable,
[src]
impl<K, V> BTreePage<K, V> for sanakirja::btree::page::Page<K, V> where
K: Storable,
V: Storable,
[src]type Cursor = PageCursor
pub fn is_empty(c: &<Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn is_init(c: &<Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn cursor_before(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]
pub fn cursor_after(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]
pub fn split_at(
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> (<Page<K, V> as BTreePage<K, V>>::Cursor, <Page<K, V> as BTreePage<K, V>>::Cursor)
[src]
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> (<Page<K, V> as BTreePage<K, V>>::Cursor, <Page<K, V> as BTreePage<K, V>>::Cursor)
pub fn move_next(c: &mut <Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn move_prev(c: &mut <Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn current<T>(
_txn: &T,
page: Page<'a>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
[src]
_txn: &T,
page: Page<'a>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
pub fn left_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
pub fn right_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
pub fn set_cursor<T>(
txn: &'a T,
page: Page<'_>,
c: &mut PageCursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,
[src]
txn: &'a T,
page: Page<'_>,
c: &mut PageCursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,
impl<K, V> BTreePage<K, V> for sanakirja::btree::page_unsized::Page<K, V> where
K: UnsizedStorable + ?Sized,
V: UnsizedStorable + ?Sized,
[src]
impl<K, V> BTreePage<K, V> for sanakirja::btree::page_unsized::Page<K, V> where
K: UnsizedStorable + ?Sized,
V: UnsizedStorable + ?Sized,
[src]pub fn is_empty(c: &<Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn is_init(c: &<Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
type Cursor = PageCursor
pub fn cursor_before(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]
pub fn cursor_after(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]
pub fn split_at(
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> (<Page<K, V> as BTreePage<K, V>>::Cursor, <Page<K, V> as BTreePage<K, V>>::Cursor)
[src]
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> (<Page<K, V> as BTreePage<K, V>>::Cursor, <Page<K, V> as BTreePage<K, V>>::Cursor)
pub fn move_next(c: &mut <Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn move_prev(c: &mut <Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]
pub fn current<T>(
txn: &T,
page: Page<'a>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
[src]
txn: &T,
page: Page<'a>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> Option<(&'a K, &'a V, u64)> where
T: LoadPage,
pub fn left_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
pub fn right_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
pub fn set_cursor<T>(
txn: &'a T,
page: Page<'_>,
c: &mut PageCursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,
[src]
txn: &'a T,
page: Page<'_>,
c: &mut PageCursor,
k0: &K,
v0: Option<&V>
) -> Result<(&'a K, &'a V, u64), usize> where
T: LoadPage,