Skip to main content

LiveFileStorageInfoEntry

Struct LiveFileStorageInfoEntry 

Source
pub struct LiveFileStorageInfoEntry<'a> { /* private fields */ }
Expand description

One file in a LiveFilesStorageInfo listing.

Every string accessor borrows straight out of the parent listing: the C API returns interior pointers into the std::strings it holds, so nothing is copied or freed here.

Implementations§

Source§

impl<'a> LiveFileStorageInfoEntry<'a>

Source

pub fn index(&self) -> usize

Position of this entry within the parent listing.

Source

pub fn relative_filename(&self) -> &'a [u8]

The file name within its directory, for example 123456.sst.

Source

pub fn relative_filename_lossy(&self) -> Cow<'a, str>

relative_filename as UTF-8, replacing invalid sequences.

Source

pub fn directory(&self) -> &'a [u8]

The directory holding the file, without a trailing /. This could be a DB path, the WAL directory, and so on.

Source

pub fn directory_lossy(&self) -> Cow<'a, str>

directory as UTF-8, replacing invalid sequences.

Source

pub fn file_number(&self) -> u64

The file’s number within the DB, or 0 for files that have none, such as CURRENT.

Source

pub fn file_type(&self) -> FileType

The role this file plays in the DB.

Source

pub fn size(&self) -> u64

File size in bytes. See trim_to_size and replacement_contents for when the file on disk may differ.

Source

pub fn trim_to_size(&self) -> bool

When true the file on disk may be longer than size and only the first size bytes belong in the copy. When false a length mismatch means the file is corrupt.

Source

pub fn replacement_contents(&self) -> &'a [u8]

Contents to write instead of reading the file from disk, used for CURRENT. Empty means read the file on disk as usual; otherwise this is exactly size bytes long.

Unlike the other borrowed strings this may contain NUL bytes, so it comes from the length out-param rather than strlen.

Source

pub fn file_checksum_func_name(&self) -> &'a [u8]

Name of the checksum function that produced this file’s checksum. Unknown when no checksum function is configured, empty when checksum info was not requested.

Source

pub fn file_checksum_func_name_lossy(&self) -> Cow<'a, str>

file_checksum_func_name as UTF-8, replacing invalid sequences.

Source

pub fn temperature(&self) -> Temperature

The storage tier the file is placed on.

Trait Implementations§

Source§

impl<'a> Clone for LiveFileStorageInfoEntry<'a>

Source§

fn clone(&self) -> LiveFileStorageInfoEntry<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for LiveFileStorageInfoEntry<'a>

Source§

impl Debug for LiveFileStorageInfoEntry<'_>

Source§

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

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.