__wt_file_system

Struct __wt_file_system 

Source
#[repr(C)]
pub struct __wt_file_system { pub fs_directory_list: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, directory: *const c_char, prefix: *const c_char, dirlist: *mut *mut *mut c_char, countp: *mut u32) -> c_int>, pub fs_directory_list_single: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, directory: *const c_char, prefix: *const c_char, dirlist: *mut *mut *mut c_char, countp: *mut u32) -> c_int>, pub fs_directory_list_free: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, dirlist: *mut *mut c_char, count: u32) -> c_int>, pub fs_exist: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, existp: *mut bool) -> c_int>, pub fs_open_file: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, file_type: WT_FS_OPEN_FILE_TYPE, flags: u32, file_handlep: *mut *mut WT_FILE_HANDLE) -> c_int>, pub fs_remove: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, flags: u32) -> c_int>, pub fs_rename: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, from: *const c_char, to: *const c_char, flags: u32) -> c_int>, pub fs_size: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, sizep: *mut wt_off_t) -> c_int>, pub terminate: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION) -> c_int>, }
Expand description

The interface implemented by applications to provide a custom file system implementation.

Thread safety: WiredTiger may invoke methods on the WT_FILE_SYSTEM interface from multiple threads concurrently. It is the responsibility of the implementation to protect any shared data.

Applications register implementations with WiredTiger by calling WT_CONNECTION::add_file_system. See @ref custom_file_systems for more information.

@snippet ex_file_system.c WT_FILE_SYSTEM register

Fields§

§fs_directory_list: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, directory: *const c_char, prefix: *const c_char, dirlist: *mut *mut *mut c_char, countp: *mut u32) -> c_int>

Return a list of file names for the named directory.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param directory the name of the directory @param prefix if not NULL, only files with names matching the prefix are returned @param[out] dirlist the method returns an allocated array of individually allocated strings, one for each entry in the directory. @param[out] countp the number of entries returned

§fs_directory_list_single: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, directory: *const c_char, prefix: *const c_char, dirlist: *mut *mut *mut c_char, countp: *mut u32) -> c_int>§fs_directory_list_free: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, dirlist: *mut *mut c_char, count: u32) -> c_int>

Free memory allocated by WT_FILE_SYSTEM::directory_list.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param dirlist array returned by WT_FILE_SYSTEM::directory_list @param count count returned by WT_FILE_SYSTEM::directory_list

§fs_exist: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, existp: *mut bool) -> c_int>

Return if the named file system object exists.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param name the name of the file @param[out] existp If the named file system object exists

§fs_open_file: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, file_type: WT_FS_OPEN_FILE_TYPE, flags: u32, file_handlep: *mut *mut WT_FILE_HANDLE) -> c_int>

Open a handle for a named file system object

The method should return ENOENT if the file is not being created and does not exist.

The method should return EACCES if the file cannot be opened in the requested mode (for example, a file opened for writing in a readonly file system).

The method should return EBUSY if ::WT_FS_OPEN_EXCLUSIVE is set and the file is in use.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param name the name of the file system object @param file_type the type of the file The file type is provided to allow optimization for different file access patterns. @param flags flags indicating how to open the file, one or more of ::WT_FS_OPEN_CREATE, ::WT_FS_OPEN_DIRECTIO, ::WT_FS_OPEN_DURABLE, ::WT_FS_OPEN_EXCLUSIVE or ::WT_FS_OPEN_READONLY. @param[out] file_handlep the handle to the newly opened file. File system implementations must allocate memory for the handle and the WT_FILE_HANDLE::name field, and fill in the WT_FILE_HANDLE:: fields. Applications wanting to associate private information with the WT_FILE_HANDLE:: structure should declare and allocate their own structure as a superset of a WT_FILE_HANDLE:: structure.

§fs_remove: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, flags: u32) -> c_int>

Remove a named file system object

This method is not required for readonly file systems and should be set to NULL when not required by the file system.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param name the name of the file system object @param durable if the operation requires durability @param flags 0 or ::WT_FS_DURABLE

§fs_rename: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, from: *const c_char, to: *const c_char, flags: u32) -> c_int>

Rename a named file system object

This method is not required for readonly file systems and should be set to NULL when not required by the file system.

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param from the original name of the object @param to the new name for the object @param flags 0 or ::WT_FS_DURABLE

§fs_size: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION, name: *const c_char, sizep: *mut wt_off_t) -> c_int>

Return the size of a named file system object

@errors

@param file_system the WT_FILE_SYSTEM @param session the current WiredTiger session @param name the name of the file system object @param[out] sizep the size of the file system entry

§terminate: Option<unsafe extern "C" fn(file_system: *mut WT_FILE_SYSTEM, session: *mut WT_SESSION) -> c_int>

A callback performed when the file system is closed and will no longer be accessed by the WiredTiger database.

This method is not required and should be set to NULL when not required by the file system.

The WT_FILE_SYSTEM::terminate callback is intended to allow cleanup, the handle will not be subsequently accessed by WiredTiger.

Trait Implementations§

Source§

impl Clone for __wt_file_system

Source§

fn clone(&self) -> __wt_file_system

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_file_system

Source§

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

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

impl Copy for __wt_file_system

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.