pub enum JoydbMode<A: Adapter> {
Persistent {
adapter: A,
sync_policy: SyncPolicy,
},
InMemory,
}
Expand description
The mode of the database. This is used to specify how the database should be opened.
Variants§
Persistent
The data are flushed to the file system.
Fields
§
adapter: A
The adapter used to read/write the data (e.g. JSON, CSV, etc.)
§
sync_policy: SyncPolicy
Specifies when data must be flushed to the file system.
InMemory
The data are never flushed to the file system. Even when Joydb::flush is explicitly called. With this mode, Joydb acts like in-memory-only database and this mode is mostly intended for unit tests.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for JoydbMode<A>where
A: Freeze,
impl<A> RefUnwindSafe for JoydbMode<A>where
A: RefUnwindSafe,
impl<A> Send for JoydbMode<A>
impl<A> Sync for JoydbMode<A>where
A: Sync,
impl<A> Unpin for JoydbMode<A>where
A: Unpin,
impl<A> UnwindSafe for JoydbMode<A>where
A: UnwindSafe,
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
Mutably borrows from an owned value. Read more