[][src]Struct redo::RecordBuilder

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

Builder for a record.

Examples

let record = Record::builder()
    .capacity(100)
    .limit(100)
    .saved(false)
    .default();

Methods

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

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

Sets the capacity for the record.

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

Sets the limit of the record.

Panics

Panics if limit is 0.

pub fn saved(self, saved: bool) -> RecordBuilder<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>>
) -> RecordBuilder<R, C> where
    F: FnMut(Signal) + Send + Sync + 'static, 
[src]

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

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

Builds the record.

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

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

Creates the record with a default receiver.

Trait Implementations

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

Auto Trait Implementations

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

impl<R, C> Sync for RecordBuilder<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]