Skip to main content

MethodErrorType

Enum MethodErrorType 

Source
#[non_exhaustive]
pub enum MethodErrorType {
Show 24 variants UnknownCapability, NotJson, NotRequest, Limit, ServerUnavailable, ServerFail, ServerPartialFail, UnknownMethod, InvalidArguments, InvalidResultReference, Forbidden, AccountNotFound, AccountNotSupportedByMethod, AccountReadOnly, RequestTooLarge, CannotCalculateChanges, StateMismatch, FromAccountNotFound, FromAccountNotSupportedByMethod, AnchorNotFound, UnsupportedSort, UnsupportedFilter, TooManyChanges, Other(String),
}
Expand description

The machine-readable type of a JmapError.

Known variants are the RFC 8620 request-level error types (§3.6.1, whose wire form in an RFC 7807 problem-details body is prefixed with urn:ietf:params:jmap:error:), the §3.6.2 method-level error types, and the method-specific errors of §5.1 to §5.6. Every other wire string, including extension errors such as "rateLimited", is Self::Other.

From<&str> and Deserialize share one mapping: a known wire string always builds its typed variant, never Other.

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.
§

UnknownCapability

RFC 8620 §3.6.1 — the request used an unsupported capability.

§

NotJson

RFC 8620 §3.6.1 — the content type was not application/json or the request did not parse as I-JSON.

§

NotRequest

RFC 8620 §3.6.1 — the request parsed as JSON but not as a Request object.

§

Limit

RFC 8620 §3.6.1 — the request exceeded a server limit; the limit’s name is JmapError::limit_name.

§

ServerUnavailable

RFC 8620 §3.6.2 — an internal server resource was temporarily unavailable.

§

ServerFail

RFC 8620 §3.6.2 — an unexpected error occurred.

§

ServerPartialFail

RFC 8620 §3.6.2 — some, but not all, expected changes were made.

§

UnknownMethod

RFC 8620 §3.6.2 — the server does not recognise this method name.

§

InvalidArguments

RFC 8620 §3.6.2 — an argument is of the wrong type or invalid.

§

InvalidResultReference

RFC 8620 §3.6.2 — a result reference failed to resolve.

§

Forbidden

RFC 8620 §3.6.2 — the method or arguments are forbidden.

§

AccountNotFound

RFC 8620 §3.6.2 — the accountId does not correspond to a valid account.

§

AccountNotSupportedByMethod

RFC 8620 §3.6.2 — the account does not support this method.

§

AccountReadOnly

RFC 8620 §3.6.2 — the account is read-only.

§

RequestTooLarge

RFC 8620 §5.1 and §5.3 — too many ids or objects in one call.

§

CannotCalculateChanges

RFC 8620 §5.2 and §5.6 — the server cannot calculate the changes from the given state.

§

StateMismatch

RFC 8620 §5.3 and §5.4 — ifInState did not match the current state.

§

FromAccountNotFound

RFC 8620 §5.4 — the fromAccountId does not correspond to a valid account.

§

FromAccountNotSupportedByMethod

RFC 8620 §5.4 — the fromAccountId account does not support this method.

§

AnchorNotFound

RFC 8620 §5.5 — the anchor was not found in the results.

§

UnsupportedSort

RFC 8620 §5.5 — the sort is syntactically valid but unsupported.

§

UnsupportedFilter

RFC 8620 §5.5 — the filter is syntactically valid but unsupported.

§

TooManyChanges

RFC 8620 §5.6 — there are more changes than maxChanges.

§

Other(String)

Any other error type, such as an extension’s.

Implementations§

Source§

impl MethodErrorType

Source

pub fn as_str(&self) -> &str

The wire string for this value: the listed string for a known variant, the stored string for Other.

Trait Implementations§

Source§

impl Clone for MethodErrorType

Source§

fn clone(&self) -> Self

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 MethodErrorType

Source§

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

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

impl<'de> Deserialize<'de> for MethodErrorType

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 MethodErrorType

Source§

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

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

impl Eq for MethodErrorType

Source§

impl From<&str> for MethodErrorType

Source§

fn from(v: &str) -> Self

Converts to this type from the input type.
Source§

impl From<String> for MethodErrorType

Source§

fn from(v: String) -> Self

Converts to this type from the input type.
Source§

impl Hash for MethodErrorType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MethodErrorType

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for MethodErrorType

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 MethodErrorType

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.