Crate n0_watcher

Source
Expand description

Watchable values.

A Watchable exists to keep track of a value which may change over time. It allows observers to be notified of changes to the value. The aim is to always be aware of the last value, not to observe every value change.

In that way, a Watchable is like a [tokio::sync::broadcast::Sender] (and a Watcher is like a [tokio::sync::broadcast::Receiver]), except that there’s no risk of the channel filling up, but instead you might miss items.

This crate is meant to be imported like this (if you use all of these things):

use n0_watcher::{Watchable, Watcher as _};

Structs§

Direct
The immediate, direct observer of a Watchable value.
Disconnected
The error for when a Watcher is disconnected from its underlying Watchable value, because of that watchable having been dropped.
InitializedFut
Future returning the current or next value that’s Some value. in a Watcher.
Join
Combinator to join two watchers
Map
Wraps a Watcher to allow observing a derived value.
NextFut
Future returning the next item after the current one in a Watcher.
Stream
A stream for a Watcher’s next values.
Watchable
A wrapper around a value that notifies Watchers when the value is modified.

Traits§

Nullable
Abstracts over Option<T> and Vec<T>
Watcher
A handle to a value that’s represented by one or more underlying Watchables.