#[non_exhaustive]pub enum BackendSetError<E> {
SetError(Box<SetError>),
Other(E),
}Expand description
Error type returned by create/update/destroy backend methods.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SetError(Box<SetError>)
A well-typed JMAP SetError to place verbatim in the
notCreated/notUpdated/notDestroyed map.
Boxed so the Err arm of a backend Result stays pointer-sized
(SetError is over 200 bytes; clippy result_large_err).
Other(E)
An unexpected storage-layer error.
Implementations§
Source§impl<E: Display> BackendSetError<E>
impl<E: Display> BackendSetError<E>
Sourcepub fn into_set_error_or_method_error(self) -> Result<SetError, JmapError>
pub fn into_set_error_or_method_error(self) -> Result<SetError, JmapError>
Split into the per-object SetError (Ok) or a redacted
method-level serverFail (Err).
RFC 8620 §5.3 places a per-object SetError in the
notCreated/notUpdated/notDestroyed map, so the SetError
variant is returned unchanged for the caller to insert there.
Other becomes
JmapError::server_fail(SERVER_FAIL_INTERNAL_DESC): the inner
error’s Display text never reaches the wire (bd:JMAP-jfia.36).
There is deliberately no From<BackendSetError<E>> for JmapError:
a ? on that impl would turn per-object set errors into
method-level errors.
§Errors
Trait Implementations§
Source§impl<E: Debug> Debug for BackendSetError<E>
impl<E: Debug> Debug for BackendSetError<E>
Source§impl<E: Display> Display for BackendSetError<E>
impl<E: Display> Display for BackendSetError<E>
Source§impl<E: Error + 'static> Error for BackendSetError<E>
impl<E: Error + 'static> Error for BackendSetError<E>
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()