pub struct SqliteStorageConfig { /* private fields */ }
Expand description
Configuration for the sqlite storage.
Implementations§
Source§impl SqliteStorageConfig
impl SqliteStorageConfig
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
Create a new SqliteStorageConfig
with the given path.
Sourcepub fn new_in_memory() -> Self
pub fn new_in_memory() -> Self
Create a new SqliteStorageConfig
with an in-memory database.
Sourcepub fn with_init<F>(self, f: F) -> Self
pub fn with_init<F>(self, f: F) -> Self
Set the function that is called whenever the first connection is created.
Note that only one function can be set at a time, so this will overwrite any existing function.
Useful for setting PRAGMA options that affect the entire database and all connections.
Sourcepub fn with_connection_init<F>(self, f: F) -> Self
pub fn with_connection_init<F>(self, f: F) -> Self
Set the function that is called whenever a new connection is created.
Note that only one function can be set at a time, so this will overwrite any existing function.
Sourcepub fn with_flags(self, flags: OpenFlags) -> Self
pub fn with_flags(self, flags: OpenFlags) -> Self
Set the flags that are used to configure the sqlite database.
Sourcepub fn with_connection_count(self, size: usize) -> Self
pub fn with_connection_count(self, size: usize) -> Self
Set the amount of connections to use to access the database.
The connections are created eagerly when the storage is created.
§Panics
Panics if the size is 0.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqliteStorageConfig
impl !RefUnwindSafe for SqliteStorageConfig
impl !Send for SqliteStorageConfig
impl !Sync for SqliteStorageConfig
impl Unpin for SqliteStorageConfig
impl !UnwindSafe for SqliteStorageConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.