Struct growthring::wal::WALWriter

source ·
pub struct WALWriter<F: WALStore> { /* private fields */ }

Implementations§

source§

impl<F: WALStore> WALWriter<F>

source

pub fn grow<'a, R: Record + 'a>( &'a mut self, records: Vec<R> ) -> Vec<impl Future<Output = Result<(R, WALRingId), ()>> + 'a>

Submit a sequence of records to WAL. It returns a vector of futures, each of which corresponds to one record. When a future resolves to WALRingId, it is guaranteed the record is already logged. Then, after finalizing the changes encoded by that record to the persistent storage, the caller can recycle the WAL files by invoking the given peel with the given WALRingIds. Note: each serialized record should contain at least 1 byte (empty record payload will result in assertion failure).

source

pub async fn peel<'a, T: AsRef<[WALRingId]>>( &'a mut self, records: T, keep_nrecords: u32 ) -> Result<(), ()>

Inform the WALWriter that some data writes are complete so that it could automatically remove obsolete WAL files. The given list of WALRingId does not need to be ordered and could be of arbitrary length. Use 0 for keep_nrecords if all obsolete WAL files need to removed (the obsolete files do not affect the speed of recovery or correctness).

source

pub fn file_pool_in_use(&self) -> usize

source

pub async fn read_recent_records<'a>( &'a self, nrecords: usize, recover_policy: &RecoverPolicy ) -> Result<Vec<WALBytes>, ()>

Trait Implementations§

source§

impl<F> Send for WALWriter<F>
where F: WALStore + Send,

Auto Trait Implementations§

§

impl<F> !RefUnwindSafe for WALWriter<F>

§

impl<F> !Sync for WALWriter<F>

§

impl<F> Unpin for WALWriter<F>
where F: Unpin,

§

impl<F> !UnwindSafe for WALWriter<F>

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

§

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

§

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.