pub struct MapLn { /* private fields */ }Expand description
A MapLN maps a database ID to its configuration and state.
It lives in the database mapping tree (DbTree). Each MapLN holds:
- An underlying LN containing serialized database configuration
- A database ID
- Deleted flag (soft delete marker)
- Transient flag (for temporary databases)
Implementations§
Source§impl MapLn
impl MapLn
Sourcepub fn new(db_id: u64, config_data: Vec<u8>) -> Self
pub fn new(db_id: u64, config_data: Vec<u8>) -> Self
Creates a new MapLN for the given database ID with configuration data.
§Arguments
db_id- The database IDconfig_data- Serialized database configuration
Sourcepub fn is_deleted(&self) -> bool
pub fn is_deleted(&self) -> bool
Returns true if the database is marked as deleted.
Sourcepub fn set_deleted(&mut self, deleted: bool)
pub fn set_deleted(&mut self, deleted: bool)
Sets the deleted flag.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns true if the database is transient (temporary).
Sourcepub fn set_transient(&mut self, transient: bool)
pub fn set_transient(&mut self, transient: bool)
Sets the transient flag.
Sourcepub fn get_ln_mut(&mut self) -> &mut Ln
pub fn get_ln_mut(&mut self) -> &mut Ln
Returns a mutable reference to the underlying LN.
Sourcepub fn write_to_log(&self, buf: &mut Vec<u8>)
pub fn write_to_log(&self, buf: &mut Vec<u8>)
Writes this MapLN to a byte buffer.
Sourcepub fn read_from_log(buf: &[u8]) -> Result<Self>
pub fn read_from_log(buf: &[u8]) -> Result<Self>
Reads a MapLN from a byte buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MapLn
impl RefUnwindSafe for MapLn
impl Send for MapLn
impl Sync for MapLn
impl Unpin for MapLn
impl UnsafeUnpin for MapLn
impl UnwindSafe for MapLn
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more