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 Freeze for ClientBuilder
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