use crate::{impl_default, std::fmt};
use super::{Method, CLOSE_BRACE, OPEN_BRACE};
#[derive(Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DisableEvent;
impl DisableEvent {
pub const fn new() -> Self {
Self {}
}
pub const fn method() -> Method {
Method::Disable
}
pub const fn to_str(&self) -> &'static str {
Self::method().to_str()
}
pub const fn len() -> usize {
1
}
}
impl From<&DisableEvent> for &'static str {
fn from(val: &DisableEvent) -> Self {
val.to_str()
}
}
impl From<DisableEvent> for &'static str {
fn from(val: DisableEvent) -> Self {
(&val).into()
}
}
impl fmt::Display for DisableEvent {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{OPEN_BRACE}\"{}\"{CLOSE_BRACE}", self.to_str())
}
}
impl_default!(DisableEvent);