pub struct Detector { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Detector for Detector
impl Detector for Detector
Source§async fn register(&mut self) -> Result<(), Box<dyn Error + Send + 'static>>
async fn register(&mut self) -> Result<(), Box<dyn Error + Send + 'static>>
第一次注册如果失败则返回,如果成功也返回但内部会有掉线重试机制
Source§async fn fetch_all(
&mut self,
) -> Result<HashMap<String, Services>, Box<dyn Error + Send + 'static>>
async fn fetch_all( &mut self, ) -> Result<HashMap<String, Services>, Box<dyn Error + Send + 'static>>
获取所有注册的服务实例
Source§async fn watch(
&mut self,
) -> Result<WatchRx<ServiceEvent>, Box<dyn Error + Send + 'static>>
async fn watch( &mut self, ) -> Result<WatchRx<ServiceEvent>, Box<dyn Error + Send + 'static>>
监听本类型服务实例
Source§async fn watch_all(
&mut self,
) -> Result<WatchRx<ServiceEvent>, Box<dyn Error + Send + 'static>>
async fn watch_all( &mut self, ) -> Result<WatchRx<ServiceEvent>, Box<dyn Error + Send + 'static>>
监听所有注册的服务实例
Source§fn status(&self) -> ServiceStatus
fn status(&self) -> ServiceStatus
服务状态
Source§fn registered(&self) -> bool
fn registered(&self) -> bool
是否处于已注册
Source§fn unregistered(&self) -> bool
fn unregistered(&self) -> bool
是否处于注册过期了
Auto Trait Implementations§
impl !Freeze for Detector
impl !RefUnwindSafe for Detector
impl Send for Detector
impl Sync for Detector
impl Unpin for Detector
impl !UnwindSafe for Detector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request