pub struct Catalog { /* private fields */ }Expand description
Every table a native file holds, without the directory of any of them.
This is what opening a database reads. It is the small level of the directory, so the cost is proportional to how many tables there are rather than to how much data they hold, and a session that touches two tables of eight decodes two table directories.
The file handle is shared with every reader this hands out. Eight tables in one file is one open file descriptor, not eight, which is the other thing one file buys over a file per table.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn open(path: impl AsRef<Path>) -> Result<Self>
pub fn open(path: impl AsRef<Path>) -> Result<Self>
Reads the highest valid catalog slot and nothing under it.
§Errors
If the file has no valid committed catalog or a catalog pointer is out of bounds.
Sourcepub fn names(&self) -> impl ExactSizeIterator<Item = &str>
pub fn names(&self) -> impl ExactSizeIterator<Item = &str>
The tables in the file, in the order they were written.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether the file holds no table at all, which is what Writer::empty writes and what a
database somebody dropped the last table out of comes back as.