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§

source

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

获取终端地址列表

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

Provided Methods§

source

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

异步获取终端地址列表

Trait Implementations§

source§

impl<'clone> Clone for Box<dyn EndpointsProvider + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EndpointsProvider + Send + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EndpointsProvider + Send + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EndpointsProvider + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementations on Foreign Types§

source§

impl<'b, T: 'b + EndpointsProvider + ?Sized> EndpointsProvider for &'b mut Twhere &'b mut T: DynClone + Debug + Send + Sync,

source§

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

source§

fn 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.
source§

impl<T: EndpointsProvider + ?Sized> EndpointsProvider for Rc<T>where Rc<T>: DynClone + Debug + Send + Sync,

source§

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

source§

fn 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.
source§

impl<'b, T: 'b + EndpointsProvider + ?Sized> EndpointsProvider for &'b Twhere &'b T: DynClone + Debug + Send + Sync,

source§

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

source§

fn 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.
source§

impl<T: EndpointsProvider + ?Sized> EndpointsProvider for Box<T>where Box<T>: DynClone + Debug + Send + Sync,

source§

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

source§

fn 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.
source§

impl<T: EndpointsProvider + ?Sized> EndpointsProvider for Arc<T>where Arc<T>: DynClone + Debug + Send + Sync,

source§

fn get_endpoints<'e>( &'e self, options: GetOptions<'_> ) -> ApiResult<Cow<'e, Endpoints>>

source§

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

Implementors§