Skip to main content

CopyFinalizeInfo

Struct CopyFinalizeInfo 

Source
pub struct CopyFinalizeInfo { /* private fields */ }
Expand description

Wrapper around the duckdb_copy_function_finalize_info handle provided to a copy function finalize callback.

Implementations§

Source§

impl CopyFinalizeInfo

Source

pub const unsafe fn new(info: duckdb_copy_function_finalize_info) -> Self

Wraps a raw duckdb_copy_function_finalize_info handle.

§Safety

info must be a valid handle passed by DuckDB to a copy function finalize callback.

Source

pub unsafe fn get_bind_data(&self) -> *mut c_void

Retrieves the bind data pointer set during the bind phase.

§Safety

The returned pointer must be cast back to the original type.

Source

pub unsafe fn get_extra_info(&self) -> *mut c_void

Retrieves the extra-info pointer previously set on the copy function.

§Safety

The returned pointer is only valid as long as the copy function is registered and DuckDB has not yet called the destructor.

Source

pub unsafe fn get_global_state(&self) -> *mut c_void

Retrieves the global state pointer set during the global init phase.

§Safety

The returned pointer must be cast back to the original type.

Source

pub unsafe fn bind_data_ref<T: 'static>(&self) -> Option<&T>

Borrows the bind data as a T; see CopyGlobalInitInfo::bind_data_ref.

§Safety

As for CopyGlobalInitInfo::bind_data_ref.

Source

pub unsafe fn global_state_ref<T: 'static>(&self) -> Option<&T>

Borrows the global state as a T; see CopySinkInfo::global_state_ref.

§Safety

As for CopySinkInfo::global_state_ref.

Source

pub unsafe fn extra_info_ref<T: 'static>(&self) -> Option<&T>

Borrows the copy function’s extra info as a T; see CopyBindInfo::extra_info_ref.

§Safety

As for CopyBindInfo::extra_info_ref.

Source

pub fn set_error(&self, message: &str)

Reports a fatal error, causing DuckDB to abort the current query.

An interior null byte in message is replaced by ?, and an empty message by EMPTY_ERROR_PLACEHOLDER.

Source

pub unsafe fn get_client_context(&self) -> ClientContext

Returns the client context for this callback.

§Safety

The inner handle must be valid (requires DuckDB runtime), and the returned context must not be used after the connection running this query is closed — see ClientContext.

Source

pub const fn as_raw(&self) -> duckdb_copy_function_finalize_info

Returns the underlying raw handle.

Trait Implementations§

Source§

impl Debug for CopyFinalizeInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.