#[derive(Debug)]
#[non_exhaustive]
pub(crate) enum Phase {
BeforeSerialization,
Serialization,
BeforeTransmit,
Transmit,
BeforeDeserialization,
Deserialization,
AfterDeserialization,
}
impl Phase {
pub(crate) fn is_before_serialization(&self) -> bool {
matches!(self, Self::BeforeSerialization)
}
pub(crate) fn is_serialization(&self) -> bool {
matches!(self, Self::Serialization)
}
pub(crate) fn is_before_transmit(&self) -> bool {
matches!(self, Self::BeforeTransmit)
}
pub(crate) fn is_transmit(&self) -> bool {
matches!(self, Self::Transmit)
}
pub(crate) fn is_before_deserialization(&self) -> bool {
matches!(self, Self::BeforeDeserialization)
}
pub(crate) fn is_deserialization(&self) -> bool {
matches!(self, Self::Deserialization)
}
pub(crate) fn is_after_deserialization(&self) -> bool {
matches!(self, Self::AfterDeserialization)
}
}