Skip to main content

Dump

Struct Dump 

Source
pub struct Dump<T> { /* private fields */ }
Expand description

A dump utility that reads WAL records from disk.

It acquires an exclusive lock on the directory to prevent concurrent writes while reading.

Implementations§

Source§

impl<T: Types> Dump<T>

Source

pub fn new(config: Arc<Config>) -> Result<Self, Error>

Creates a new Dump instance with the given configuration.

§Errors

Returns an IO error if acquiring the directory lock fails.

Trait Implementations§

Source§

impl<T: Types> DumpApi<T> for Dump<T>

Source§

fn write_with<D>(&self, write_record: D) -> Result<(), Error>

Reads all WAL records from disk and passes them to the provided callback function.

The callback receives:

  • chunk_id: The ID of the chunk containing the record
  • index: The 0-based index of the record within its chunk
  • result: The result containing either the record data or an IO error
§Errors

Returns an IO error if reading the chunks fails or if the callback returns an error.

Source§

fn write_to_string(&self) -> Result<String, Error>

Writes the Raft log contents to a String.
Source§

fn write<W: Write>(&self, w: W) -> Result<(), Error>

Writes the Raft log contents to the provided writer.
Source§

fn write_display<W: Write>(&self, w: W) -> Result<(), Error>
where WALRecord<T>: Display,

Writes the Raft log contents to the provided writer, using std::fmt::Display for record formatting.

Auto Trait Implementations§

§

impl<T> Freeze for Dump<T>

§

impl<T> RefUnwindSafe for Dump<T>
where T: RefUnwindSafe,

§

impl<T> Send for Dump<T>
where T: Send,

§

impl<T> Sync for Dump<T>
where T: Sync,

§

impl<T> Unpin for Dump<T>
where T: Unpin,

§

impl<T> UnwindSafe for Dump<T>
where T: UnwindSafe,

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> 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, 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.