pub struct Database { /* private fields */ }Implementations§
Source§impl Database
impl Database
pub fn connect(&self) -> Result<Connection>
Sourcepub fn open_from_bytes(bytes: &[u8]) -> Result<Database>
pub fn open_from_bytes(bytes: &[u8]) -> Result<Database>
Open an in-memory database preloaded from an existing SQLite database
image bytes (e.g. the output of include_bytes!, VACUUM INTO, or
sqlite3_serialize()).
Mirrors rusqlite’s Connection::deserialize / SQLite’s
sqlite3_deserialize(). Unlike Builder::build, this is synchronous
because no real I/O occurs — the bytes are copied into an in-memory
page store. The returned Database can be connected multiple
times, and all connections share the same preloaded image.
§Errors
Returns Error::SqlExecutionFailure if bytes is not a valid SQLite
database image (too short, wrong magic, or an invalid page size in the
header). Never panics on malformed input.
Trait Implementations§
impl Send for Database
impl Sync for Database
Auto Trait Implementations§
impl !RefUnwindSafe for Database
impl !UnwindSafe for Database
impl Freeze for Database
impl Unpin for Database
impl UnsafeUnpin for Database
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