Trait EndpointsProvider

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

异步获取终端地址列表

Implementations on Foreign Types§

Source§

impl<'b, T: 'b + EndpointsProvider + ?Sized> EndpointsProvider for &'b T
where &'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<'b, T: 'b + EndpointsProvider + ?Sized> EndpointsProvider for &'b mut T

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 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<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§