use super::MethodCall;
use tokio::time::Elapsed;
#[derive(Debug)]
pub enum PollingSetup {
DeleteWebhook(MethodCall),
DeleteWebhookTimeout(Elapsed),
}
impl PollingSetup {
#[must_use]
pub fn is_delete_webhook(&self) -> bool {
match self {
Self::DeleteWebhook(..) => true,
_ => false,
}
}
#[must_use]
pub fn is_delete_webhook_timeout(&self) -> bool {
match self {
Self::DeleteWebhookTimeout(..) => true,
_ => false,
}
}
}
impl From<MethodCall> for PollingSetup {
#[must_use]
fn from(error: MethodCall) -> Self {
Self::DeleteWebhook(error)
}
}
impl From<Elapsed> for PollingSetup {
#[must_use]
fn from(error: Elapsed) -> Self {
Self::DeleteWebhookTimeout(error)
}
}