pub trait NetDirProvider: UpcastArcNetDirProvider + Send + Sync {
    fn latest_netdir(&self) -> Option<Arc<NetDir>>;
    fn events(&self) -> BoxStream<'static, DirEvent>;
}
Expand description

An object that can provide NetDirs, as well as inform consumers when they might have changed.

Required Methods

Return a handle to our latest directory, if we have one.

Return a new asynchronous stream that will receive notification whenever the consensus has changed.

Multiple events may be batched up into a single item: each time this stream yields an event, all you can assume is that the event has occurred at least once.

Implementations on Foreign Types

Implementors