#[repr(C)]pub struct __wt_data_source {Show 14 fields
pub alter: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub create: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub compact: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub drop: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub open_cursor: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG, new_cursor: *mut *mut WT_CURSOR) -> c_int>,
pub rename: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, newuri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub salvage: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub size: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, size: *mut wt_off_t) -> c_int>,
pub truncate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub range_truncate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, start: *mut WT_CURSOR, stop: *mut WT_CURSOR) -> c_int>,
pub verify: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>,
pub checkpoint: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, config: *mut WT_CONFIG_ARG) -> c_int>,
pub terminate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION) -> c_int>,
pub lsm_pre_merge: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, source: *mut WT_CURSOR, dest: *mut WT_CURSOR) -> c_int>,
}Expand description
Applications can extend WiredTiger by providing new implementations of the WT_DATA_SOURCE class. Each data source supports a different URI scheme for data sources to WT_SESSION::create, WT_SESSION::open_cursor and related methods. See @ref custom_data_sources for more information.
Thread safety: WiredTiger may invoke methods on the WT_DATA_SOURCE interface from multiple threads concurrently. It is the responsibility of the implementation to protect any shared data.
Applications register their implementation with WiredTiger by calling WT_CONNECTION::add_data_source.
@snippet ex_data_source.c WT_DATA_SOURCE register
Fields§
§alter: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to alter an object.
@snippet ex_data_source.c WT_DATA_SOURCE alter
create: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to create a new object.
@snippet ex_data_source.c WT_DATA_SOURCE create
compact: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to compact an object.
@snippet ex_data_source.c WT_DATA_SOURCE compact
drop: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to drop an object.
@snippet ex_data_source.c WT_DATA_SOURCE drop
open_cursor: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG, new_cursor: *mut *mut WT_CURSOR) -> c_int>Callback to initialize a cursor.
@snippet ex_data_source.c WT_DATA_SOURCE open_cursor
rename: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, newuri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to rename an object.
@snippet ex_data_source.c WT_DATA_SOURCE rename
salvage: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to salvage an object.
@snippet ex_data_source.c WT_DATA_SOURCE salvage
size: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, size: *mut wt_off_t) -> c_int>Callback to get the size of an object.
@snippet ex_data_source.c WT_DATA_SOURCE size
truncate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to truncate an object.
@snippet ex_data_source.c WT_DATA_SOURCE truncate
range_truncate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, start: *mut WT_CURSOR, stop: *mut WT_CURSOR) -> c_int>Callback to truncate a range of an object.
@snippet ex_data_source.c WT_DATA_SOURCE range truncate
verify: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, uri: *const c_char, config: *mut WT_CONFIG_ARG) -> c_int>Callback to verify an object.
@snippet ex_data_source.c WT_DATA_SOURCE verify
checkpoint: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION, config: *mut WT_CONFIG_ARG) -> c_int>Callback to checkpoint the database.
@snippet ex_data_source.c WT_DATA_SOURCE checkpoint
terminate: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, session: *mut WT_SESSION) -> c_int>If non-NULL, a callback performed when the database is closed.
The WT_DATA_SOURCE::terminate callback is intended to allow cleanup, the handle will not be subsequently accessed by WiredTiger.
@snippet ex_data_source.c WT_DATA_SOURCE terminate
lsm_pre_merge: Option<unsafe extern "C" fn(dsrc: *mut WT_DATA_SOURCE, source: *mut WT_CURSOR, dest: *mut WT_CURSOR) -> c_int>If non-NULL, a callback performed before an LSM merge.
@param[in] source a cursor configured with the data being merged @param[in] dest a cursor on the new object being filled by the merge
@snippet ex_data_source.c WT_DATA_SOURCE lsm_pre_merge
Trait Implementations§
Source§impl Clone for __wt_data_source
impl Clone for __wt_data_source
Source§fn clone(&self) -> __wt_data_source
fn clone(&self) -> __wt_data_source
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more