pub enum LedgerError {
UnknownEvent {
event: String,
known: Vec<String>,
},
MissingField {
event: String,
field: String,
},
Vocabulary {
path: PathBuf,
reason: String,
},
Write {
path: PathBuf,
reason: String,
},
}Expand description
Why a line was not written.
Every variant is a refusal to corrupt the record, never a partial write: the line is composed and validated in full before the file is opened.
use majordomus_cli::ledger::LedgerError;
let e = LedgerError::MissingField { event: "plan_evidence".into(), field: "covers".into() };
assert_eq!(e.to_string(), "event 'plan_evidence' is missing the required field 'covers'");Variants§
UnknownEvent
The event name is not declared in share/events.yaml.
Fields
MissingField
The event is declared, but the payload omits a key the declaration requires.
Vocabulary
share/events.yaml could not be read or does not parse.
Write
The line was composed and the file could not be appended to.
Trait Implementations§
Source§impl Clone for LedgerError
impl Clone for LedgerError
Source§fn clone(&self) -> LedgerError
fn clone(&self) -> LedgerError
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 LedgerError
impl Debug for LedgerError
Source§impl Display for LedgerError
impl Display for LedgerError
impl Eq for LedgerError
Source§impl Error for LedgerError
impl Error for LedgerError
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 LedgerError
impl PartialEq for LedgerError
Source§fn eq(&self, other: &LedgerError) -> bool
fn eq(&self, other: &LedgerError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LedgerError
Auto Trait Implementations§
impl Freeze for LedgerError
impl RefUnwindSafe for LedgerError
impl Send for LedgerError
impl Sync for LedgerError
impl Unpin for LedgerError
impl UnsafeUnpin for LedgerError
impl UnwindSafe for LedgerError
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.