pub enum TransitionError {
NoSuchIssue(String),
Refused(String),
Write {
path: PathBuf,
reason: String,
},
}Expand description
Why a transition did not happen.
Each variant carries what the caller needs to act, never only that it failed: which status the issue is actually in, which dependency holds it, which evidence token is missing. The messages are the shell’s messages.
use majordomus_cli::plan::TransitionError;
// A refusal says what is in the way, because that is the thing the caller can change.
let refused = TransitionError::Refused("I0001 is DONE, not READY".into());
assert_eq!(refused.to_string(), "I0001 is DONE, not READY");
// A missing issue is a different answer from an illegal move, and callers map them to
// different statuses: not_found rather than refused.
let missing = TransitionError::NoSuchIssue("I9999".into());
assert_eq!(missing.to_string(), "no issue 'I9999'");
assert_ne!(missing, refused);Variants§
NoSuchIssue(String)
No issue of that id.
Refused(String)
The move is illegal from the status the issue is in.
Write
The record could not be rewritten.
Trait Implementations§
Source§impl Clone for TransitionError
impl Clone for TransitionError
Source§fn clone(&self) -> TransitionError
fn clone(&self) -> TransitionError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TransitionError
impl Debug for TransitionError
Source§impl Display for TransitionError
impl Display for TransitionError
impl Eq 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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for TransitionError
impl PartialEq for TransitionError
Source§fn eq(&self, other: &TransitionError) -> bool
fn eq(&self, other: &TransitionError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for 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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.