[][src]Struct undo::RecordBuilder

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

Builder for a record.

Examples

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

Methods

impl<R> RecordBuilder<R>[src]

pub fn new() -> RecordBuilder<R>[src]

Returns a builder for a record.

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

Sets the capacity for the record.

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

Sets the limit for the record.

Panics

Panics if limit is 0.

pub fn saved(self, saved: bool) -> RecordBuilder<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) -> RecordBuilder<R>[src]

Decides how the signal 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>[src]

Builds the record.

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

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

Creates the record with a default receiver.

Trait Implementations

impl<R> Default for RecordBuilder<R>[src]

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

Auto Trait Implementations

impl<R> !Send for RecordBuilder<R>

impl<R> !Sync for RecordBuilder<R>

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

impl<R> !UnwindSafe for RecordBuilder<R>

impl<R> !RefUnwindSafe for RecordBuilder<R>

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]