Skip to main content

WALRecord

Enum WALRecord 

Source
pub enum WALRecord<W>
where W: WalTypes,
{ Action(<W as WalTypes>::Action), Checkpoint(<W as WalTypes>::Checkpoint), }
Expand description

Generic record stored in the Write-Ahead Log (WAL).

The WAL only distinguishes user actions from state-machine checkpoints. The concrete action and checkpoint payloads are defined by the user of the WAL.

Variants§

§

Action(<W as WalTypes>::Action)

A user-defined command.

§

Checkpoint(<W as WalTypes>::Checkpoint)

A state-machine checkpoint persisted by the WAL.

Trait Implementations§

Source§

impl<W> Clone for WALRecord<W>
where W: Clone + WalTypes, <W as WalTypes>::Action: Clone, <W as WalTypes>::Checkpoint: Clone,

Source§

fn clone(&self) -> WALRecord<W>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<W> Debug for WALRecord<W>
where W: WalTypes,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<W> Decode for WALRecord<W>
where W: WalTypes,

Implements decoding for WALRecord.

The wrapper inspects the record type and replays it for the decoder. Checkpoint records reread the reserved checkpoint type so v1 checksum verification still covers the type and payload.

Source§

fn decode<R>(r: R) -> Result<WALRecord<W>, Error>
where R: Read,

Source§

impl<W> Display for WALRecord<W>
where W: WalTypes, <W as WalTypes>::Action: Display, <W as WalTypes>::Checkpoint: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<W> Encode for WALRecord<W>
where W: WalTypes,

Source§

fn encode<Wt>(&self, w: Wt) -> Result<usize, Error>
where Wt: Write,

Source§

fn type_id(&self) -> Option<u32>

Returns the leading type id when the encoded form starts with one.
Source§

fn encode_to_vec(&self) -> Result<Vec<u8>, Error>
where Self: Sealed,

Encodes the value into a new Vec<u8>. Read more
Source§

impl<W> PartialEq for WALRecord<W>

Source§

fn eq(&self, other: &WALRecord<W>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<W> WAL<WALRecord<W>> for ChunkedWal<W>
where W: WalTypes,

Source§

fn append(&mut self, rec: &WALRecord<W>) -> Result<(), Error>

Appends a new record to the write-ahead log. Read more
Source§

fn last_segment(&self) -> Segment<Crc32fast>

Returns the segment representing the last record in the write-ahead log. Read more
Source§

impl<W> Eq for WALRecord<W>
where W: Eq + WalTypes, <W as WalTypes>::Action: Eq, <W as WalTypes>::Checkpoint: Eq,

Source§

impl<W> StructuralPartialEq for WALRecord<W>
where W: WalTypes,

Auto Trait Implementations§

§

impl<W> Freeze for WALRecord<W>
where <W as WalTypes>::Action: Freeze, <W as WalTypes>::Checkpoint: Freeze,

§

impl<W> RefUnwindSafe for WALRecord<W>

§

impl<W> Send for WALRecord<W>

§

impl<W> Sync for WALRecord<W>
where <W as WalTypes>::Action: Sync,

§

impl<W> Unpin for WALRecord<W>
where <W as WalTypes>::Action: Unpin, <W as WalTypes>::Checkpoint: Unpin,

§

impl<W> UnsafeUnpin for WALRecord<W>

§

impl<W> UnwindSafe for WALRecord<W>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Codec for T
where T: Encode + Decode,