pub enum OpenMode {
Read,
ReadWrite,
Create,
CreateNew,
}Expand description
How a file is opened.
Variants§
Read
Must exist. Reads only, and a write is an error.
ReadWrite
Must exist. Reads and writes.
Create
Created if it does not exist, opened if it does.
CreateNew
Created, and an error if it already exists.
The one that matters for a database file, because “create the database” and “open the database that is already there” are different intentions and collapsing them is how a process ends up writing a header over somebody’s data.
Implementations§
Trait Implementations§
impl Copy for OpenMode
impl Eq for OpenMode
impl StructuralPartialEq for OpenMode
Auto Trait Implementations§
impl Freeze for OpenMode
impl RefUnwindSafe for OpenMode
impl Send for OpenMode
impl Sync for OpenMode
impl Unpin for OpenMode
impl UnsafeUnpin for OpenMode
impl UnwindSafe for OpenMode
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