__wt_extractor

Struct __wt_extractor 

Source
#[repr(C)]
pub struct __wt_extractor { pub extract: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION, key: *const WT_ITEM, value: *const WT_ITEM, result_cursor: *mut WT_CURSOR) -> c_int>, pub customize: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION, uri: *const c_char, appcfg: *mut WT_CONFIG_ITEM, customp: *mut *mut WT_EXTRACTOR) -> c_int>, pub terminate: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION) -> c_int>, }
Expand description

The interface implemented by applications to provide custom extraction of index keys or column group values.

Applications register implementations with WiredTiger by calling WT_CONNECTION::add_extractor. See @ref custom_extractors for more information.

@snippet ex_all.c WT_EXTRACTOR register

Fields§

§extract: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION, key: *const WT_ITEM, value: *const WT_ITEM, result_cursor: *mut WT_CURSOR) -> c_int>

Callback to extract a value for an index or column group.

@errors

@snippet ex_all.c WT_EXTRACTOR

@param extractor the WT_EXTRACTOR implementation @param session the current WiredTiger session @param key the table key in raw format, see @ref cursor_raw for details @param value the table value in raw format, see @ref cursor_raw for details @param[out] result_cursor the method should call WT_CURSOR::set_key and WT_CURSOR::insert on this cursor to return a key. The \c key_format of the cursor will match that passed to WT_SESSION::create for the index. Multiple index keys can be created for each record by calling WT_CURSOR::insert multiple times.

§customize: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION, uri: *const c_char, appcfg: *mut WT_CONFIG_ITEM, customp: *mut *mut WT_EXTRACTOR) -> c_int>

If non-NULL, this callback is called to customize the extractor for each index. If the callback returns a non-NULL extractor, that instance is used instead of this one for all comparisons.

§terminate: Option<unsafe extern "C" fn(extractor: *mut WT_EXTRACTOR, session: *mut WT_SESSION) -> c_int>

If non-NULL a callback performed when the index or column group is closed for customized extractors otherwise when the database is closed.

The WT_EXTRACTOR::terminate callback is intended to allow cleanup, the handle will not be subsequently accessed by WiredTiger.

Trait Implementations§

Source§

impl Clone for __wt_extractor

Source§

fn clone(&self) -> __wt_extractor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for __wt_extractor

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Copy for __wt_extractor

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.