pub trait RpcDiscovery:
Send
+ Sync
+ Clone
+ 'static {
// Required methods
fn discover<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ServiceEndpoint, ServiceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_all_endpoints<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceEndpoint>, ServiceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn start_watch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stop_watch<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn discover<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ServiceEndpoint, ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn discover<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ServiceEndpoint, ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
发现服务并返回连接通道
Sourcefn get_all_endpoints<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceEndpoint>, ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_endpoints<'life0, 'life1, 'async_trait>(
&'life0 self,
service_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ServiceEndpoint>, ServiceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
根据服务名获取所有服务节点
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.