Skip to main content

Reader

Trait Reader 

Source
pub trait Reader {
    // Required method
    fn read(
        &self,
        src: &str,
        file: &Path,
        path: PathBuf,
        includes: &[PathBuf],
    ) -> Result<ForeignModule, String>;
}
Expand description

One foreign language’s reader.

Required Methods§

Source

fn read( &self, src: &str, file: &Path, path: PathBuf, includes: &[PathBuf], ) -> Result<ForeignModule, String>

The exported functions of src. file is where it is on disk, so a C file’s #include "sibling.h" resolves against its own directory; path is the module’s identity (see ForeignModules); the two coincide in tests. includes join a C file’s include path.

§Errors

A message for a diagnostic at the import naming the file.

Implementors§