Skip to main content

SetErrorType

Enum SetErrorType 

Source
#[non_exhaustive]
pub enum SetErrorType {
Show 24 variants Forbidden, OverQuota, TooLarge, RateLimit, NotFound, InvalidPatch, WillDestroy, InvalidProperties, Singleton, AlreadyExists, MailboxHasChild, MailboxHasEmail, TooManyKeywords, TooManyMailboxes, BlobNotFound, ForbiddenFrom, InvalidEmail, TooManyRecipients, NoRecipients, InvalidRecipients, ForbiddenMailFrom, ForbiddenToSend, CannotUnsend, Custom(String),
}
Expand description

The machine-readable type for a SetError (RFC 8620 §5.3 and RFC 8621).

Extension crates define their own error strings via SetErrorType::custom rather than adding variants here. This keeps the base crate stable as new JMAP extension crates (calendar, contacts, etc.) are added.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Forbidden

The action would violate an ACL or other access control policy.

§

OverQuota

Creating or modifying the object would exceed a server quota.

§

TooLarge

The object is too large to be stored by the server.

§

RateLimit

The server is rate-limiting this client.

§

NotFound

The object to be updated or destroyed does not exist.

§

InvalidPatch

The patch object is not a valid JSON Merge Patch or cannot be applied.

§

WillDestroy

The client requested destruction of an object that will be destroyed implicitly when another object is destroyed.

§

InvalidProperties

One or more properties have invalid values.

§

Singleton

The object type is a singleton and cannot be created or destroyed.

§

AlreadyExists

An object with the same unique key already exists.

§

MailboxHasChild

RFC 8621 §2.5 — Mailbox has child mailboxes and cannot be destroyed.

§

MailboxHasEmail

RFC 8621 §2.5 — Mailbox contains emails and onDestroyRemoveEmails is false.

§

TooManyKeywords

RFC 8621 §5.5 — Too many keywords on the Email.

§

TooManyMailboxes

RFC 8621 §5.5 — Email is in too many mailboxes.

§

BlobNotFound

RFC 8621 §5.5 — A referenced blob was not found.

§

ForbiddenFrom

RFC 8621 §6.3 — The from address is not permitted for this Identity.

§

InvalidEmail

RFC 8621 §7.5 — The Email is invalid for submission.

§

TooManyRecipients

RFC 8621 §7.5 — Too many recipients.

§

NoRecipients

RFC 8621 §7.5 — No recipients specified.

§

InvalidRecipients

RFC 8621 §7.5 — One or more recipient addresses are invalid.

§

ForbiddenMailFrom

RFC 8621 §7.5 — The MAIL FROM address is not permitted.

§

ForbiddenToSend

RFC 8621 §7.5 — The user does not have send permission.

§

CannotUnsend

RFC 8621 §7.5 — The submission cannot be undone.

§

Custom(String)

An extension-defined error type not covered by the variants above. Serializes as the inner string directly (e.g. "mdnAlreadySent").

Implementations§

Source§

impl SetErrorType

Source

pub fn custom(s: impl Into<String>) -> Self

Construct a SetErrorType::Custom from any string.

Use this in extension crates to emit domain-specific error types without adding variants to this enum.

Trait Implementations§

Source§

impl Clone for SetErrorType

Source§

fn clone(&self) -> SetErrorType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SetErrorType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SetErrorType

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SetErrorType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SetErrorType

Source§

fn eq(&self, other: &SetErrorType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SetErrorType

Source§

fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SetErrorType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,