Trait tor_dirmgr::DirProvider
source · [−]pub trait DirProvider: NetDirProvider {
fn reconfigure(
&self,
new_config: &DirMgrConfig,
how: Reconfigure
) -> Result<(), ReconfigureError>;
fn bootstrap<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn bootstrap_events(&self) -> BoxStream<'static, DirBootstrapStatus>;
fn download_task_handle(&self) -> Option<TaskHandle> { ... }
}
Expand description
Trait for DirMgr implementations
Required Methods
fn reconfigure(
&self,
new_config: &DirMgrConfig,
how: Reconfigure
) -> Result<(), ReconfigureError>
fn reconfigure(
&self,
new_config: &DirMgrConfig,
how: Reconfigure
) -> Result<(), ReconfigureError>
Try to change our configuration to new_config
.
Actual behavior will depend on the value of how
.
Bootstrap a DirProvider
that hasn’t been bootstrapped yet.
fn bootstrap_events(&self) -> BoxStream<'static, DirBootstrapStatus>
fn bootstrap_events(&self) -> BoxStream<'static, DirBootstrapStatus>
Return a stream of DirBootstrapStatus
events to tell us about changes
in the latest directory’s bootstrap status.
Note that this stream can be lossy: the caller will not necessarily observe every event on the stream
Provided Methods
fn download_task_handle(&self) -> Option<TaskHandle>
fn download_task_handle(&self) -> Option<TaskHandle>
Return a TaskHandle
that can be used to manage the download process.