pub trait Editor<P: Marshallable>: Deref<Target = P> + DerefMut<Target = P> {
// Required methods
fn orig_content(&self) -> Option<&[u8]>;
fn updated_content(&self) -> Option<Vec<u8>>;
fn rewritten_content(&self) -> Option<&[u8]>;
fn is_generated(&self) -> bool;
fn commit(&self) -> Result<Vec<PathBuf>, EditorError>;
// Provided method
fn has_changed(&self) -> bool { ... }
}Expand description
An editor for a file
Required Methods§
Sourcefn orig_content(&self) -> Option<&[u8]>
fn orig_content(&self) -> Option<&[u8]>
The original content, if any - without reformatting
Sourcefn updated_content(&self) -> Option<Vec<u8>>
fn updated_content(&self) -> Option<Vec<u8>>
The updated content, if any
Sourcefn rewritten_content(&self) -> Option<&[u8]>
fn rewritten_content(&self) -> Option<&[u8]>
The original content, but rewritten with our parser/serializer
Sourcefn is_generated(&self) -> bool
fn is_generated(&self) -> bool
Check if the file is generated
Provided Methods§
Sourcefn has_changed(&self) -> bool
fn has_changed(&self) -> bool
Whether the file has changed