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>
impl<'a> WalFile<'a>
Sourcepub fn path_name(self) -> &'a [u8] ⓘ
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.
Sourcepub fn path_name_lossy(self) -> Cow<'a, str>
pub fn path_name_lossy(self) -> Cow<'a, str>
path_name as UTF-8, replacing invalid sequences.
Sourcepub fn log_number(self) -> u64
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.
Sourcepub fn size_file_bytes(self) -> u64
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.
Sourcepub fn start_sequence(self) -> u64
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.
Sourcepub fn file_type(self) -> WalFileType
pub fn file_type(self) -> WalFileType
Whether the file is still live or has been archived.