Struct prevayler_rs::PrevaylerBuilder[][src]

pub struct PrevaylerBuilder<T, D, S, P> { /* fields omitted */ }

Builder of the Prevayler struct

Implementations

impl<T, D, S, P> PrevaylerBuilder<T, D, S, P>[src]

pub fn new() -> Self[src]

Creates the builder

pub fn path(self, path: P) -> Self where
    P: AsRef<Path>, 
[src]

Set the path which will be used to store redologs and snapshots. The folder must exists.

pub fn serializer(self, serializer: S) -> Self where
    S: Serializer<D>, 
[src]

Set which serializer will be used. For more info, see Serializer

pub fn max_log_size(self, max_log_size: u64) -> Self[src]

Set the max log size that will be stored in a single redolog file

pub fn data(self, data: T) -> Self[src]

Set the data that will be prevailed

pub async fn build(self) -> PrevaylerResult<Prevayler<D, T, S>> where
    D: Transaction<T>,
    S: Serializer<D>,
    P: AsRef<Path>, 
[src]

Builds the Prevayler without snapshots. Notice that one of the Prevayler generic parameters cannot be infered by the compiler. This parameter is the type that will be serilized in the redolog. Also, if it is called without setting the path, serializer or data, this will panic.

pub async fn build_with_snapshots(self) -> PrevaylerResult<Prevayler<D, T, S>> where
    D: Transaction<T>,
    S: Serializer<D> + Serializer<T>,
    P: AsRef<Path>, 
[src]

Similar to the build, but this will try to process any saved snapshot. Note that this method has an extra trait bound. The Serializer must know who to serialize and deserialize the prevailed data type.

Auto Trait Implementations

impl<T, D, S, P> !RefUnwindSafe for PrevaylerBuilder<T, D, S, P>

impl<T, D, S, P> Send for PrevaylerBuilder<T, D, S, P> where
    D: Send,
    P: Send,
    S: Send,
    T: Send

impl<T, D, S, P> Sync for PrevaylerBuilder<T, D, S, P> where
    D: Sync,
    P: Sync,
    S: Sync,
    T: Sync

impl<T, D, S, P> Unpin for PrevaylerBuilder<T, D, S, P> where
    D: Unpin,
    P: Unpin,
    S: Unpin,
    T: Unpin

impl<T, D, S, P> !UnwindSafe for PrevaylerBuilder<T, D, S, P>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.