#[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()
Auto Trait Implementations§
impl<E> Forget for BackendSetError<E>
impl<E> Freeze for BackendSetError<E>where
E: Freeze,
impl<E> Move for BackendSetError<E>
impl<E> RefUnwindSafe for BackendSetError<E>where
E: RefUnwindSafe,
impl<E> Send for BackendSetError<E>where
E: Send,
impl<E> Sync for BackendSetError<E>where
E: Sync,
impl<E> Unpin for BackendSetError<E>where
E: Unpin,
impl<E> UnsafeUnpin for BackendSetError<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for BackendSetError<E>where
E: UnwindSafe,
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
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.