pub trait Language: Send + Sync {
// Required methods
fn id(&self) -> &'static str;
fn claims(&self, path: &[u8]) -> bool;
// Provided method
fn normalize_line(&self, line: &[u8]) -> Vec<u8> ⓘ { ... }
}Expand description
A language plugin. Every method has a working generic default, so a new language implements only what it improves on.
Required Methods§
Provided Methods§
Sourcefn normalize_line(&self, line: &[u8]) -> Vec<u8> ⓘ
fn normalize_line(&self, line: &[u8]) -> Vec<u8> ⓘ
Normalise one line’s content for shape classification: erase what varies between instances of the same edit (identifiers, literals, spacing), keep what distinguishes different edits.
This feeds the shape hash ONLY — never hunk_digest, which is the
exact-content persistence anchor.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".