Trait sanakirja::btree::BTreeMutPage [−][src]
Associated Types
Loading content...Required methods
pub fn init(page: &mut MutPage)
[src]
Initialise a page.
pub fn put<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
replace: bool,
c: &Self::Cursor,
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]
txn: &mut T,
page: CowPage,
mutable: bool,
replace: bool,
c: &Self::Cursor,
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,
Add an entry to the page, possibly splitting the page in the process.
Makes the assumption that k1v1.is_some()
implies
replace
. The “double insertion” is only ever used when
deleting, and when the right child of a deleted entry (in an
internal node) has split while we were looking for a
replacement for the deleted entry.
Since we only look for replacements in the right child, the
left child of the insertion isn’t modified, in which case l
and r
are interpreted as the left and right child of the new
entry, k1v1
.
pub fn update_left_child<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &Self::Cursor,
r: u64
) -> Result<Ok, <T as LoadPage>::Error> where
T: AllocPage,
[src]
txn: &mut T,
page: CowPage,
mutable: bool,
c: &Self::Cursor,
r: u64
) -> Result<Ok, <T as LoadPage>::Error> where
T: AllocPage,
Update the left child of the position pointed to by the cursor.
pub fn save_deleted_leaf_entry(k: &K, v: &V) -> Self::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.
pub unsafe fn from_saved<'a>(s: &Self::Saved) -> (&'a K, &'a V)
[src]
Recover the saved value.
pub fn del<T>(
txn: &mut T,
page: CowPage,
mutable: bool,
c: &Self::Cursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
[src]
txn: &mut T,
page: CowPage,
mutable: bool,
c: &Self::Cursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
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).
pub fn merge_or_rebalance<T>(
txn: &mut T,
m: Concat<'a, K, V, Self>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
[src]
txn: &mut T,
m: Concat<'a, K, V, Self>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
Merge, rebalance or update a concatenation.
Provided methods
pub unsafe fn put_mut(
page: &mut MutPage,
c: &Self::Cursor,
k0: &K,
v0: &V,
r: u64
)
[src]
page: &mut MutPage,
c: &Self::Cursor,
k0: &K,
v0: &V,
r: u64
)
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.
pub unsafe fn set_left_child(page: &mut MutPage, c: &Self::Cursor, l: u64)
[src]
Implementors
impl<K, V> BTreeMutPage<K, V> for sanakirja::btree::page::Page<K, V> where
K: Storable + Debug,
V: Storable + Debug,
[src]
K: Storable + Debug,
V: Storable + Debug,
pub fn init(page: &mut MutPage)
[src]
type Saved = (K, V)
pub fn save_deleted_leaf_entry(
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
[src]
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
pub unsafe fn from_saved<'a>(
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
[src]
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
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]
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,
pub unsafe fn put_mut(
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
[src]
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
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]
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,
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]
txn: &mut T,
page: CowPage,
mutable: bool,
c: &PageCursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
pub fn merge_or_rebalance<T>(
txn: &mut T,
m: Concat<'a, K, V, Page<K, V>>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
[src]
txn: &mut T,
m: Concat<'a, K, V, Page<K, V>>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
impl<K, V> BTreeMutPage<K, V> for sanakirja::btree::page_unsized::Page<K, V> where
K: UnsizedStorable + Debug + ?Sized,
V: UnsizedStorable + Debug + ?Sized,
[src]
K: UnsizedStorable + Debug + ?Sized,
V: UnsizedStorable + Debug + ?Sized,
pub fn init(page: &mut MutPage)
[src]
type Saved = (*const K, *const V)
pub fn save_deleted_leaf_entry(
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
[src]
k: &K,
v: &V
) -> <Page<K, V> as BTreeMutPage<K, V>>::Saved
pub unsafe fn from_saved<'a>(
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
[src]
s: &<Page<K, V> as BTreeMutPage<K, V>>::Saved
) -> (&'a K, &'a V)
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]
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,
pub unsafe fn put_mut(
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
[src]
page: &mut MutPage,
c: &<Page<K, V> as BTreePage<K, V>>::Cursor,
k0: &K,
v0: &V,
r: u64
)
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]
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,
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]
txn: &mut T,
page: CowPage,
mutable: bool,
c: &PageCursor,
l: u64
) -> Result<(MutPage, u64), <T as LoadPage>::Error> where
T: AllocPage,
pub fn merge_or_rebalance<T>(
txn: &mut T,
m: Concat<'a, K, V, Page<K, V>>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,
[src]
txn: &mut T,
m: Concat<'a, K, V, Page<K, V>>
) -> Result<Op<'a, T, K, V>, <T as LoadPage>::Error> where
T: AllocPage,