Trait futhark_bindgen::Generate
source · [−]pub trait Generate {
fn bindings(
&mut self,
_pkg: &Package,
_config: &mut Config
) -> Result<(), Error>;
fn array_type(
&mut self,
pkg: &Package,
config: &mut Config,
name: &str,
ty: &ArrayType
) -> Result<(), Error>;
fn opaque_type(
&mut self,
pkg: &Package,
config: &mut Config,
name: &str,
ty: &OpaqueType
) -> Result<(), Error>;
fn entry(
&mut self,
pkg: &Package,
config: &mut Config,
name: &str,
entry: &Entry
) -> Result<(), Error>;
fn generate(
&mut self,
pkg: &Package,
config: &mut Config
) -> Result<(), Error> { ... }
fn format(&mut self, _output: &Path) -> Result<(), Error> { ... }
}Required Methods
Step 1: generate any setup code or low-level bindings
Step 2: generate code for array types
sourcefn opaque_type(
&mut self,
pkg: &Package,
config: &mut Config,
name: &str,
ty: &OpaqueType
) -> Result<(), Error>
fn opaque_type(
&mut self,
pkg: &Package,
config: &mut Config,
name: &str,
ty: &OpaqueType
) -> Result<(), Error>
Step 3: generate code for opaque types
Provided Methods
Iterates through the manifest and generates code