pub struct OpenOptions {
pub auto_migrate: bool,
pub repair_wal: bool,
pub read_only: bool,
}Expand description
Options for GraphDb::open_with_options.
Fields§
§auto_migrate: boolRewrite an old-format snapshot to the current VERSION after a
successful load (default true). The old snapshot is kept as
snapshot.bin.bak until the next clean open at the current version,
at which point the .bak is deleted.
Set to false to open a store without touching any on-disk files
(useful for read-only inspection of a store at an older format).
repair_wal: boolWrite the valid WAL prefix back over a torn tail on open (default
true). Truncating a genuinely torn tail is correct crash recovery.
Set to false for an unattended reader. The valid prefix is still
decoded and replayed in memory, but nothing is written: a reader that
opens while another process is mid-append would otherwise discard a
frame that writer believes durable. mushroomdb recall, which runs on
every prompt, passes false for exactly this reason.
read_only: boolOpen without ever writing to the store (default false).
A read-only handle:
- returns
GraphError::ReadOnlyfrom every mutation and fromsnapshot(); - performs no disk write at open — no WAL repair write-back and no auto-migration rewrite, whatever the other two flags say;
- never takes the cross-process write lock, so it opens immediately even while another process is writing, and never makes a writer wait.
refresh and is_stale work
normally, so a read-only handle can follow another process’s commits.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OpenOptions
Source§impl Debug for OpenOptions
impl Debug for OpenOptions
Auto Trait Implementations§
impl Freeze for OpenOptions
impl RefUnwindSafe for OpenOptions
impl Send for OpenOptions
impl Sync for OpenOptions
impl Unpin for OpenOptions
impl UnsafeUnpin for OpenOptions
impl UnwindSafe for OpenOptions
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.