pub struct CopyFunctionBuilder { /* private fields */ }Expand description
Builder for registering a custom COPY TO function.
All four lifecycle callbacks (bind, global_init, sink, finalize) should be
set before calling register.
Implementations§
Source§impl CopyFunctionBuilder
impl CopyFunctionBuilder
Sourcepub fn try_new(name: &str) -> Result<Self, ExtensionError>
pub fn try_new(name: &str) -> Result<Self, ExtensionError>
Creates a new copy function builder with the given format name.
The name corresponds to the format identifier used in
COPY table TO 'file' (FORMAT name).
§Errors
Returns ExtensionError if the name contains a null byte.
Sourcepub fn bind(self, f: CopyBindFn) -> Self
pub fn bind(self, f: CopyBindFn) -> Self
Sets the bind callback.
Sourcepub fn global_init(self, f: CopyGlobalInitFn) -> Self
pub fn global_init(self, f: CopyGlobalInitFn) -> Self
Sets the global init callback.
Sourcepub fn sink(self, f: CopySinkFn) -> Self
pub fn sink(self, f: CopySinkFn) -> Self
Sets the sink callback.
Sourcepub fn finalize(self, f: CopyFinalizeFn) -> Self
pub fn finalize(self, f: CopyFinalizeFn) -> Self
Sets the finalize callback.
Sourcepub unsafe fn register(
self,
con: duckdb_connection,
) -> Result<(), ExtensionError>
pub unsafe fn register( self, con: duckdb_connection, ) -> Result<(), ExtensionError>
Auto Trait Implementations§
impl Freeze for CopyFunctionBuilder
impl RefUnwindSafe for CopyFunctionBuilder
impl Send for CopyFunctionBuilder
impl Sync for CopyFunctionBuilder
impl Unpin for CopyFunctionBuilder
impl UnsafeUnpin for CopyFunctionBuilder
impl UnwindSafe for CopyFunctionBuilder
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