pub enum TimeMutationError {
UnknownEntry {
entry_id: String,
},
DuplicateEntryId {
entry_id: String,
},
PaddedEntryId {
entry_id: String,
},
EmptyEdit {
entry_id: String,
},
InvalidEntry {
entry_id: String,
problems: Vec<TimeEntryError>,
},
MissingActor,
InvalidTimestamp {
timestamp: String,
},
MissingReason {
action: &'static str,
},
UnsafeHistoryText {
field: &'static str,
hazard: &'static str,
},
}Expand description
Why a mutation was refused, before anything was written.
Every variant is raised by intent, which cannot write: reaching one of these
is the guarantee that the issue’s bytes and History are untouched. A replacement
entry’s own field problems are carried as WP01’s TimeEntryError values rather
than re-spelled, so the CLI, the TUI, MCP and tix lint report one condition
under one name (C-006).
Variants§
UnknownEntry
The issue carries no entry with this id, so there is nothing to edit or delete.
DuplicateEntryId
A create named an id already in use — in the current projection, or in any time event this issue’s History records.
The History half is what makes “ids are never reused” true rather than aspirational (C-008): a deleted entry leaves no frontmatter trace, and re-adding its id would make the audit trail read as a correction of an entry that no longer exists.
PaddedEntryId
A create named an id padded with leading or trailing whitespace.
An id is an identity, and padding makes two different strings out of one
entry: entry_id_in trims what it recovers from an event, so a stored
e-abc and a stored e-abc would both answer Some("e-abc") — the second
create is let through while the stored ids disagree, and an id that was
deleted comes back under the padded spelling. The crate already refuses a
padded name where the name becomes an identity
(crate::projects::duplicate_name_reason, crate::config’s id rule).
EmptyEdit
An edit named no field, so it asks for nothing.
InvalidEntry
The replacement entry failed validation; the problems are field-aware.
Fields
problems: Vec<TimeEntryError>Every field-level problem, in field order.
MissingActor
The mutation has no actor to attribute it to.
InvalidTimestamp
The supplied instant is not the crate’s RFC 3339 shape.
MissingReason
An edit or a delete carried no reason, which the contract requires.
UnsafeHistoryText
Text that cannot enter a one-line ## History entry.
Implementations§
Source§impl TimeMutationError
impl TimeMutationError
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
The stable, snake_case name a surface reports this refusal under.
A replacement entry’s problem reports its own field-aware kind —
invalid_duration, invalid_date, missing_author, malformed_entry from
data-model.md §5 — so a bad duration is one condition with one name whether
it was read from a file or supplied to a mutation.
Trait Implementations§
Source§impl Clone for TimeMutationError
impl Clone for TimeMutationError
Source§impl Debug for TimeMutationError
impl Debug for TimeMutationError
Source§impl Display for TimeMutationError
impl Display for TimeMutationError
impl Eq for TimeMutationError
Source§impl Error for TimeMutationError
impl Error for TimeMutationError
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<TimeMutationError> for TixError
A refusal becomes user input error, so ? works at the call site.
impl From<TimeMutationError> for TixError
A refusal becomes user input error, so ? works at the call site.
<kind>: <message> is already a single-line diagnostic, so it takes the crate’s
existing invalid input: prefix without doubling it — the same boundary
crate::projects::ProjectError crosses.
Source§fn from(err: TimeMutationError) -> TixError
fn from(err: TimeMutationError) -> TixError
Source§impl PartialEq for TimeMutationError
impl PartialEq for TimeMutationError
impl StructuralPartialEq for TimeMutationError
Auto Trait Implementations§
impl Freeze for TimeMutationError
impl RefUnwindSafe for TimeMutationError
impl Send for TimeMutationError
impl Sync for TimeMutationError
impl Unpin for TimeMutationError
impl UnsafeUnpin for TimeMutationError
impl UnwindSafe for TimeMutationError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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 moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more