pub trait EndpointsProvider:
DynClone
+ Debug
+ Send
+ Sync {
// Required method
fn get_endpoints<'e>(
&'e self,
options: GetOptions<'_>,
) -> Result<Cow<'e, Endpoints>, Error>;
// Provided method
fn async_get_endpoints<'a>(
&'a self,
options: GetOptions<'a>,
) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a>> { ... }
}
Expand description
终端地址列表获取接口
同时提供阻塞获取接口和异步获取接口,异步获取接口则需要启用 async
功能
Required Methods§
Sourcefn get_endpoints<'e>(
&'e self,
options: GetOptions<'_>,
) -> Result<Cow<'e, Endpoints>, Error>
fn get_endpoints<'e>( &'e self, options: GetOptions<'_>, ) -> Result<Cow<'e, Endpoints>, Error>
获取终端地址列表
该方法的异步版本为 Self::async_get_endpoints
。
Provided Methods§
Trait Implementations§
Source§impl<'clone> Clone for Box<dyn EndpointsProvider + 'clone>
impl<'clone> Clone for Box<dyn EndpointsProvider + 'clone>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more