#[non_exhaustive]pub enum TransitionError {
Unauthenticated,
Forbidden,
NotFrom(String),
Guard(String),
Conflict,
Unknown(String),
ReasonRequired,
Failed(Error),
}Expand description
Why a transition did not run.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unauthenticated
Nobody is logged in and the transition is not a system one.
Forbidden
The user may not run this transition (or it is a system transition and a user tried).
NotFrom(String)
The record is not in a state the transition leaves; holds the state it is in.
Guard(String)
A guard said no; holds its message, safe to show.
Conflict
The record changed under the transition (another one ran first).
Unknown(String)
The machine has no transition of this name.
ReasonRequired
A reason_required transition ran without a reason.
Failed(Error)
Anything else (the database, an effect).
Implementations§
Source§impl TransitionError
impl TransitionError
Sourcepub fn into_error(self) -> Error
pub fn into_error(self) -> Error
The crate::Error it answers as: 401 for Unauthenticated, 403
for Forbidden, 404 for Unknown, 422 (with the message) for
NotFrom, Guard, Conflict and ReasonRequired; a Failed error
is passed through. (No From, which the blanket From<E: Into<anyhow::Error>>
impl of Error rules out.)
Trait Implementations§
Source§impl Debug for TransitionError
impl Debug for TransitionError
Source§impl Display for TransitionError
impl Display for TransitionError
Source§impl Error for TransitionError
impl Error for TransitionError
1.30.0 · 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<DbError> for TransitionError
impl From<DbError> for TransitionError
Source§impl From<Error> for TransitionError
impl From<Error> for TransitionError
Source§impl IntoResponse for TransitionError
impl IntoResponse for TransitionError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Answers as TransitionError::into_error, so a handler can return
Result<_, TransitionError>.
Auto Trait Implementations§
impl Freeze for TransitionError
impl RefUnwindSafe for TransitionError
impl Send for TransitionError
impl Sync for TransitionError
impl Unpin for TransitionError
impl UnsafeUnpin for TransitionError
impl UnwindSafe for TransitionError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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