pub struct StatisticsWatch { /* private fields */ }Expand description
Подписка на последнее значение одного показателя. Промежуточные обновления могут быть объединены, если читатель отстаёт.
Implementations§
Source§impl StatisticsWatch
impl StatisticsWatch
Sourcepub fn latest(&self) -> Option<Statistic>
pub fn latest(&self) -> Option<Statistic>
Последнее полученное значение; None, пока сервис не прислал ни
одного.
Sourcepub fn subscribe(&self) -> Receiver<Option<Statistic>>
pub fn subscribe(&self) -> Receiver<Option<Statistic>>
Приёмник watch для ожидания изменений в async-коде.
Sourcepub async fn close(self) -> Result<(), StatisticsError>
pub async fn close(self) -> Result<(), StatisticsError>
Прекращает наблюдение и дожидается, пока это будет сделано.
Trait Implementations§
Source§impl Drop for StatisticsWatch
impl Drop for StatisticsWatch
Auto Trait Implementations§
impl !RefUnwindSafe for StatisticsWatch
impl !UnwindSafe for StatisticsWatch
impl Freeze for StatisticsWatch
impl Send for StatisticsWatch
impl Sync for StatisticsWatch
impl Unpin for StatisticsWatch
impl UnsafeUnpin for StatisticsWatch
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