Generator

Struct Generator 

Source
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

Trait Implementations§

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.
Source§

impl PythonWriter 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

Returns the library to produce bindings for.
Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn write_slice( &self, w: &mut IndentWriter<'_>, c: &CompositeType, mutable: bool, ) -> Result<(), Error>

Source§

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

Source§

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

Source§

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

Source§

fn write_pattern_class_ctor( &self, w: &mut IndentWriter<'_>, class: &Service, ctor: &Function, write_for: WriteFor, ) -> Result<(), Error>

Source§

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

Source§

fn write_library_call( &self, w: &mut IndentWriter<'_>, function: &Function, class_str: Option<&str>, ) -> Result<(), Error>

Source§

fn function_args_to_string( &self, function: &Function, type_hints: bool, skip_first: bool, ) -> String

Source§

fn write_success_enum_aware_rval( &self, w: &mut IndentWriter<'_>, function: &Function, args: &str, ret: bool, ) -> Result<(), Error>

Source§

fn get_method_args(&self, function: &Function, ctx: &str) -> String

Source§

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

Source§

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

Source§

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

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>,

Source§

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>,

Source§

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.