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, Global>> { ... }
}
Expand description

终端地址列表获取接口

同时提供阻塞获取接口和异步获取接口,异步获取接口则需要启用 async 功能

Required Methods§

source

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

获取终端地址列表

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

Provided Methods§

source

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

异步获取终端地址列表

Implementations on Foreign Types§

source§

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

source§

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

source§

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

source§

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

source§

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

source§

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

source§

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

source§

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

source§

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

source§

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

source§

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

source§

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

source§

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

source§

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

source§

fn async_get_endpoints<'a>( &'a self, options: GetOptions<'a> ) -> Pin<Box<dyn Future<Output = Result<Cow<'a, Endpoints>, Error>> + Send + 'a, Global>>

Implementors§