[][src]Struct rocks::env::Env

pub struct Env { /* fields omitted */ }

An Env is an interface used by the rocksdb implementation to access operating system functionality like the filesystem etc.

Implementations

impl Env[src]

pub fn default_instance() -> &'static Env[src]

Return a default environment suitable for the current operating system. Sophisticated users may wish to provide their own Env implementation instead of relying on this default environment.

The result of Default() belongs to rocksdb and must never be deleted.

pub fn new_mem() -> Env[src]

Returns a new environment that stores its data in memory and delegates all non-file-storage tasks to base_env.

FIXME: missing base_env

pub fn new_timed() -> Env[src]

Returns a new environment that measures function call times for filesystem operations, reporting results to variables in PerfContext.

This is a factory method for TimedEnv defined in utilities/env_timed.cc.

FIXME: missing base_env

pub fn set_low_priority_background_threads(&self, number: i32)[src]

The number of background worker threads of a specific thread pool

pub fn set_high_priority_background_threads(&self, number: i32)[src]

The number of background worker threads of a high priority thread pool

pub fn wait_for_join(&self)[src]

Wait for all threads started by StartThread to terminate.

pub fn get_thread_pool_queue_len(&self, pri: Priority) -> u32[src]

Get thread pool queue length for specific thrad pool.

pub fn create_logger<P: AsRef<Path>>(&self, fname: P) -> Result<Logger>[src]

Create and return a log file for storing informational messages.

pub fn now_micros(&self) -> u64[src]

Returns the number of micro-seconds since some fixed point in time. It is often used as system time such as in GenericRateLimiter and other places so a port needs to return system time in order to work.

pub fn now_nanos(&self) -> u64[src]

Returns the number of nano-seconds since some fixed point in time. Only useful for computing deltas of time in one run. Default implementation simply relies on NowMicros. In platform-specific implementations, NowNanos() should return time points that are MONOTONIC.

pub fn sleep_for_microseconds(&self, micros: i32)[src]

Sleep/delay the thread for the perscribed number of micro-seconds.

pub fn get_hostname(&self) -> Result<String>[src]

Get the current host name.

pub fn get_current_time(&self) -> Result<u64>[src]

Get the number of seconds since the Epoch, 1970-01-01 00:00:00 (UTC). Only overwrites *unix_time on success.

pub fn time_to_string(&self, time: u64) -> String[src]

Converts seconds-since-Jan-01-1970 to a printable string

pub fn set_background_threads(&self, number: i32, pri: Priority)[src]

The number of background worker threads of a specific thread pool for this environment. 'LOW' is the default pool.

default number: 1

FIXME: &mut self ?

pub fn get_background_threads(&self, pri: Priority) -> i32[src]

pub fn inc_background_threads_if_needed(&self, number: i32, pri: Priority)[src]

Enlarge number of background worker threads of a specific thread pool for this environment if it is smaller than specified. 'LOW' is the default pool.

pub fn lower_thread_pool_io_priority(&self, pool: Priority)[src]

Lower IO priority for threads from the specified pool.

pub fn get_thread_list(&self) -> Vec<ThreadStatus>[src]

Returns the status of all threads that belong to the current Env.

pub fn get_thread_id(&self) -> u64[src]

Returns the ID of the current thread.

Trait Implementations

impl Drop for Env[src]

impl Sync for Env[src]

Auto Trait Implementations

impl RefUnwindSafe for Env

impl !Send for Env

impl Unpin for Env

impl UnwindSafe for Env

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.