pub trait FieldCursor:
Default
+ Clone
+ Debug {
type Changes: ChangeReport;
// Required methods
fn diff<D: ReadDoc>(&self, doc: &D, obj: &ObjId) -> Result<Self::Changes>;
fn refresh<D: ReadDoc>(&mut self, doc: &D, obj: &ObjId) -> Result<()>;
// Provided method
fn has_changes<D: ReadDoc>(&self, doc: &D, obj: &ObjId) -> Result<bool> { ... }
}Expand description
Trait for cursor types that cache ObjIds for O(1) change detection.
Cursors are generated for structs and cache the ObjId of each field. When checking for changes, the cursor compares its cached ObjIds against the document’s current ObjIds, avoiding expensive value deserialization.
Required Associated Types§
Sourcetype Changes: ChangeReport
type Changes: ChangeReport
The associated change report type.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.