MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / borrow_first

Method borrow_first

rust/src/node.rs:470–475  ·  view source on GitHub ↗

Borrow the first key-value pair from this leaf (used when this is the right sibling)

(&mut self)

Source from the content-addressed store, hash-verified

468
469 /// Borrow the first key-value pair from this leaf (used when this is the right sibling)
470 pub fn borrow_first(&mut self) -> Option<(K, V)> {
471 if self.keys.is_empty() || !self.can_donate() {
472 return None;
473 }
474 Some((self.keys.remove(0), self.values.remove(0)))
475 }
476
477 /// Accept a borrowed key-value pair at the beginning (from left sibling)
478 pub fn accept_from_left(&mut self, key: K, value: V) {

Calls 3

is_emptyMethod · 0.45
can_donateMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected