#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum RedactionReason {
InputLimitReached,
OutputLimitReached,
TraversalLimitReached,
DepthLimitReached,
SourceTruncated,
InvalidJson,
InvalidUri,
InvalidContentType,
UnsupportedContentType,
InvalidForm,
InvalidMultipart,
FormattingFailed,
}
impl RedactionReason {
#[must_use]
pub(super) const fn bit(self) -> u64 {
match self {
Self::InputLimitReached => 1 << 0,
Self::OutputLimitReached => 1 << 1,
Self::TraversalLimitReached => 1 << 2,
Self::DepthLimitReached => 1 << 3,
Self::SourceTruncated => 1 << 4,
Self::InvalidJson => 1 << 5,
Self::InvalidUri => 1 << 6,
Self::InvalidContentType => 1 << 7,
Self::UnsupportedContentType => 1 << 8,
Self::InvalidForm => 1 << 9,
Self::InvalidMultipart => 1 << 10,
Self::FormattingFailed => 1 << 11,
}
}
}