__wt_data_source

Struct __wt_data_source 

Source
#[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

Source§

fn clone(&self) -> __wt_data_source

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_data_source

Source§

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

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

impl Copy for __wt_data_source

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.