#[derive(Debug, Clone, Copy)]
#[repr(u8)]
pub(crate) enum PollState {
None,
Pending,
Ready,
}
impl PollState {
#[must_use]
#[inline]
#[allow(unused)]
pub(crate) fn is_none(&self) -> bool {
matches!(self, Self::None)
}
#[must_use]
#[inline]
pub(crate) fn is_pending(&self) -> bool {
matches!(self, Self::Pending)
}
#[must_use]
#[inline]
pub(crate) fn is_ready(&self) -> bool {
matches!(self, Self::Ready)
}
#[inline]
pub(crate) fn set_none(&mut self) {
*self = PollState::None;
}
#[inline]
#[allow(unused)]
pub(crate) fn set_pending(&mut self) {
*self = PollState::Pending;
}
#[inline]
pub(crate) fn set_ready(&mut self) {
*self = PollState::Ready;
}
}