pub struct TodoDiff {
pub added: Vec<TodoItem>,
pub removed: Vec<TodoItem>,
pub changed: Vec<TodoChange>,
}Expand description
Server-computed delta between the previously persisted todo list and the one the model just wrote.
Matching key is content. If the model renames a task the
rename surfaces as one entry in removed plus one in added,
which is the right semantic — a renamed task is conceptually a
different task to the user even if the underlying intent is the
same.
On the very first TodoWrite of a session, every item lands in
added. On a clear (todos: []), every previously persisted
item lands in removed.
Fields§
§added: Vec<TodoItem>Items present on the new list whose content is not on the old list.
removed: Vec<TodoItem>Items present on the old list whose content is not on the new list.
changed: Vec<TodoChange>Items present on both lists by content whose status or
priority changed.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TodoDiff
impl<'de> Deserialize<'de> for TodoDiff
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TodoDiff
Auto Trait Implementations§
impl Freeze for TodoDiff
impl RefUnwindSafe for TodoDiff
impl Send for TodoDiff
impl Sync for TodoDiff
impl Unpin for TodoDiff
impl UnsafeUnpin for TodoDiff
impl UnwindSafe for TodoDiff
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