pub trait NetDirProvider: UpcastArcNetDirProvider + Send + Sync {
    fn netdir(&self, timeliness: Timeliness) -> Result<Arc<NetDir>>;
    fn events(&self) -> BoxStream<'static, DirEvent>;
    fn params(&self) -> Arc<dyn AsRef<NetParameters>>;

    fn timely_netdir(&self) -> Result<Arc<NetDir>> { ... }
}
Expand description

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

Required Methods§

Return a network directory that’s live according to the provided timeliness.

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.

Return the latest network parameters.

If we have no directory, return a reasonable set of defaults.

Provided Methods§

Return a reasonable netdir for general usage.

This is an alias for NetDirProvider::netdir(Timeliness::Timely).

Implementations on Foreign Types§

Implementors§