[][src]Struct redo::HistoryBuilder

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

Builder for a History.

Examples

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

Methods

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

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

Returns a builder for a history.

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

Sets the capacity for the history.

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

Sets the limit for the history.

Panics

Panics if limit is 0.

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

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

pub fn build(self, target: C::Target) -> History<C>[src]

Builds the history.

pub fn build_with<F>(self, target: C::Target, slot: F) -> History<C, F>[src]

Builds the history with the slot.

impl<C: Command> HistoryBuilder<C> where
    C::Target: Default
[src]

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

Creates the history with a default target.

pub fn default_with<F>(self, slot: F) -> History<C, F>[src]

Creates the history with a default target.

Trait Implementations

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

impl<C: PartialEq + Command> PartialEq<HistoryBuilder<C>> for HistoryBuilder<C>[src]

impl<C: Eq + Command> Eq for HistoryBuilder<C>[src]

impl<C: Ord + Command> Ord for HistoryBuilder<C>[src]

impl<C: PartialOrd + Command> PartialOrd<HistoryBuilder<C>> for HistoryBuilder<C>[src]

impl<C: Hash + Command> Hash for HistoryBuilder<C>[src]

impl<C: Command> StructuralPartialEq for HistoryBuilder<C>[src]

impl<C: Command> StructuralEq for HistoryBuilder<C>[src]

impl<C: Clone + Command> Clone for HistoryBuilder<C>[src]

impl<C: Command> Default for HistoryBuilder<C>[src]

impl<C: Command> Serialize for HistoryBuilder<C> where
    C: Serialize
[src]

impl<'de, C: Command> Deserialize<'de> for HistoryBuilder<C> where
    C: Deserialize<'de>, 
[src]

Auto Trait Implementations

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

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

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

impl<C> UnwindSafe for HistoryBuilder<C> where
    C: UnwindSafe

impl<C> RefUnwindSafe for HistoryBuilder<C> where
    C: RefUnwindSafe

Blanket Implementations

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> Into<U> for T where
    U: From<T>, 
[src]

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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]