pub struct TelegramReportHealthSender { /* private fields */ }Expand description
A HealthReportSender implementation that sends health reports via Telegram.
This sender uses the teloxide library to send a message containing the
health report to a specific chat. It also attempts to delete the previously sent
message to avoid cluttering the chat.
Note: This implementation assumes only one message is being managed at a time. Deleting the previous message is done by subtracting 1 from the current message ID, which is a simple but not fully robust approach.
§Examples
use teloxide::types::ChatId;
use bloop_server_framework::health_monitor::{
telegram::TelegramReportHealthSender
};
let sender = TelegramReportHealthSender::new(
"your-bot-token",
ChatId(123456)
);Implementations§
Trait Implementations§
Source§impl Debug for TelegramReportHealthSender
impl Debug for TelegramReportHealthSender
Auto Trait Implementations§
impl !RefUnwindSafe for TelegramReportHealthSender
impl !UnwindSafe for TelegramReportHealthSender
impl Freeze for TelegramReportHealthSender
impl Send for TelegramReportHealthSender
impl Sync for TelegramReportHealthSender
impl Unpin for TelegramReportHealthSender
impl UnsafeUnpin for TelegramReportHealthSender
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> Erasable for T
impl<T> Erasable for T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more