pub struct ObservableList<T, Codec = Default> { /* private fields */ }
Expand description

An append-only list that emits an event for each change.

Use subscribe to obtain an event stream that can be used for building a mirror of this list.

The distributor method can be used to obtain a clonable object that can be used to make subscriptions from other tasks.

Implementations

Creates a new, empty observable list.

Sets the error handler function that is called when sending an event fails.

Returns an observable list distributor that can be used to make subscriptions to this observable list.

It is clonable and can be sent to other tasks.

Subscribes to the observable list with incremental sending of the current contents.

Current number of subscribers.

Returns when all subscribers have quit.

If no subscribers are currently present, this return immediately. This also returns when done has been called and all subscribers have received all elements of the list.

Returns true if there are currently no subscribers.

Appends an element at the end.

A ListEvent::Push change event is sent.

Panics

Panics when done has been called before.

The current number of elements in the observable list.

Returns whether this observable list is empty.

Prevents further changes of this list and notifies are subscribers that no further events will occur.

Methods that modify the list will panic after this has been called. It is still possible to subscribe to this observable list.

Returns true if done has been called and further changes are prohibited.

Methods that modify the list will panic in this case.

Borrows the current value of the observable list.

While the borrow is held sending of events to subscribers is paused.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Executes the destructor for this type. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more