pub struct Codebook { /* private fields */ }Implementations§
Source§impl Codebook
impl Codebook
pub fn new() -> Self
Sourcepub fn build_from_files(&mut self, files: &[(String, String)])
pub fn build_from_files(&mut self, files: &[(String, String)])
Build codebook from multiple file contents. Identifies lines that appear in 3+ files and creates short references.
Sourcepub fn compress(&self, content: &str) -> (String, Vec<String>)
pub fn compress(&self, content: &str) -> (String, Vec<String>)
Apply codebook to content: replace known patterns with short references. Returns (compressed content, references used).
Sourcepub fn format_legend(&self, refs_used: &[String]) -> String
pub fn format_legend(&self, refs_used: &[String]) -> String
Format the codebook legend for lines that were referenced.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Codebook
impl RefUnwindSafe for Codebook
impl Send for Codebook
impl Sync for Codebook
impl Unpin for Codebook
impl UnsafeUnpin for Codebook
impl UnwindSafe for Codebook
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