pub enum ActionError {
Automerge(AutomergeError),
UnknownType(String),
Decode {
type_id: String,
source: Error,
},
Encode(Error),
Refused(String),
Unavailable {
code: String,
message: String,
},
Declined(Declined),
}Expand description
Errors from encoding, decoding, or applying an action.
Variants§
Automerge(AutomergeError)
The action’s apply hit an Automerge error.
UnknownType(String)
No decoder is registered for this action’s type_id.
Decode
The payload could not be deserialized into the registered type.
Encode(Error)
The concrete action could not be serialized into a payload.
Refused(String)
The action was well-formed and the app declined to carry it out, in its own words. Every other variant is a plumbing fault; this one is the app answering — a caller must tell “I asked wrongly” from “I asked correctly and the answer is no”.
The app declined for a reason a caller acts on rather than reads: the
thing it would add is there already, say. code names it stably, and
message says it in words for whoever reads.
Declined(Declined)
The app declined for one of the reasons a window tells the person in
their own language (Declined): a caller can say what happened
instead of showing them the plumbing.
Trait Implementations§
Source§impl Debug for ActionError
impl Debug for ActionError
Source§impl Display for ActionError
impl Display for ActionError
Source§impl Error for ActionError
impl Error for ActionError
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()
Source§impl From<ActionError> for Refusal
An action’s refusal as a verb’s, for a reader above the action that hands
it on: one a caller decides on keeps its code.
impl From<ActionError> for Refusal
An action’s refusal as a verb’s, for a reader above the action that hands it on: one a caller decides on keeps its code.
Source§fn from(error: ActionError) -> Self
fn from(error: ActionError) -> Self
Source§impl From<AutomergeError> for ActionError
impl From<AutomergeError> for ActionError
Source§fn from(source: AutomergeError) -> Self
fn from(source: AutomergeError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ActionError
impl !UnwindSafe for ActionError
impl Forget for ActionError
impl Freeze for ActionError
impl Move for ActionError
impl Send for ActionError
impl Sync for ActionError
impl Unpin for ActionError
impl UnsafeUnpin for ActionError
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more