Trait tor_netdir::NetDirProvider
source · [−]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 NetDir
s, as well as inform consumers when
they might have changed.
Required Methods
fn latest_netdir(&self) -> Option<Arc<NetDir>>
fn latest_netdir(&self) -> Option<Arc<NetDir>>
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.