pub enum TodoError {
EmptyContent {
index: usize,
},
UnknownStatus {
index: usize,
status: String,
},
MultipleInProgress {
count: usize,
},
TooManyItems {
count: usize,
},
Unavailable(String),
}Expand description
Why a todo_write call was refused (#8235).
Why: every variant is text the MODEL reads and must be able to act on, so
each names the offending item and the fix rather than merely reporting
that something was wrong. Kept as a thiserror enum (not a bare String)
so parse_todos is unit-testable against the specific refusal.
What: the first five are validation; Self::Unavailable is the store
refusing the write (in practice: the session ended mid-run).
Test: tests::rejects_unknown_status, tests::rejects_empty_content,
tests::rejects_two_in_progress, tests::rejects_more_than_max_todos,
tests::store_failure_is_a_recoverable_tool_error.
Variants§
EmptyContent
An item’s content was empty or whitespace only.
UnknownStatus
An item’s status was not one of the three known states.
MultipleInProgress
More than one item claimed in_progress.
TooManyItems
The list was longer than MAX_TODOS.
The store could not accept the write; nothing was changed.
Trait Implementations§
impl Eq for TodoError
Source§impl Error for TodoError
impl Error for TodoError
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()
impl StructuralPartialEq for TodoError
Auto Trait Implementations§
impl Freeze for TodoError
impl RefUnwindSafe for TodoError
impl Send for TodoError
impl Sync for TodoError
impl Unpin for TodoError
impl UnsafeUnpin for TodoError
impl UnwindSafe for TodoError
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<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> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§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