pub trait EndpointsProvider:
DynClone
+ Debug
+ Send
+ Sync {
// Required method
fn get_endpoints<'e>(
&'e self,
options: GetOptions<'_>,
) -> ApiResult<Cow<'e, Endpoints>>;
// Provided method
fn async_get_endpoints<'a>(
&'a self,
options: GetOptions<'a>,
) -> Pin<Box<dyn Future<Output = ApiResult<Cow<'a, Endpoints>>> + Send + 'a>> { ... }
}
Expand description
终端地址列表获取接口
同时提供阻塞获取接口和异步获取接口,异步获取接口则需要启用 async
功能
Required Methods§
Sourcefn get_endpoints<'e>(
&'e self,
options: GetOptions<'_>,
) -> ApiResult<Cow<'e, Endpoints>>
fn get_endpoints<'e>( &'e self, options: GetOptions<'_>, ) -> ApiResult<Cow<'e, Endpoints>>
获取终端地址列表
该方法的异步版本为 Self::async_get_endpoints
。
Provided Methods§
Sourcefn async_get_endpoints<'a>(
&'a self,
options: GetOptions<'a>,
) -> Pin<Box<dyn Future<Output = ApiResult<Cow<'a, Endpoints>>> + Send + 'a>>
Available on crate feature async
only.
fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a>, ) -> Pin<Box<dyn Future<Output = ApiResult<Cow<'a, Endpoints>>> + Send + 'a>>
async
only.异步获取终端地址列表