Struct EnvWrapper

Source
pub struct EnvWrapper { /* private fields */ }
Expand description

| An implementation of Env that forwards all | calls to another Env. | | May be useful to clients who wish to override | just part of the functionality of another Env.

Implementations§

Source§

impl EnvWrapper

Source

pub fn new(t: Rc<RefCell<dyn Env>>) -> Self

| Initialize an EnvWrapper that delegates | all calls to *t. |

Source

pub fn target(&self) -> Rc<RefCell<dyn Env>>

| Return the target to which this Env forwards | all calls. |

Trait Implementations§

Source§

impl CreateDir for EnvWrapper

Source§

fn create_dir(&mut self, d: &String) -> Status

| Create the specified directory. |
Source§

impl DeleteDir for EnvWrapper

Source§

fn delete_dir(&mut self, d: &String) -> Status

| Delete the specified directory. |
Source§

impl DeleteFile for EnvWrapper

Source§

fn delete_file(&mut self, f: &String) -> Status

| Delete the named file. |
Source§

impl Env for EnvWrapper

Source§

fn new_appendable_file( &mut self, fname: &String, result: *mut *mut Box<dyn WritableFile>, ) -> Status

Source§

fn posix_default(&mut self) -> Rc<RefCell<dyn Env>>

Source§

impl FileExists for EnvWrapper

Source§

fn file_exists(&mut self, f: &String) -> bool

| Returns true iff the named file exists. |
Source§

impl GetChildren for EnvWrapper

Source§

fn get_children(&mut self, dir: &String, r: *mut Vec<String>) -> Status

| Store in *result the names of the children of | the specified directory. | | The names are relative to “dir”. | | Original contents of *results are dropped.
Source§

impl GetFileSize for EnvWrapper

Source§

fn get_file_size(&mut self, f: &String, s: *mut u64) -> Status

| Store the size of fname in *file_size. |
Source§

impl GetTestDirectory for EnvWrapper

Source§

fn get_test_directory(&mut self, path: *mut String) -> Status

| *path is set to a temporary directory that | can be used for testing. It may or may not | have just been created. The directory may or | may not differ between runs of the same | process, but subsequent calls will return the | same directory.
Source§

impl LockFile for EnvWrapper

Source§

fn lock_file(&mut self, f: &String, l: *mut *mut Box<dyn FileLock>) -> Status

| Lock the specified file. Used to prevent | concurrent access to the same db by multiple | processes. On failure, stores nullptr in | *lock and returns non-OK. | | On success, stores a pointer to the object | that represents the acquired lock in *lock | and returns OK. The caller should call | UnlockFile(*lock) to release the lock. If | the process exits, the lock will be | automatically released. | | If somebody else already holds the lock, | finishes immediately with a failure. I.e., | this call does not wait for existing locks to | go away. | | May create the named file if it does not | already exist.
Source§

impl NewAppendableFile for EnvWrapper

Source§

fn new_appendable_file( &mut self, f: &String, r: *mut *mut Box<dyn WritableFile>, ) -> Status

| Create an object that either appends to an | existing file, or writes to a new file (if | the file does not exist to begin with). On | success, stores a pointer to the new file in | *result and returns OK. On failure stores | nullptr in *result and returns non-OK. | | The returned file will only be accessed by | one thread at a time. | | May return an IsNotSupportedError error if | this Env does not allow appending to an | existing file. Users of Env (including the | leveldb implementation) must be prepared to | deal with an Env that does not support | appending.
Source§

impl NewLogger for EnvWrapper

Source§

fn new_logger( &mut self, fname: &String, result: *mut *mut Box<dyn Logger>, ) -> Status

Create and return a log file for storing informational messages.
Source§

impl NewRandomAccessFile for EnvWrapper

Source§

fn new_random_access_file( &mut self, f: &String, r: *mut *mut Box<dyn RandomAccessFile>, ) -> Status

| Create an object supporting random-access | reads from the file with the specified name. | On success, stores a pointer to the new file | in *result and returns OK. On failure stores | nullptr in *result and returns non-OK. If | the file does not exist, returns a non-OK | status. Implementations should return | a NotFound status when the file does not | exist. | | The returned file may be concurrently | accessed by multiple threads.
Source§

impl NewSequentialFile for EnvWrapper

Source§

fn new_sequential_file( &mut self, f: &String, r: *mut *mut Box<dyn SequentialFile>, ) -> Status

| The following text is boilerplate that | forwards all methods to target(). |

Source§

impl NewWritableFile for EnvWrapper

Source§

fn new_writable_file( &mut self, f: &String, r: *mut *mut Box<dyn WritableFile>, ) -> Status

| Create an object that writes to a new file | with the specified name. Deletes any | existing file with the same name and creates | a new file. On success, stores a pointer to | the new file in *result and returns OK. On | failure stores nullptr in *result and returns | non-OK. | | The returned file will only be accessed by | one thread at a time.
Source§

impl NowMicros for EnvWrapper

Source§

fn now_micros(&mut self) -> u64

| Returns the number of micro-seconds | since some fixed point in time. Only | useful for computing deltas of time. |
Source§

impl RenameFile for EnvWrapper

Source§

fn rename_file(&mut self, s: &String, t: &String) -> Status

| Rename file src to target. |
Source§

impl Schedule for EnvWrapper

Source§

fn schedule(&mut self, f: fn(_0: *mut c_void) -> c_void, a: *mut c_void)

| Arrange to run “(*function)(arg)” once in | a background thread. | | “function” may run in an unspecified thread. | Multiple functions added to the same Env may | run concurrently in different threads. | | I.e., the caller may not assume that | background work items are serialized.
Source§

impl SleepForMicroseconds for EnvWrapper

Source§

fn sleep_for_microseconds(&mut self, micros: i32)

| Sleep/delay the thread for the prescribed | number of micro-seconds. |
Source§

impl StartThread for EnvWrapper

Source§

fn start_thread(&mut self, f: fn(_0: *mut c_void) -> c_void, a: *mut c_void)

| Start a new thread, invoking “function(arg)” | within the new thread. | | When “function(arg)” returns, the thread will | be destroyed.
Source§

impl UnlockFile for EnvWrapper

Source§

fn unlock_file(&mut self, l: *mut Box<dyn FileLock>) -> Status

| Release the lock acquired by a previous | successful call to LockFile. | | REQUIRES: lock was returned by a successful | LockFile() call | | REQUIRES: lock has not already been unlocked.

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, U> CastInto<U> for T
where U: CastFrom<T>,

Source§

unsafe fn cast_into(self) -> U

Performs the conversion. 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> StaticUpcast<T> for T

Source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V