pub struct Health { /* private fields */ }Expand description
Здоровье одного модуля: главная фаза, проблемы модуля и отслеживаемые зависимости.
Модуль получает дескриптор от строителя и сообщает состояние вызовами Health::set,
Health::problem и Health::track. Итоговая фаза — наихудшая из главной фазы и вклада
критических зависимостей: пока такая зависимость не готова, модуль в Starting, когда она
недоступна — в NotServing. Информационная зависимость и зависимость, на которую модуль уже
не полагается, добавляет только проблему dependency is <состояние>.
Дескриптор копируется. Изменение состояния читатели получают из Health::subscribe.
Implementations§
Source§impl Health
impl Health
Sourcepub fn problem(&self, source: impl Into<String>, message: impl Into<String>)
pub fn problem(&self, source: impl Into<String>, message: impl Into<String>)
Добавить или обновить проблему. Повторный вызов с тем же источником заменяет текст.
Sourcepub fn clear_problem(&self, source: &str)
pub fn clear_problem(&self, source: &str)
Снять проблему, добавленную Health::problem. Проблемы зависимостей снимаются их состоянием.
Sourcepub fn track(&self, dependency: &Dependency, role: DependencyRole)
pub fn track(&self, dependency: &Dependency, role: DependencyRole)
Полагаться на зависимость с указанной ролью. Повторный вызов для той же зависимости меняет роль.
Sourcepub fn snapshot(&self) -> HealthSnapshot
pub fn snapshot(&self) -> HealthSnapshot
Состояние на момент чтения.
Sourcepub fn subscribe(&self) -> Receiver<HealthSnapshot>
pub fn subscribe(&self) -> Receiver<HealthSnapshot>
Канал изменений состояния.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Health
impl Freeze for Health
impl Move for Health
impl RefUnwindSafe for Healthwhere
Atomic<usize>: RefUnwindSafe,
Mutex<State>: RefUnwindSafe,
RwLock<HealthSnapshot>: RefUnwindSafe,
AtomicUsize: RefUnwindSafe,
Notify: RefUnwindSafe,
impl Send for Health
impl Sync for Health
impl Unpin for Health
impl UnsafeUnpin for Health
impl UnwindSafe for Healthwhere
Arc<Inner>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
T in a tonic::Request