pub struct TodoWriteOutcome {
pub message: String,
pub items: Vec<TodoItem>,
pub diff: TodoDiff,
}Expand description
What todo_write returns to the dispatch layer.
The dispatch layer:
- forwards
messageto the model as the tool result string; - when
diff.is_empty()isfalse, emitscrate::engine::EngineEvent::TodoUpdatewithitemsanddiffso every client sees the transition.
Splitting message (model-facing) from items + diff (client-
facing) is the same separation Claude Code’s TodoWriteTool uses
(mapToolResultToToolResultBlockParam returns a plain string
while the structured diff goes to the UI). It keeps the model’s
tool-result clean and the UI’s render data rich.
Fields§
§message: StringString returned to the model as the tool result.
items: Vec<TodoItem>Full new list, after dedup short-circuit but always populated (even on the unchanged path) so callers that want to mirror the latest list don’t have to re-read from the DB.
diff: TodoDiffServer-computed diff against the previously persisted list.
is_empty() on the unchanged path; added is non-empty on
the first write of a session.
Trait Implementations§
Source§impl Clone for TodoWriteOutcome
impl Clone for TodoWriteOutcome
Source§fn clone(&self) -> TodoWriteOutcome
fn clone(&self) -> TodoWriteOutcome
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TodoWriteOutcome
impl RefUnwindSafe for TodoWriteOutcome
impl Send for TodoWriteOutcome
impl Sync for TodoWriteOutcome
impl Unpin for TodoWriteOutcome
impl UnsafeUnpin for TodoWriteOutcome
impl UnwindSafe for TodoWriteOutcome
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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