Skip to main content

ColumnFamilyMetaDataOptions

Struct ColumnFamilyMetaDataOptions 

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

Filters applied when collecting column family metadata.

Both filters narrow which SST files are reported:

  • level picks a single LSM level. The default, -1, reports every level.
  • start_key and end_key bound a user key range. A file is reported when its key range overlaps the bound, so a file that merely straddles the boundary is included. An unset bound is open-ended on that side.

The filtered query also drops levels that end up with no files, so the resulting Vec<LevelMetaData> is not indexed by level number. Read LevelMetaData::level to find out which level a value describes.

The reported size and file_count cover only the files that passed the filter, not the whole column family.

Implementations§

Source§

impl ColumnFamilyMetaDataOptions

Source

pub fn new() -> Self

Creates options that filter nothing: all levels, unbounded key range.

Source

pub fn set_level(&mut self, level: i32)

Restricts the query to a single level. Pass -1 to report every level.

Source

pub fn get_level(&self) -> i32

Returns the level filter. -1 means every level.

Source

pub fn set_start_key(&mut self, key: impl AsRef<[u8]>)

Sets the inclusive lower bound of the user key range to report.

Source

pub fn clear_start_key(&mut self)

Removes the lower bound, leaving the range open on that side.

Source

pub fn get_start_key(&self) -> Option<Vec<u8>>

Returns the lower bound, or None if unset.

The C API hands back a borrowed pointer into a std::string owned by the options object, so the bytes are copied here rather than freed.

Source

pub fn set_end_key(&mut self, key: impl AsRef<[u8]>)

Sets the inclusive upper bound of the user key range to report.

Source

pub fn clear_end_key(&mut self)

Removes the upper bound, leaving the range open on that side.

Source

pub fn get_end_key(&self) -> Option<Vec<u8>>

Returns the upper bound, or None if unset.

The C API hands back a borrowed pointer into a std::string owned by the options object, so the bytes are copied here rather than freed.

Trait Implementations§

Source§

impl Debug for ColumnFamilyMetaDataOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ColumnFamilyMetaDataOptions

Source§

fn default() -> Self

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

impl Drop for ColumnFamilyMetaDataOptions

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for ColumnFamilyMetaDataOptions

Source§

impl Sync for ColumnFamilyMetaDataOptions

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.