pub type WT_EXTRACTOR = __wt_extractor;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
Aliased Type§
#[repr(C)]pub struct WT_EXTRACTOR {
pub extract: Option<unsafe extern "C" fn(*mut __wt_extractor, *mut __wt_session, *const __wt_item, *const __wt_item, *mut __wt_cursor) -> i32>,
pub customize: Option<unsafe extern "C" fn(*mut __wt_extractor, *mut __wt_session, *const i8, *mut __wt_config_item, *mut *mut __wt_extractor) -> i32>,
pub terminate: Option<unsafe extern "C" fn(*mut __wt_extractor, *mut __wt_session) -> i32>,
}Fields§
§extract: Option<unsafe extern "C" fn(*mut __wt_extractor, *mut __wt_session, *const __wt_item, *const __wt_item, *mut __wt_cursor) -> i32>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(*mut __wt_extractor, *mut __wt_session, *const i8, *mut __wt_config_item, *mut *mut __wt_extractor) -> i32>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(*mut __wt_extractor, *mut __wt_session) -> i32>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.