pub struct Generator { /* private fields */ }
Expand description

Start here, main converter implementing Interop.

Implementations§

source§

impl Generator

source

pub fn new(config: Config, library: Inventory) -> Self

source

pub fn add_overload_writer( &mut self, writer: Box<dyn OverloadWriter> ) -> &mut Self

Trait Implementations§

source§

impl CSharpWriter for Generator

source§

fn config(&self) -> &Config

Returns the user config.
source§

fn inventory(&self) -> &Inventory

Returns the library to produce bindings for.
source§

fn converter(&self) -> &Converter

source§

fn overloads(&self) -> &[Box<dyn OverloadWriter>]

source§

fn helper(&self) -> Helper<'_>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn write_function( &self, w: &mut IndentWriter<'_>, function: &Function, write_for: WriteFor ) -> Result<(), Error>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn write_type_definition_enum( &self, w: &mut IndentWriter<'_>, the_type: &EnumType, write_for: WriteFor ) -> Result<(), Error>

source§

fn write_type_definition_enum_variant( &self, w: &mut IndentWriter<'_>, variant: &Variant, _the_type: &EnumType, write_for: WriteFor ) -> Result<(), Error>

source§

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

source§

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

source§

fn write_type_definition_composite_body( &self, w: &mut IndentWriter<'_>, the_type: &CompositeType, write_for: WriteFor ) -> Result<(), Error>

source§

fn write_type_definition_composite_body_field( &self, w: &mut IndentWriter<'_>, field: &Field, the_type: &CompositeType ) -> Result<(), Error>

source§

fn namespace_for_id(&self, id: &str) -> String

source§

fn write_namespace_context( &self, w: &mut IndentWriter<'_>, f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error> ) -> Result<(), Error>

source§

fn write_class_context( &self, class_name: &str, w: &mut IndentWriter<'_>, f: impl FnOnce(&mut IndentWriter<'_>) -> Result<(), Error> ) -> Result<(), Error>

source§

fn should_emit_delegate(&self) -> bool

source§

fn has_emittable_functions(&self, functions: &[Function]) -> bool

source§

fn has_emittable_constants(&self, constants: &[Constant]) -> bool

source§

fn should_emit_by_meta(&self, meta: &Meta) -> bool

source§

fn should_emit_by_type(&self, t: &CType) -> bool

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn write_pattern_service_method( &self, w: &mut IndentWriter<'_>, class: &Service, function: &Function, rval: &str, fn_name: &str, write_contxt_by_ref: bool, is_ctor: bool, write_for: WriteFor ) -> Result<(), Error>

source§

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

source§

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

source§

impl Interop for Generator

source§

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

Generates FFI binding code and writes them to the IndentWriter.
source§

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

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.