[][src]Trait c2rust_refactor::file_io::FileIO

pub trait FileIO {
    fn read_file(&self, path: &Path) -> Result<String>;
fn write_file(&self, path: &Path, s: &str) -> Result<()>; fn end_rewrite(&self, sm: &SourceMap) -> Result<()> { ... }
fn file_exists(&self, path: &Path) -> bool { ... }
fn abs_path(&self, path: &Path) -> Result<PathBuf> { ... }
fn save_rewrites(
        &self,
        sm: &SourceMap,
        sf: &SourceFile,
        rws: &[TextRewrite],
        nodes: &[(Span, NodeId)]
    ) -> Result<()> { ... }
fn save_marks(
        &self,
        krate: &Crate,
        sm: &SourceMap,
        node_id_map: &HashMap<NodeId, NodeId>,
        marks: &HashSet<(NodeId, Symbol)>
    ) -> Result<()> { ... } }

Required methods

fn read_file(&self, path: &Path) -> Result<String>

fn write_file(&self, path: &Path, s: &str) -> Result<()>

Loading content...

Provided methods

fn end_rewrite(&self, sm: &SourceMap) -> Result<()>

Called to indicate the end of a rewriting operation. Any save_file or save_rewrites operations since the previous end_rewrite (or since the construction of the FileIO object) are part of the logical rewrite.

fn file_exists(&self, path: &Path) -> bool

fn abs_path(&self, path: &Path) -> Result<PathBuf>

fn save_rewrites(
    &self,
    sm: &SourceMap,
    sf: &SourceFile,
    rws: &[TextRewrite],
    nodes: &[(Span, NodeId)]
) -> Result<()>

fn save_marks(
    &self,
    krate: &Crate,
    sm: &SourceMap,
    node_id_map: &HashMap<NodeId, NodeId>,
    marks: &HashSet<(NodeId, Symbol)>
) -> Result<()>

Loading content...

Implementors

impl FileIO for RealFileIO[src]

fn file_exists(&self, path: &Path) -> bool[src]

fn abs_path(&self, path: &Path) -> Result<PathBuf>[src]

Loading content...