#[non_exhaustive]pub struct SlowModeError {
pub retry_after: UTCDate,
}Expand description
Outcome of a ChatBackend::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 rateLimited SetError 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()