Skip to main content

WalFile

Struct WalFile 

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

One WAL file in a WalFiles listing.

A borrowed view. The values live inside the parent listing and are freed with it.

Implementations§

Source§

impl<'a> WalFile<'a>

Source

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

The file’s path relative to the main DB directory, for example /000003.log for a live file or /archive/000003.log for an archived one.

Borrowed from the std::string inside the parent: the C API returns path_name.c_str(), not a copy, so nothing is allocated or freed here.

Source

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

path_name as UTF-8, replacing invalid sequences.

Source

pub fn log_number(self) -> u64

The file’s log number, RocksDB’s primary identifier for it. It grows with creation time, so a higher number means a newer file.

Source

pub fn size_file_bytes(self) -> u64

Position of the last flushed write in the file, which for a recycled WAL is usually less than the file’s size on disk.

Source

pub fn start_sequence(self) -> u64

Sequence number of the first write batch in the file.

Always 0 for the file get_current_wal_file returns. RocksDB reads the first batch to find this, which it only does for the files it has stopped writing to, so the live WAL is reported with a placeholder rather than a real sequence number.

Source

pub fn file_type(self) -> WalFileType

Whether the file is still live or has been archived.

Trait Implementations§

Source§

impl<'a> Clone for WalFile<'a>

Source§

fn clone(&self) -> WalFile<'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 WalFile<'a>

Source§

impl Debug for WalFile<'_>

Source§

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

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

impl Send for WalFile<'_>

Source§

impl Sync for WalFile<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for WalFile<'a>

§

impl<'a> RefUnwindSafe for WalFile<'a>

§

impl<'a> Unpin for WalFile<'a>

§

impl<'a> UnsafeUnpin for WalFile<'a>

§

impl<'a> UnwindSafe for WalFile<'a>

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.