Skip to main content

DirProvider

Trait 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

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§