Trait DownloadUrlsGenerator

Source
pub trait DownloadUrlsGenerator:
    DynClone
    + Debug
    + Sync
    + Send {
    // Required method
    fn generate(
        &self,
        object_name: &str,
        options: GeneratorOptions<'_>,
    ) -> Result<Vec<Uri>, Error>;

    // Provided method
    fn async_generate<'a>(
        &'a self,
        object_name: &'a str,
        options: GeneratorOptions<'a>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>> { ... }
}
Expand description

生成下载 URL 列表的接口

同时提供阻塞接口和异步接口,异步接口则需要启用 async 功能

Required Methods§

Source

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

生成下载 URL 列表

该方法的异步版本为 Self::async_generate

Provided Methods§

Source

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

异步生成下载 URL 列表

Implementations on Foreign Types§

Source§

impl<'b, T> DownloadUrlsGenerator for &'b T

Source§

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

Source§

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

Source§

impl<'b, T> DownloadUrlsGenerator for &'b mut T

Source§

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

Source§

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

Source§

impl<T> DownloadUrlsGenerator for Box<T>

Source§

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

Source§

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

Source§

impl<T> DownloadUrlsGenerator for Rc<T>

Source§

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

Source§

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

Source§

impl<T> DownloadUrlsGenerator for Arc<T>

Source§

fn generate( &self, object_name: &str, options: GeneratorOptions<'_>, ) -> Result<Vec<Uri>, Error>

Source§

fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Uri>, Error>> + Send + 'a>>

Implementors§