pub trait ServiceSubscription: Send + Sync {
// Required methods
fn instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn wait_for_change<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
服务订阅 Trait
使用 async_trait 宏使其兼容 dyn。
Required Methods§
Sourcefn instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn instances<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
获取服务实例列表
Sourcefn wait_for_change<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn wait_for_change<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<ServiceInstance>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
等待服务变更