#[repr(C)]pub struct FFI_Module {
pub daft_abi_version: u32,
pub name: *const c_char,
pub init: unsafe extern "C" fn(session: *mut FFI_SessionContext) -> c_int,
pub free_string: unsafe extern "C" fn(s: *mut c_char),
}Expand description
Module definition returned by the entry point symbol.
Analogous to Postgres’s Pg_magic_struct + _PG_init combined into
a single struct.
Fields§
§daft_abi_version: u32Must equal DAFT_ABI_VERSION or the loader rejects the module.
name: *const c_charModule name as a null-terminated UTF-8 string.
Must remain valid for the lifetime of the process (typically a
&'static CStr cast to *const c_char).
init: unsafe extern "C" fn(session: *mut FFI_SessionContext) -> c_intCalled by the host to let the module register its functions.
Returns 0 on success, non-zero on error.
free_string: unsafe extern "C" fn(s: *mut c_char)Free a string previously allocated by this module
(e.g. from FFI_ScalarFunction::get_return_field or error messages).
Trait Implementations§
Source§impl Clone for FFI_Module
impl Clone for FFI_Module
Source§fn clone(&self) -> FFI_Module
fn clone(&self) -> FFI_Module
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FFI_Module
impl Send for FFI_Module
impl Sync for FFI_Module
Auto Trait Implementations§
impl Freeze for FFI_Module
impl RefUnwindSafe for FFI_Module
impl Unpin for FFI_Module
impl UnsafeUnpin for FFI_Module
impl UnwindSafe for FFI_Module
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