[][src]Struct undo::HistoryBuilder

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

Builder for a History.

Examples

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

Methods

impl<T> HistoryBuilder<T>[src]

pub fn new() -> HistoryBuilder<T>[src]

Returns a builder for a history.

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

Sets the specified capacity for the history.

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

Sets the limit for the history.

Panics

Panics if limit is 0.

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

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

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

Builds the history.

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

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

Creates the history with a default target.

Trait Implementations

impl<T> Default for HistoryBuilder<T>[src]

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

Auto Trait Implementations

impl<T> !Send for HistoryBuilder<T>

impl<T> !Sync for HistoryBuilder<T>

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

impl<T> !UnwindSafe for HistoryBuilder<T>

impl<T> !RefUnwindSafe for HistoryBuilder<T>

Blanket Implementations

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

impl<T> From<T> for 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]