pub struct FfiInitData<T: 'static> { /* private fields */ }Expand description
Type-safe global init data for DuckDB table functions.
Set in the global init callback; retrieved in scan.
Implementations§
Source§impl<T: 'static> FfiInitData<T>
impl<T: 'static> FfiInitData<T>
Sourcepub unsafe fn set(info: duckdb_init_info, data: T)
pub unsafe fn set(info: duckdb_init_info, data: T)
Stores data as the global init data for this query.
Call inside your global init callback.
§Safety
infomust be a validduckdb_init_info.- Must be called at most once per init invocation.
Sourcepub unsafe fn get<'a>(info: duckdb_function_info) -> Option<&'a T>
pub unsafe fn get<'a>(info: duckdb_function_info) -> Option<&'a T>
Retrieves a shared reference to the global init data from a scan callback.
Returns None if no init data was set.
§Safety
infomust be a validduckdb_function_infofrom a scan callback.- No mutable reference to the same data must exist simultaneously.
Sourcepub unsafe fn get_mut<'a>(info: duckdb_function_info) -> Option<&'a mut T>
pub unsafe fn get_mut<'a>(info: duckdb_function_info) -> Option<&'a mut T>
Retrieves a mutable reference to the global init data from a scan callback.
Returns None if no init data was set.
§Safety
infomust be a validduckdb_function_infofrom a scan callback.- No other reference to the same data must exist simultaneously.
Auto Trait Implementations§
impl<T> Freeze for FfiInitData<T>
impl<T> RefUnwindSafe for FfiInitData<T>where
T: RefUnwindSafe,
impl<T> Send for FfiInitData<T>where
T: Send,
impl<T> Sync for FfiInitData<T>where
T: Sync,
impl<T> Unpin for FfiInitData<T>where
T: Unpin,
impl<T> UnsafeUnpin for FfiInitData<T>
impl<T> UnwindSafe for FfiInitData<T>where
T: UnwindSafe,
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