pub struct FfiBridge { /* private fields */ }Expand description
The FFI bridge generator.
Produces Rust extern blocks, C headers, and wrapper functions for interoperating between OxiLean and C code.
Implementations§
Source§impl FfiBridge
impl FfiBridge
Sourcepub fn with_type_map(type_map: FfiTypeMap) -> Self
pub fn with_type_map(type_map: FfiTypeMap) -> Self
Create an FFI bridge with a custom type map.
Sourcepub fn generate_bindings(&self, decls: &[FfiDecl]) -> FfiOutput
pub fn generate_bindings(&self, decls: &[FfiDecl]) -> FfiOutput
Generate all FFI bindings for the given declarations.
Sourcepub fn generate_extern_block(&self, decls: &[FfiDecl]) -> String
pub fn generate_extern_block(&self, decls: &[FfiDecl]) -> String
Generate a Rust extern "C" block for the given declarations.
Sourcepub fn generate_c_wrapper(&self, decl: &FfiDecl) -> String
pub fn generate_c_wrapper(&self, decl: &FfiDecl) -> String
Generate a C wrapper function that calls an OxiLean function via the Lean runtime.
Sourcepub fn type_map(&self) -> &FfiTypeMap
pub fn type_map(&self) -> &FfiTypeMap
Get the type map.
Sourcepub fn type_map_mut(&mut self) -> &mut FfiTypeMap
pub fn type_map_mut(&mut self) -> &mut FfiTypeMap
Get a mutable reference to the type map.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FfiBridge
impl RefUnwindSafe for FfiBridge
impl Send for FfiBridge
impl Sync for FfiBridge
impl Unpin for FfiBridge
impl UnsafeUnpin for FfiBridge
impl UnwindSafe for FfiBridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more