Trait tor_dirmgr::DirProvider

source ·
pub trait DirProvider: NetDirProvider {
    // Required methods
    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 Self: 'async_trait,
             'life0: 'async_trait;
    fn bootstrap_events(&self) -> BoxStream<'static, DirBootstrapStatus>;

    // Provided method
    fn download_task_handle(&self) -> Option<TaskHandle> { ... }
}
Expand description

Trait for DirMgr implementations

Required Methods§

source

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.

source

fn bootstrap<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Bootstrap a DirProvider that hasn’t been bootstrapped yet.

source

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§

source

fn download_task_handle(&self) -> Option<TaskHandle>

Return a TaskHandle that can be used to manage the download process.

Implementations on Foreign Types§

source§

impl<R: Runtime> DirProvider for Arc<DirMgr<R>>

source§

fn reconfigure( &self, new_config: &DirMgrConfig, how: Reconfigure ) -> Result<(), ReconfigureError>

source§

fn bootstrap<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn bootstrap_events(&self) -> BoxStream<'static, DirBootstrapStatus>

source§

fn download_task_handle(&self) -> Option<TaskHandle>

Implementors§