Struct wral::Wal [−][src]
Write ahead logging.
Implementations
impl<S> Wal<S>
[src]
pub fn create(config: Config, state: S) -> Result<Wal<S>> where
S: State,
[src]
S: State,
Create a new Write-Ahead-Log instance, while create a new journal,
older journals matching the name
shall be purged.
pub fn load(config: Config) -> Result<Wal<S>> where
S: Default + State,
[src]
S: Default + State,
Load an existing journal under dir
, matching name
. Files that
don’t match the journal file-name structure or journals with
corrupted batch or corrupted state shall be ignored.
Application state shall be loaded from the last batch of the last journal.
pub fn close(self, purge: bool) -> Result<Option<u64>>
[src]
Close the Wal instance. To purge the instance pass purge
as true.
impl<S> Wal<S>
[src]
pub fn add_op(&self, op: &[u8]) -> Result<u64>
[src]
Add a operation to WAL, operations are pre-serialized and opaque to Wal instances. Return the sequence-number for this operation.
impl<S> Wal<S>
[src]
pub fn iter(&self) -> Result<impl Iterator<Item = Result<Entry>>>
[src]
Iterate over all entries in this Wal instance, entries can span across multiple journal files. Iteration will start from lowest sequence-number to highest.
pub fn range<R>(&self, range: R) -> Result<impl Iterator<Item = Result<Entry>>> where
R: RangeBounds<u64>,
[src]
R: RangeBounds<u64>,
Iterate over entries whose sequence number fall within the
specified range
.
Trait Implementations
Auto Trait Implementations
impl<S = NoState> !RefUnwindSafe for Wal<S>
impl<S> Send for Wal<S> where
S: Send + Sync,
S: Send + Sync,
impl<S = NoState> !Sync for Wal<S>
impl<S> Unpin for Wal<S>
impl<S = NoState> !UnwindSafe for Wal<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,