pub struct HealthClient { /* private fields */ }Expand description
Клиент проверки состояния соседа.
Implementations§
Source§impl HealthClient
impl HealthClient
Sourcepub async fn check(
&mut self,
context: &CallContext,
service: impl Into<String>,
) -> Result<HealthCheckResponse, ClientError>
pub async fn check( &mut self, context: &CallContext, service: impl Into<String>, ) -> Result<HealthCheckResponse, ClientError>
Состояние службы service по имени.
§Ошибки
Неизвестное имя — NOT_FOUND; сосед недоступен — UNAVAILABLE.
Sourcepub async fn check_response(
&mut self,
context: &CallContext,
service: impl Into<String>,
) -> Result<Response<HealthCheckResponse>, ClientError>
pub async fn check_response( &mut self, context: &CallContext, service: impl Into<String>, ) -> Result<Response<HealthCheckResponse>, ClientError>
Состояние службы вместе с метаданными ответа.
Метаданные включают заголовки и трейлеры: транспорт склеивает их в один набор.
§Ошибки
Неизвестное имя — NOT_FOUND; сосед недоступен — UNAVAILABLE.
Sourcepub async fn watch(
&mut self,
context: &CallContext,
service: impl Into<String>,
) -> Result<GuardedStream<Streaming<HealthCheckResponse>>, ClientError>
pub async fn watch( &mut self, context: &CallContext, service: impl Into<String>, ) -> Result<GuardedStream<Streaming<HealthCheckResponse>>, ClientError>
Наблюдение за состоянием службы service: первое сообщение — текущее состояние.
§Ошибки
Неизвестное имя — SERVICE_UNKNOWN в первом сообщении, поток не обрывается.
Auto Trait Implementations§
impl !Freeze for HealthClient
impl !RefUnwindSafe for HealthClient
impl !UnwindSafe for HealthClient
impl Forget for HealthClient
impl Move for HealthClient
impl Send for HealthClientwhere
Arc<Settings>: Send,
Arc<dyn CallLoad>: Send,
Arc<ClientLog>: Send,
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Send,
BoxRaw<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: Send,
Arc<Mutex<Option<ServiceError>>>: Send,
BoxRaw<ByteStr>: Send,
Bytes: Send,
impl Sync for HealthClientwhere
Arc<Settings>: Sync,
Arc<dyn CallLoad>: Sync,
Arc<ClientLog>: Sync,
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Sync,
ReusableBoxFuture<'static, Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>>: Sync,
Arc<Mutex<Option<ServiceError>>>: Sync,
BoxRaw<ByteStr>: Sync,
Bytes: Sync,
impl Unpin for HealthClientwhere
Arc<Settings>: Unpin,
Arc<dyn CallLoad>: Unpin,
Arc<ClientLog>: Unpin,
Arc<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>: Unpin,
Box<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: Unpin,
Arc<Mutex<Option<ServiceError>>>: Unpin,
Box<ByteStr>: Unpin,
*const u8: Unpin,
Align8<*mut ()>: Unpin,
&'static Vtable: Unpin,
impl UnsafeUnpin for HealthClientwhere
*const ArcInner<Settings> is !null: UnsafeUnpin,
PhantomData<ArcInner<Settings>>: UnsafeUnpin,
*const ArcInner<dyn CallLoad> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn CallLoad>>: UnsafeUnpin,
*const ArcInner<ClientLog> is !null: UnsafeUnpin,
PhantomData<ArcInner<ClientLog>>: UnsafeUnpin,
*const ArcInner<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Chan<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>, Semaphore>>>: UnsafeUnpin,
*const dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send is !null: UnsafeUnpin,
PhantomData<dyn Future<Output = Result<OwnedPermit<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>, PollSendError<Message<Request<Body>, Pin<Box<dyn Future<Output = Result<Response<Body>, Box<dyn Error + Sync + Send>>> + Send>>>>>> + Send>: UnsafeUnpin,
*const ArcInner<Mutex<Option<ServiceError>>> is !null: UnsafeUnpin,
PhantomData<ArcInner<Mutex<Option<ServiceError>>>>: UnsafeUnpin,
*const ByteStr is !null: UnsafeUnpin,
PhantomData<ByteStr>: UnsafeUnpin,
*const u8: UnsafeUnpin,
Align8<*mut ()>: UnsafeUnpin,
&'static Vtable: UnsafeUnpin,
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