ffi_gen

Struct FfiGen

Source
pub struct FfiGen { /* private fields */ }
Expand description

Main entry point to ffi-gen.

Implementations§

Source§

impl FfiGen

Source

pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>

Takes a path to an ffi-gen interface description file and constructs a new FfiGen instance.

Source

pub fn generate_rust(&self, abi: Abi) -> Result<String>

Generates the rust api.

Source

pub fn wasm_multi_value_shim<P: AsRef<Path>>(&self, path: P) -> Result<()>

Patches the ffi functions in a wasm blob to use multi-value returns.

Source

pub fn generate_dart<P: AsRef<Path>>( &self, path: P, library: &str, cdylib: &str, ) -> Result<()>

Generates dart bindings for the rust api.

Source

pub fn generate_js<P: AsRef<Path>>(&self, path: P) -> Result<()>

Generates js bindings for the rust api.

Source

pub fn generate_ts<P: AsRef<Path>>(&self, path: P) -> Result<()>

Generates typescript type definitions for the js bindings.

Auto Trait Implementations§

§

impl Freeze for FfiGen

§

impl RefUnwindSafe for FfiGen

§

impl Send for FfiGen

§

impl Sync for FfiGen

§

impl Unpin for FfiGen

§

impl UnwindSafe for FfiGen

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.