[][src]Struct redo::HistoryBuilder

pub struct HistoryBuilder<R, C: Command<R>> { /* fields omitted */ }

Builder for a History.

Examples

let history = History::builder()
    .capacity(100)
    .limit(100)
    .saved(false)
    .default();

Methods

impl<R, C: Command<R>> HistoryBuilder<R, C>
[src]

pub fn capacity(self, capacity: usize) -> HistoryBuilder<R, C>
[src]

Sets the capacity for the history.

pub fn limit(self, limit: usize) -> HistoryBuilder<R, C>
[src]

Sets the limit for the history.

Panics

Panics if limit is 0.

pub fn saved(self, saved: bool) -> HistoryBuilder<R, C>
[src]

Sets if the receiver is initially in a saved state. By default the receiver is in a saved state.

pub fn connect<F>(
    self,
    f: impl Into<Option<F>>
) -> HistoryBuilder<R, C> where
    F: FnMut(Signal) + Send + Sync + 'static, 
[src]

Decides how the signal should be handled when the state changes. By default the history does not handle any signals.

pub fn build(
    self,
    receiver: impl Into<R>
) -> History<R, C>
[src]

Builds the history.

impl<R: Default, C: Command<R>> HistoryBuilder<R, C>
[src]

pub fn default(self) -> History<R, C>
[src]

Creates the history with a default receiver.

Trait Implementations

impl<R: Debug, C: Debug + Command<R>> Debug for HistoryBuilder<R, C>
[src]

Auto Trait Implementations

impl<R, C> Send for HistoryBuilder<R, C> where
    C: Send,
    R: Send

impl<R, C> Sync for HistoryBuilder<R, C> where
    C: Sync,
    R: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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