pub struct WalEntry {
pub seq: u32,
pub op: u8,
pub key: String,
pub payload: WalPayload,
}Expand description
A single WAL entry.
Fields§
§seq: u32Monotonically increasing sequence number assigned at append time.
op: u8Operation code (one of the format::OP_* constants).
key: StringKey of the node the operation targets.
payload: WalPayloadOperation-specific payload.
Implementations§
Source§impl WalEntry
impl WalEntry
Sourcepub fn write_to<W: Write>(
&self,
w: &mut W,
layout: &SemLayout,
) -> HoronResult<()>
pub fn write_to<W: Write>( &self, w: &mut W, layout: &SemLayout, ) -> HoronResult<()>
Serialize entry with trailing CRC32.
Sourcepub fn read_from<R: Read>(
r: &mut R,
layout: &SemLayout,
) -> HoronResult<Option<Self>>
pub fn read_from<R: Read>( r: &mut R, layout: &SemLayout, ) -> HoronResult<Option<Self>>
Deserialize an entry from bytes. Returns None if CRC check fails
(indicating a partial write / truncation point). The payload’s
semantic coordinates come back full-width regardless of the disk
encoding (layout — quantization).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WalEntry
impl RefUnwindSafe for WalEntry
impl Send for WalEntry
impl Sync for WalEntry
impl Unpin for WalEntry
impl UnsafeUnpin for WalEntry
impl UnwindSafe for WalEntry
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