use core::fmt;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Refusal {
Throttled,
Full,
Overflow,
}
impl fmt::Display for Refusal {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str(match self {
Self::Throttled => "the limit is spent at this instant",
Self::Full => "the shard tracks as many keys as it may",
Self::Overflow => "the TAT would pass Duration::MAX",
})
}
}
impl core::error::Error for Refusal {}