Struct async_sqlite::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
A ClientBuilder
can be used to create a Client
with custom
configuration.
For more information on creating a sqlite connection, see the rusqlite docs.
Examples
let client = ClientBuilder::new().path("path/to/db.sqlite3").open().await?;
// ...
client.close().await?;
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new ClientBuilder
with the default settings.
sourcepub fn path<P: AsRef<Path>>(self, path: P) -> Self
pub fn path<P: AsRef<Path>>(self, path: P) -> Self
Specify the path of the sqlite3 database to open.
By default, an in-memory database is used.
sourcepub fn flags(self, flags: OpenFlags) -> Self
pub fn flags(self, flags: OpenFlags) -> Self
Specify the OpenFlags
to use when opening a new connection.
By default, OpenFlags::default()
is used.
sourcepub fn journal_mode(self, journal_mode: JournalMode) -> Self
pub fn journal_mode(self, journal_mode: JournalMode) -> Self
Specify the JournalMode
to set when opening a new connection.
By default, no journal_mode
is explicity set.
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
source§impl Default for ClientBuilder
impl Default for ClientBuilder
source§fn default() -> ClientBuilder
fn default() -> ClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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