pub struct CognitiveDiff {
pub added_docs: Vec<Document>,
pub removed_doc_ids: Vec<Uuid>,
pub added_chunks: Vec<Chunk>,
pub removed_chunk_ids: Vec<Uuid>,
pub added_embeddings: Vec<Embedding>,
pub removed_embedding_ids: Vec<Uuid>,
pub added_edges: Vec<Edge>,
pub removed_edges: Vec<(Uuid, Uuid, EdgeKind)>,
pub metadata: DiffMetadata,
}Expand description
A cognitive diff containing all changes between two state roots.
Per CP-001 §2.7: devices exchange diffs rather than full state to minimize bandwidth and computation.
Note: there is no updated_docs — updates are modeled as
remove + add (per spec pattern).
Fields§
§added_docs: Vec<Document>Documents added in this diff
removed_doc_ids: Vec<Uuid>IDs of documents removed
added_chunks: Vec<Chunk>Chunks added
removed_chunk_ids: Vec<Uuid>IDs of chunks removed
added_embeddings: Vec<Embedding>Embeddings added
removed_embedding_ids: Vec<Uuid>IDs of embeddings removed
added_edges: Vec<Edge>Edges added
removed_edges: Vec<(Uuid, Uuid, EdgeKind)>Edges removed — identified by (source, target, kind) triple
metadata: DiffMetadataDiff metadata
Implementations§
Source§impl CognitiveDiff
impl CognitiveDiff
Trait Implementations§
Source§impl Clone for CognitiveDiff
impl Clone for CognitiveDiff
Source§fn clone(&self) -> CognitiveDiff
fn clone(&self) -> CognitiveDiff
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 moreSource§impl Debug for CognitiveDiff
impl Debug for CognitiveDiff
Source§impl<'de> Deserialize<'de> for CognitiveDiff
impl<'de> Deserialize<'de> for CognitiveDiff
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
Source§impl PartialEq for CognitiveDiff
impl PartialEq for CognitiveDiff
Source§impl Serialize for CognitiveDiff
impl Serialize for CognitiveDiff
impl Eq for CognitiveDiff
Auto Trait Implementations§
impl Freeze for CognitiveDiff
impl RefUnwindSafe for CognitiveDiff
impl Send for CognitiveDiff
impl Sync for CognitiveDiff
impl Unpin for CognitiveDiff
impl UnsafeUnpin for CognitiveDiff
impl UnwindSafe for CognitiveDiff
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