#[repr(C)]pub struct __wt_async_op {Show 16 fields
pub connection: *mut WT_CONNECTION,
pub key_format: *const c_char,
pub value_format: *const c_char,
pub app_private: *mut c_void,
pub get_key: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...) -> c_int>,
pub get_value: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...) -> c_int>,
pub set_key: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...)>,
pub set_value: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...)>,
pub search: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>,
pub insert: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>,
pub update: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>,
pub remove: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>,
pub compact: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>,
pub get_id: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> u64>,
pub get_type: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> WT_ASYNC_OPTYPE>,
pub c: WT_CURSOR,
}Expand description
A WT_ASYNC_OP handle is the interface to an asynchronous operation.
An asynchronous operation describes a data manipulation to be performed asynchronously by a WiredTiger worker thread. These operations implement the CRUD (create, read, update and delete) operations. Each operation is a self-contained work unit. The operation will be performed in the context of the worker thread’s session. Each operation is performed within the context of a transaction. The application is notified of its completion with a callback. The transaction is resolved once the callback returns.
The table referenced in an operation must already exist.
Raw data is represented by key/value pairs of WT_ITEM structures, but operations can also provide access to fields within the key and value if the formats are described in the WT_SESSION::create method.
Thread safety: A WT_ASYNC_OP handle may not be shared between threads, see @ref threads for more information.
Fields§
§connection: *mut WT_CONNECTIONThe connection for this operation.
key_format: *const c_charThe format of the data packed into key items. See @ref packing for details. If not set, a default value of “u” is assumed, and applications must use WT_ITEM structures to manipulate untyped byte arrays.
value_format: *const c_charThe format of the data packed into value items. See @ref packing for details. If not set, a default value of “u” is assumed, and applications must use WT_ITEM structures to manipulate untyped byte arrays.
app_private: *mut c_voidA location for applications to store information that will be available in the callback from an async operation.
get_key: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...) -> c_int>@name Data access @{ / /*! Invoke the underlying WT_CURSOR::get_key method; see that method for configuration, return and error values.
@param op the operation handle @returns as described for WT_CURSOR::get_key
get_value: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...) -> c_int>Invoke the underlying WT_CURSOR::get_value method; see that method for configuration, return and error values.
@param op the operation handle @returns as described for WT_CURSOR::get_value
set_key: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...)>Invoke the underlying WT_CURSOR::set_key method; see that method for configuration, return and error values.
@param op the operation handle
set_value: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP, ...)>Invoke the underlying WT_CURSOR::set_value method; see that method for configuration, return and error values.
@param op the operation handle
search: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>@name Positioning @{ / /*! Invoke the underlying WT_CURSOR::search method; see that method for configuration, return and error values.
@param op the operation handle @returns via the callback as described for WT_CURSOR::search
insert: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>@name Data modification @{ / /*! Invoke the underlying WT_CURSOR::insert method; see that method for configuration, return and error values.
@param op the operation handle @returns via the callback as described for WT_CURSOR::insert
update: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>Invoke the underlying WT_CURSOR::update method; see that method for configuration, return and error values.
@param op the operation handle @returns via the callback as described for WT_CURSOR::update
remove: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>Invoke the underlying WT_CURSOR::remove method; see that method for configuration, return and error values.
@param op the operation handle @returns via the callback as described for WT_CURSOR::remove
compact: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> c_int>@name Table operations @{ / /*! Invoke the underlying WT_SESSION::compact method; see that method for configuration, return and error values.
@param op the operation handle @returns via the callback as described for WT_SESSION::compact
get_id: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> u64>Get the unique identifier for this operation.
@snippet ex_async.c async get identifier
@param op the operation handle @returns the id of the operation
get_type: Option<unsafe extern "C" fn(op: *mut WT_ASYNC_OP) -> WT_ASYNC_OPTYPE>Get the type for this operation.
@snippet ex_async.c async get type
@param op the operation handle @returns the ::WT_ASYNC_OPTYPE of the operation
c: WT_CURSORTrait Implementations§
Source§impl Clone for __wt_async_op
impl Clone for __wt_async_op
Source§fn clone(&self) -> __wt_async_op
fn clone(&self) -> __wt_async_op
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more