Trait interoptopus::Interop

source ·
pub trait Interop {
    // Required method
    fn write_to(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>;

    // Provided method
    fn write_file<P: AsRef<Path>>(&self, file_name: P) -> Result<(), Error> { ... }
}
Expand description

Main entry point for backends to generate language bindings.

This trait will be implemented by each backend and is the main way to interface with a generator.

Required Methods§

source

fn write_to(&self, w: &mut IndentWriter<'_>) -> Result<(), Error>

Generates FFI binding code and writes them to the IndentWriter.

Provided Methods§

source

fn write_file<P: AsRef<Path>>(&self, file_name: P) -> Result<(), Error>

Convenience method to write FFI bindings to the specified file with default indentation.

Object Safety§

This trait is not object safe.

Implementors§