pub struct Layout { /* private fields */ }Expand description
Absolute paths of everything a database keeps on disk, by role — the port of the TS Layout,
narrowed to the roles this engine actually writes (format 2 keeps no per-table schema files,
and its write queue stages in memory rather than in a pending/ directory).
Implementations§
Source§impl Layout
impl Layout
pub fn new(root: &Path, kind: LayoutKind, metadata_file: &str) -> Layout
pub fn kind(&self) -> LayoutKind
pub fn root(&self) -> &Path
Sourcepub fn metadata_file(&self) -> &str
pub fn metadata_file(&self) -> &str
Name of the metadata document in Layout::root — the value OpenOptions’
metadataFile/manifest takes.
Sourcepub fn metadata_path(&self) -> &Path
pub fn metadata_path(&self) -> &Path
Absolute path of the metadata document: Layout::root and Layout::metadata_file
joined.
Sourcepub fn tables(&self) -> &Path
pub fn tables(&self) -> &Path
Directory the table logs live in. A partitioned table gets a <table>/ subdirectory of this
one; Table::open derives that from the log path it is handed, so nothing else here has to.
pub fn log_path(&self, table: &str) -> PathBuf
pub fn index_path(&self, table: &str) -> PathBuf
pub fn lock_path(&self) -> PathBuf
pub fn journal_path(&self) -> PathBuf
Sourcepub fn directories(&self) -> Vec<PathBuf>
pub fn directories(&self) -> Vec<PathBuf>
Directories a writable open has to create before anything touches them. Under the flat layout that is the database directory and nothing else, which is what makes an open with no layout options do exactly what it did before layouts existed.
Trait Implementations§
impl Eq for Layout
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnsafeUnpin for Layout
impl UnwindSafe for Layout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.