use core::num::NonZeroUsize;
#[must_use]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub(crate) enum DecodeOutcome {
Emitted {
read: NonZeroUsize,
emitted: NonZeroUsize,
},
Skipped {
read: NonZeroUsize,
},
NeedInput {
required: NonZeroUsize,
},
}
impl DecodeOutcome {
#[inline]
pub(crate) const fn emitted(read: NonZeroUsize, emitted: NonZeroUsize) -> Self {
Self::Emitted { read, emitted }
}
#[inline]
pub(crate) const fn skipped(read: NonZeroUsize) -> Self {
Self::Skipped { read }
}
#[inline]
pub(crate) const fn need_input(required: NonZeroUsize) -> Self {
Self::NeedInput { required }
}
}