Trait EndpointsProvider

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

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

异步获取终端地址列表

Trait Implementations§

Source§

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

Source§

fn clone(&self) -> Box<dyn EndpointsProvider + 'clone>

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) -> Box<dyn EndpointsProvider + Send + 'clone>

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 + Send + 'clone>

Source§

fn clone(&self) -> Box<dyn EndpointsProvider + Sync + Send + 'clone>

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) -> Box<dyn EndpointsProvider + Sync + 'clone>

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> EndpointsProvider for &'b T
where 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>>

Source§

impl<'b, T> EndpointsProvider for &'b mut T

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

Source§

impl<T> EndpointsProvider for Box<T>

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

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

Source§

impl<T> EndpointsProvider for Arc<T>

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

Implementors§