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§
Trait Implementations§
Source§impl CreateDir for EnvWrapper
impl CreateDir for EnvWrapper
Source§fn create_dir(&mut self, d: &String) -> Status
fn create_dir(&mut self, d: &String) -> Status
| Create the specified directory.
|
Source§impl DeleteDir for EnvWrapper
impl DeleteDir for EnvWrapper
Source§fn delete_dir(&mut self, d: &String) -> Status
fn delete_dir(&mut self, d: &String) -> Status
| Delete the specified directory.
|
Source§impl DeleteFile for EnvWrapper
impl DeleteFile for EnvWrapper
Source§fn delete_file(&mut self, f: &String) -> Status
fn delete_file(&mut self, f: &String) -> Status
| Delete the named file.
|
Source§impl Env for EnvWrapper
impl Env for EnvWrapper
fn new_appendable_file( &mut self, fname: &String, result: *mut *mut Box<dyn WritableFile>, ) -> Status
fn posix_default(&mut self) -> Rc<RefCell<dyn Env>>
Source§impl FileExists for EnvWrapper
impl FileExists for EnvWrapper
Source§fn file_exists(&mut self, f: &String) -> bool
fn file_exists(&mut self, f: &String) -> bool
| Returns true iff the named file exists.
|
Source§impl GetChildren for EnvWrapper
impl GetChildren for EnvWrapper
Source§impl GetFileSize for EnvWrapper
impl GetFileSize for EnvWrapper
Source§impl GetTestDirectory for EnvWrapper
impl GetTestDirectory for EnvWrapper
Source§fn get_test_directory(&mut self, path: *mut String) -> Status
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
impl LockFile for EnvWrapper
Source§fn lock_file(&mut self, f: &String, l: *mut *mut Box<dyn FileLock>) -> Status
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
impl NewAppendableFile for EnvWrapper
Source§fn new_appendable_file(
&mut self,
f: &String,
r: *mut *mut Box<dyn WritableFile>,
) -> Status
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
impl NewLogger for EnvWrapper
Source§impl NewRandomAccessFile for EnvWrapper
impl NewRandomAccessFile for EnvWrapper
Source§fn new_random_access_file(
&mut self,
f: &String,
r: *mut *mut Box<dyn RandomAccessFile>,
) -> Status
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
impl NewSequentialFile for EnvWrapper
Source§fn new_sequential_file(
&mut self,
f: &String,
r: *mut *mut Box<dyn SequentialFile>,
) -> Status
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
impl NewWritableFile for EnvWrapper
Source§fn new_writable_file(
&mut self,
f: &String,
r: *mut *mut Box<dyn WritableFile>,
) -> Status
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
impl NowMicros for EnvWrapper
Source§fn now_micros(&mut self) -> u64
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
impl RenameFile for EnvWrapper
Source§impl Schedule for EnvWrapper
impl Schedule for EnvWrapper
Source§fn schedule(&mut self, f: fn(_0: *mut c_void) -> c_void, a: *mut c_void)
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
impl SleepForMicroseconds for EnvWrapper
Source§fn sleep_for_microseconds(&mut self, micros: i32)
fn sleep_for_microseconds(&mut self, micros: i32)
| Sleep/delay the thread for the prescribed
| number of micro-seconds.
|
Source§impl StartThread for EnvWrapper
impl StartThread for EnvWrapper
Source§impl UnlockFile for EnvWrapper
impl UnlockFile for EnvWrapper
Auto Trait Implementations§
impl Freeze for EnvWrapper
impl !RefUnwindSafe for EnvWrapper
impl !Send for EnvWrapper
impl !Sync for EnvWrapper
impl Unpin for EnvWrapper
impl !UnwindSafe for EnvWrapper
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more