Skip to main content

HealthClient

Struct HealthClient 

Source
pub struct HealthClient { /* private fields */ }
Expand description

Клиент проверки состояния соседа.

Implementations§

Source§

impl HealthClient

Source

pub async fn check( &mut self, context: &CallContext, service: impl Into<String>, ) -> Result<HealthCheckResponse, ClientError>

Состояние службы service по имени.

§Ошибки

Неизвестное имя — NOT_FOUND; сосед недоступен — UNAVAILABLE.

Source

pub async fn check_response( &mut self, context: &CallContext, service: impl Into<String>, ) -> Result<Response<HealthCheckResponse>, ClientError>

Состояние службы вместе с метаданными ответа.

Метаданные включают заголовки и трейлеры: транспорт склеивает их в один набор.

§Ошибки

Неизвестное имя — NOT_FOUND; сосед недоступен — UNAVAILABLE.

Source

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 HealthClient
where 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 HealthClient
where 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 HealthClient
where 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 HealthClient
where *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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more