pub trait DiffDecorator:
Debug
+ Send
+ Sync {
// Provided methods
fn file(&self, file: FileId) -> FileDecoration { ... }
fn hunk(&self, file: FileId, hunk: HunkId) -> HunkDecoration { ... }
}Expand description
Source of per-file and per-hunk decorations overlaid on a rendered diff.
Methods are queried during rendering, so they must be cheap and free of side effects. The default implementations return empty decorations, so a host only overrides the parts it uses.
Provided Methods§
Sourcefn file(&self, file: FileId) -> FileDecoration
fn file(&self, file: FileId) -> FileDecoration
Returns the decoration for the given file’s header row.
Sourcefn hunk(&self, file: FileId, hunk: HunkId) -> HunkDecoration
fn hunk(&self, file: FileId, hunk: HunkId) -> HunkDecoration
Returns the decoration for the given hunk.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".