pub struct RecordHeader {
pub magic: u32,
pub version: u16,
pub flags: RecordFlags,
pub txn_id: u64,
pub timestamp: u64,
pub payload_len: u32,
pub checksum: u32,
}Expand description
Journal record header
Fields§
§magic: u32§version: u16§flags: RecordFlags§txn_id: u64§timestamp: u64§payload_len: u32§checksum: u32Implementations§
Source§impl RecordHeader
impl RecordHeader
Sourcepub fn new(txn_id: u64, flags: RecordFlags, payload_len: u32) -> Self
pub fn new(txn_id: u64, flags: RecordFlags, payload_len: u32) -> Self
Create a new record header
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Parse header from bytes
Sourcepub fn verify_checksum(&self, payload: &[u8]) -> bool
pub fn verify_checksum(&self, payload: &[u8]) -> bool
Verify checksum against payload
Trait Implementations§
Source§impl Clone for RecordHeader
impl Clone for RecordHeader
Source§fn clone(&self) -> RecordHeader
fn clone(&self) -> RecordHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RecordHeader
impl RefUnwindSafe for RecordHeader
impl Send for RecordHeader
impl Sync for RecordHeader
impl Unpin for RecordHeader
impl UnwindSafe for RecordHeader
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