Struct sanakirja::btree::page::Page [−][src]
pub struct Page<K, V> { /* fields omitted */ }
Expand description
Empty type implementing BTreePage
and BTreeMutPage
.
Trait Implementations
impl<K, V> BTreeMutPage<K, V> for Page<K, V> where
K: Storable + Debug,
V: Storable + Debug,
[src]
impl<K, V> BTreeMutPage<K, V> for Page<K, V> where
K: Storable + Debug,
V: Storable + Debug,
[src]type Saved = (K, V)
pub fn save_deleted_leaf_entry(
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
[src]
pub fn save_deleted_leaf_entry(
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
[src]Save a leaf entry as a replacement, when we delete at an internal node. This can be a pointer to the leaf if the leaf isn’t mutated, or the actual value, or something else. Read more
pub unsafe fn from_saved<'a>(
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
[src]
pub unsafe fn from_saved<'a>(
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
[src]Recover the saved value.
pub fn put<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
replace: bool,
c: &PageCursor,
k0: &'a K,
v0: &'a V,
k1v1: Option<(&'a K, &'a V)>,
l: u64,
r: u64
) -> Result<Put<'a, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
[src]
pub fn put<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
replace: bool,
c: &PageCursor,
k0: &'a K,
v0: &'a V,
k1v1: Option<(&'a K, &'a V)>,
l: u64,
r: u64
) -> Result<Put<'a, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
[src]Add an entry to the page, possibly splitting the page in the process. Read more
pub unsafe fn put_mut(
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
[src]
pub unsafe fn put_mut(
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
[src]Add an entry to page
, at position c
. Does not check
whether there is enough space to do so. This method is mostly
useful for cloning pages. Read more
pub unsafe fn set_left_child(
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
l: u64
)
[src]
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
l: u64
)
pub fn update_left_child<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
l: u64
) -> Result<Ok, <T as LoadPage>::Error> where
T: AllocPage,
[src]
pub fn update_left_child<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
l: u64
) -> Result<Ok, <T as LoadPage>::Error> where
T: AllocPage,
[src]Update the left child of the position pointed to by the cursor. Read more
pub fn del<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &PageCursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
[src]
pub fn del<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &PageCursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
[src]Delete an entry on the page, returning the resuting page along
with the offset of the freed page (or 0 if no page was freed,
i.e. if page
is mutable). Read more
impl<K, V> BTreePage<K, V> for Page<K, V> where
K: Storable,
V: Storable,
[src]
impl<K, V> BTreePage<K, V> for 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_empty(c: &<Page<K, V> as BTreePage<K, V>>::Cursor) -> bool
[src]Whether this cursor is at the end of the page.
pub fn is_init(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]Whether this cursor is strictly before the first element.
pub fn cursor_before(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]
pub fn cursor_before(p: &CowPage) -> <Page<K, V> as BTreePage<K, V>>::Cursor
[src]Returns a cursor set before the first element of the page (i.e. set to -1). Read more
pub fn cursor_after(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]Returns a cursor set after the last element of the page (i.e. to element n) Read more
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_next(c: &mut <Page<K, V> as BTreePage<K, V>>::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). Read more
pub fn move_prev(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]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). Read more
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]
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]Returns the current element, if the cursor is pointing at one.
pub fn left_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
pub fn left_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]Returns the left child of the entry pointed to by the cursor.
pub fn right_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]
pub fn right_child(
page: Page<'_>,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor
) -> u64
[src]Returns the right child of the entry pointed to by the cursor.
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]
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]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()
. Read more
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. Read more
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
. Read more
Auto Trait Implementations
impl<K, V> RefUnwindSafe for Page<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Page<K, V> where
K: Send,
V: Send,
K: Send,
V: Send,
impl<K, V> Sync for Page<K, V> where
K: Sync,
V: Sync,
K: Sync,
V: Sync,
impl<K, V> Unpin for Page<K, V> where
K: Unpin,
V: Unpin,
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for Page<K, V> where
K: UnwindSafe,
V: UnwindSafe,
K: UnwindSafe,
V: UnwindSafe,