pub struct WalRecord {
pub lsn: LogSequenceNumber,
pub prev_lsn: LogSequenceNumber,
pub txn_id: TransactionId,
pub record_type: WalRecordType,
pub page_id: Option<PageId>,
pub redo_data: Bytes,
pub undo_data: Bytes,
pub checksum: u32,
}Expand description
WAL record
Fields§
§lsn: LogSequenceNumberLog sequence number
prev_lsn: LogSequenceNumberPrevious LSN for this transaction (for undo chain)
txn_id: TransactionIdTransaction ID
record_type: WalRecordTypeRecord type
page_id: Option<PageId>Page ID (for page-level operations)
redo_data: BytesRedo data
undo_data: BytesUndo data (for compensation)
checksum: u32Checksum
Implementations§
Source§impl WalRecord
impl WalRecord
Sourcepub fn new(
lsn: LogSequenceNumber,
prev_lsn: LogSequenceNumber,
txn_id: TransactionId,
record_type: WalRecordType,
page_id: Option<PageId>,
redo_data: Bytes,
undo_data: Bytes,
) -> Self
pub fn new( lsn: LogSequenceNumber, prev_lsn: LogSequenceNumber, txn_id: TransactionId, record_type: WalRecordType, page_id: Option<PageId>, redo_data: Bytes, undo_data: Bytes, ) -> Self
Create a new WAL record
Sourcepub fn deserialize(data: &[u8]) -> KernelResult<Self>
pub fn deserialize(data: &[u8]) -> KernelResult<Self>
Deserialize from bytes
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WalRecord
impl RefUnwindSafe for WalRecord
impl Send for WalRecord
impl Sync for WalRecord
impl Unpin for WalRecord
impl UnsafeUnpin for WalRecord
impl UnwindSafe for WalRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more