pub struct Version { /* private fields */ }

Implementations§

source§

impl Version

source

pub fn num_files(&self, level: i32) -> i32

source

pub fn new(vset: *mut VersionSet) -> Self

source

pub fn new_concatenating_iterator( &self, options: &ReadOptions, level: i32 ) -> *mut LevelDBIterator

source

pub fn add_iterators( &mut self, options: &ReadOptions, iters: *mut Vec<*mut LevelDBIterator> )

| Append to *iters a sequence of iterators that | will yield the contents of this Version when | merged together. | | REQUIRES: This version has been saved (see | VersionSet::SaveTo)

source

pub fn for_each_overlapping( &mut self, user_key_: Slice, internal_key_: Slice, arg: *mut c_void, func: fn(_0: *mut c_void, _1: i32, _2: *mut FileMetaData) -> bool )

| Call func(arg, level, f) for every file that | overlaps user_key in order from newest to | oldest. If an invocation of func returns | false, makes no more calls. | | REQUIRES: user portion of internal_key == | user_key.

source

pub fn get( &mut self, options: &ReadOptions, k: &LookupKey, value: *mut String, stats: *mut VersionGetStats ) -> Status

source

pub fn update_stats(&mut self, stats: &VersionGetStats) -> bool

| Adds “stats” into the current state. Returns | true if a new compaction may need to be | triggered, false otherwise. | | REQUIRES: lock is held

source

pub fn record_read_sample(&mut self, internal_key_: Slice) -> bool

| Record a sample of bytes read at the | specified internal key. | | Samples are taken approximately once every | config::kReadBytesPeriod bytes. Returns true | if a new compaction may need to be triggered. | | REQUIRES: lock is held

source

pub fn ref_(&mut self)

| Reference count management (so Versions | do not disappear out from under live | iterators) |

source

pub fn unref(&mut self)

source

pub fn overlap_in_level( &mut self, level: i32, smallest_user_key_: *const Slice, largest_user_key_: *const Slice ) -> bool

| Returns true iff some file in the specified | level overlaps some part of | [*smallest_user_key,*largest_user_key]. | | smallest_user_key==nullptr represents a key | smaller than all the DB’s keys. | | largest_user_key==nullptr represents a key | largest than all the DB’s keys.

source

pub fn pick_level_for_mem_table_output( &mut self, smallest_user_key_: &Slice, largest_user_key_: &Slice ) -> i32

| Return the level at which we should place | a new memtable compaction result that covers | the range | [smallest_user_key,largest_user_key].

source

pub fn get_overlapping_inputs( &mut self, level: i32, begin: *const InternalKey, end: *const InternalKey, inputs: *mut Vec<*mut FileMetaData> )

| Store in “*inputs” all files in “level” | that overlap [begin,end] |

source

pub fn debug_string(&self) -> String

| Return a human readable string that | describes this version’s contents. |

Trait Implementations§

source§

impl Drop for Version

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Version

§

impl !Send for Version

§

impl !Sync for Version

§

impl Unpin for Version

§

impl !UnwindSafe for Version

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,

§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> StaticUpcast<T> for T

§

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

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V