#[non_exhaustive]pub struct SlowModeError {
pub retry_after: UTCDate,
}Expand description
Outcome of a ChatAccessPolicy::slow_mode_check rejection.
Per draft-atwood-jmap-chat-00 §Chat slowModeSeconds plus spec commit
de60acb (2026-05-11) which softened the manage-channels exemption to
SHOULD: a non-exempt member who sends faster than the configured rate
MUST be rejected with a rateLimit SetError (RFC 8620 §5.3) carrying a
serverRetryAfter UTCDate that tells the client when it may retry.
retry_after is a fully-formed jmap_types::UTCDate — the backend
has already done the arithmetic (typically “now + remaining slow-mode
window”). The handler serialises it verbatim onto the wire as the
serverRetryAfter SetError extra field.
#[non_exhaustive] preserves the ability to add fields without a
SemVer break (e.g. an error code, sender-facing retry hint string,
“this is your N-th throttle in M minutes” diagnostic counter).
External consumers MUST construct instances via SlowModeError::new
rather than field-init syntax.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.retry_after: UTCDateWhen the rate-limited sender may retry.
Implementations§
Source§impl SlowModeError
impl SlowModeError
Sourcepub const fn new(retry_after: UTCDate) -> Self
pub const fn new(retry_after: UTCDate) -> Self
Construct a SlowModeError from a precomputed retry-after
UTCDate.
Trait Implementations§
Source§impl Clone for SlowModeError
impl Clone for SlowModeError
Source§impl Debug for SlowModeError
impl Debug for SlowModeError
Source§impl Display for SlowModeError
impl Display for SlowModeError
Source§impl Error for SlowModeError
impl Error for SlowModeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl Forget for SlowModeError
impl Freeze for SlowModeError
impl Move for SlowModeError
impl RefUnwindSafe for SlowModeError
impl Send for SlowModeError
impl Sync for SlowModeError
impl Unpin for SlowModeError
impl UnsafeUnpin for SlowModeError
impl UnwindSafe for SlowModeError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.