ObservableList

Struct ObservableList 

Source
pub struct ObservableList<T, Codec = Default> { /* private fields */ }
๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
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ยง

Sourceยง

impl<T, Codec> ObservableList<T, Codec>
where T: RemoteSend + Clone, Codec: Codec,

Source

pub fn new() -> Self

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Creates a new, empty observable list.

Source

pub fn set_error_handler<E>(&mut self, on_err: E)
where E: Fn(SendError) + Send + Sync + 'static,

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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

Source

pub fn distributor(&self) -> ObservableListDistributor<T, Codec>

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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.

Source

pub fn subscribe(&self) -> ListSubscription<T, Codec>

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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

Source

pub fn subscriber_count(&self) -> usize

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Current number of subscribers.

Source

pub fn notifier(&self) -> ChangeNotifier

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Returns a change notifier that can be used locally to be notified of changes to this collection.

Source

pub fn closed(&self) -> impl Future<Output = ()>

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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.

Source

pub fn is_closed(&self) -> bool

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Returns true if there are currently no subscribers.

Source

pub fn push(&mut self, value: T)

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Appends an element at the end.

A ListEvent::Push change event is sent.

ยงPanics

Panics when done has been called before.

Source

pub fn len(&self) -> usize

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

The current number of elements in the observable list.

Source

pub fn is_empty(&self) -> bool

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Returns whether this observable list is empty.

Source

pub fn done(&mut self)

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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.

Source

pub fn is_done(&self) -> bool

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

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

Methods that modify the list will panic in this case.

Source

pub async fn borrow<'a>(&'a self) -> ObservableListRef<'a, T>

๐Ÿ‘ŽDeprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.

Borrows the current value of the observable list.

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

Trait Implementationsยง

Sourceยง

impl<T, Codec> Debug for ObservableList<T, Codec>

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<T, Codec> Default for ObservableList<T, Codec>
where T: RemoteSend + Clone, Codec: Codec,

Sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<T, Codec> Drop for ObservableList<T, Codec>

Sourceยง

fn drop(&mut self)

Executes the destructor for this type. Read more
Sourceยง

impl<T, Codec> Extend<T> for ObservableList<T, Codec>
where T: RemoteSend + Clone, Codec: Codec,

Sourceยง

fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)

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

fn extend_one(&mut self, item: A)

๐Ÿ”ฌThis is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Sourceยง

fn extend_reserve(&mut self, additional: usize)

๐Ÿ”ฌThis is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Sourceยง

impl<T, Codec> From<Vec<T>> for ObservableList<T, Codec>
where T: RemoteSend + Clone, Codec: Codec,

Sourceยง

fn from(initial: Vec<T>) -> Self

Converts to this type from the input type.

Auto Trait Implementationsยง

ยง

impl<T, Codec> Freeze for ObservableList<T, Codec>

ยง

impl<T, Codec> RefUnwindSafe for ObservableList<T, Codec>

ยง

impl<T, Codec> Send for ObservableList<T, Codec>
where T: Send, Codec: Send,

ยง

impl<T, Codec> Sync for ObservableList<T, Codec>
where T: Send, Codec: Send,

ยง

impl<T, Codec> Unpin for ObservableList<T, Codec>

ยง

impl<T, Codec> UnwindSafe for ObservableList<T, Codec>

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

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

Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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