Struct PosixEnv

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

Implementations§

Trait Implementations§

Source§

impl CreateDir for PosixEnv

Source§

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

| Create the specified directory. |
Source§

impl Default for PosixEnv

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DeleteDir for PosixEnv

Source§

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

| Delete the specified directory. |
Source§

impl DeleteFile for PosixEnv

Source§

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

| Delete the named file. |
Source§

impl Drop for PosixEnv

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Env for PosixEnv

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 PosixEnv

Source§

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

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

impl GetChildren for PosixEnv

Source§

fn get_children( &mut self, directory_path: &String, result: *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 PosixEnv

Source§

fn get_file_size(&mut self, filename: &String, size: *mut u64) -> Status

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

impl GetTestDirectory for PosixEnv

Source§

fn get_test_directory(&mut self, result: *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 PosixEnv

Source§

fn lock_file( &mut self, filename: &String, lock: *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 PosixEnv

Source§

fn new_appendable_file( &mut self, filename: &String, result: *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 PosixEnv

Source§

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

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

impl NewRandomAccessFile for PosixEnv

Source§

fn new_random_access_file( &mut self, filename: &String, result: *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 PosixEnv

Source§

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

| Create an object that sequentially reads 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 will only be accessed by | one thread at a time.
Source§

impl NewWritableFile for PosixEnv

Source§

fn new_writable_file( &mut self, filename: &String, result: *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 PosixEnv

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 PosixEnv

Source§

fn rename_file(&mut self, from: &String, to: &String) -> Status

| Rename file src to target. |
Source§

impl Schedule for PosixEnv

Source§

fn schedule( &mut self, background_work_function: fn(background_work_arg: *mut c_void) -> c_void, background_work_arg: *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 PosixEnv

Source§

fn sleep_for_microseconds(&mut self, micros: i32)

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

impl StartThread for PosixEnv

Source§

fn start_thread( &mut self, thread_main: fn(thread_main_arg: *mut c_void) -> c_void, thread_main_arg: *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 PosixEnv

Source§

fn unlock_file(&mut self, lock: *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