pub trait DownloadUrlsGenerator: DynClone + Debug + Sync + Send {
// Required method
fn generate(
&self,
object_name: &str,
options: GeneratorOptions<'_>
) -> ApiResult<Vec<Uri>>;
// Provided method
fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>> { ... }
}
Expand description
生成下载 URL 列表的接口
同时提供阻塞接口和异步接口,异步接口则需要启用 async
功能
Required Methods§
sourcefn generate(
&self,
object_name: &str,
options: GeneratorOptions<'_>
) -> ApiResult<Vec<Uri>>
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
生成下载 URL 列表
该方法的异步版本为 Self::async_generate
。
Provided Methods§
sourcefn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.异步生成下载 URL 列表
Implementations on Foreign Types§
source§impl<'b, T: 'b + DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for &'b T
impl<'b, T: 'b + DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for &'b T
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
source§fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.source§impl<'b, T: 'b + DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for &'b mut T
impl<'b, T: 'b + DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for &'b mut T
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
source§fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.source§impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Box<T>
impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Box<T>
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
source§fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.source§impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Rc<T>
impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Rc<T>
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
source§fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.source§impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Arc<T>
impl<T: DownloadUrlsGenerator + ?Sized> DownloadUrlsGenerator for Arc<T>
fn generate( &self, object_name: &str, options: GeneratorOptions<'_> ) -> ApiResult<Vec<Uri>>
source§fn async_generate<'a>(
&'a self,
object_name: &'a str,
options: GeneratorOptions<'a>
) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
fn async_generate<'a>( &'a self, object_name: &'a str, options: GeneratorOptions<'a> ) -> BoxFuture<'a, ApiResult<Vec<Uri>>>
Available on crate feature
async
only.