Trait debian_analyzer::editor::Editor

source ·
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 commit(&self) -> Result<Vec<&Path>, EditorError>;

    // Provided method
    fn has_changed(&self) -> bool { ... }
}

Required Methods§

source

fn orig_content(&self) -> Option<&[u8]>

The original content, if any - without reformatting

source

fn updated_content(&self) -> Option<Vec<u8>>

The updated content, if any

source

fn rewritten_content(&self) -> Option<&[u8]>

The original content, but rewritten with our parser/serializer

source

fn commit(&self) -> Result<Vec<&Path>, EditorError>

Commit the changes

§Returns

A list of paths that were changed

Provided Methods§

source

fn has_changed(&self) -> bool

Whether the file has changed

Implementors§

source§

impl<'a, P: Marshallable> Editor<P> for TreeEditor<'a, P>

source§

impl<P: Marshallable> Editor<P> for FsEditor<P>