pub struct FfiLocalInitData<T: 'static> { /* private fields */ }Expand description
Type-safe per-thread local init data for DuckDB table functions.
Set in the local_init callback; retrieved in scan.
Implementations§
Source§impl<T: 'static> FfiLocalInitData<T>
impl<T: 'static> FfiLocalInitData<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 per-thread local init data.
Call inside your local_init callback.
§Safety
infomust be a validduckdb_init_info.- Must be called at most once per
local_initinvocation.
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 per-thread local init data.
Returns None if no local init data was set.
§Safety
infomust be a validduckdb_function_info.- 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 per-thread local init data.
Returns None if no local init data was set.
§Safety
infomust be a validduckdb_function_info.- No other reference to the same data must exist simultaneously.
Auto Trait Implementations§
impl<T> Freeze for FfiLocalInitData<T>
impl<T> RefUnwindSafe for FfiLocalInitData<T>where
T: RefUnwindSafe,
impl<T> Send for FfiLocalInitData<T>where
T: Send,
impl<T> Sync for FfiLocalInitData<T>where
T: Sync,
impl<T> Unpin for FfiLocalInitData<T>where
T: Unpin,
impl<T> UnsafeUnpin for FfiLocalInitData<T>
impl<T> UnwindSafe for FfiLocalInitData<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