#[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
impl Clone for __wt_extractor
Source§fn clone(&self) -> __wt_extractor
fn clone(&self) -> __wt_extractor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more