[][src]Struct undo::HistoryBuilder

pub struct HistoryBuilder<R> { /* fields omitted */ }

Builder for a History.

Examples

History::builder()
    .capacity(100)
    .limit(100)
    .saved(false)
    .default()

Methods

impl<R> HistoryBuilder<R>[src]

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

Sets the specified capacity for the history.

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

Sets the limit for the history.

Panics

Panics if limit is 0.

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

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

pub fn connect(self, slot: impl FnMut(Signal) + 'static) -> HistoryBuilder<R>[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>[src]

Builds the history.

impl<R: Default> HistoryBuilder<R>[src]

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

Creates the history with a default receiver.

Trait Implementations

impl<R: Debug> Debug for HistoryBuilder<R>[src]

Auto Trait Implementations

impl<R> Unpin for HistoryBuilder<R> where
    R: Unpin

impl<R> !Sync for HistoryBuilder<R>

impl<R> !Send for HistoryBuilder<R>

impl<R> !UnwindSafe for HistoryBuilder<R>

impl<R> !RefUnwindSafe for HistoryBuilder<R>

Blanket Implementations

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.

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

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

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