pub struct ChildReference {
pub key: Vec<u8>,
pub lsn: Lsn,
pub state: SlotState,
}Expand description
A reference in the tree from parent to child.
Contains a key, LSN (on-disk location), and state byte for tracking deletion and dirty status. This structure is used primarily for the tree root reference, though in it’s also used within IN slot arrays.
In the Noxu DB Rust port, individual IN/BIN slot storage is separate from ChildReference, but the concepts are similar.
Fields§
§key: Vec<u8>The key identifying this child in the parent’s key range.
lsn: LsnThe LSN of the child node on disk, or NULL_LSN if not yet logged.
state: SlotStateState flags for this reference (dirty, known-deleted, etc.).
Implementations§
Source§impl ChildReference
impl ChildReference
Sourcepub fn new(key: Vec<u8>, lsn: Lsn, state: SlotState) -> Self
pub fn new(key: Vec<u8>, lsn: Lsn, state: SlotState) -> Self
Creates a new ChildReference.
§Arguments
key- The key identifying this childlsn- The LSN of the child node on diskstate- Initial state flags
Sourcepub fn new_with_key_and_lsn(key: Vec<u8>, lsn: Lsn) -> Self
pub fn new_with_key_and_lsn(key: Vec<u8>, lsn: Lsn) -> Self
Creates a new ChildReference with empty state.
§Arguments
key- The key identifying this childlsn- The LSN of the child node on disk
Sourcepub fn is_known_deleted(&self) -> bool
pub fn is_known_deleted(&self) -> bool
Returns true if the known-deleted flag is set.
Sourcepub fn set_known_deleted(&mut self)
pub fn set_known_deleted(&mut self)
Sets the known-deleted flag.
Sourcepub fn clear_known_deleted(&mut self)
pub fn clear_known_deleted(&mut self)
Clears the known-deleted flag.
Sourcepub fn is_pending_deleted(&self) -> bool
pub fn is_pending_deleted(&self) -> bool
Returns true if the pending-deleted flag is set.
Sourcepub fn set_pending_deleted(&mut self)
pub fn set_pending_deleted(&mut self)
Sets the pending-deleted flag.
Sourcepub fn clear_pending_deleted(&mut self)
pub fn clear_pending_deleted(&mut self)
Clears the pending-deleted flag.
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clears the dirty flag.
Sourcepub fn is_embedded_ln(&self) -> bool
pub fn is_embedded_ln(&self) -> bool
Returns true if the embedded-LN flag is set.
Sourcepub fn set_embedded_ln(&mut self)
pub fn set_embedded_ln(&mut self)
Sets the embedded-LN flag.
Sourcepub fn clear_transient_bits(&mut self)
pub fn clear_transient_bits(&mut self)
Clears all transient state bits (not persisted to disk).
Trait Implementations§
Source§impl Clone for ChildReference
impl Clone for ChildReference
Source§fn clone(&self) -> ChildReference
fn clone(&self) -> ChildReference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more