pub struct SpgConnectOptions {
pub path: Option<PathBuf>,
pub log_settings: LogSettings,
/* private fields */
}Expand description
Options for opening an SpgConnection.
v7.16.0 — every clone of an SpgConnectOptions shares the
same underlying AsyncDatabase once the first connect()
resolves. That’s the key to making sqlx::Pool<Spg> behave
the way mailrs expects: pool.begin() and a separate
pool.acquire() on the same pool reach the same in-process
engine, so transaction visibility works.
Fields§
§path: Option<PathBuf>Where to open the database. None → in-memory.
log_settings: LogSettingssqlx log settings — adapter-level no-op for v7.16.0 but
preserved so the log_statements / log_slow_statements
builders compile.
Implementations§
Source§impl SpgConnectOptions
impl SpgConnectOptions
v7.37.5 (mailrs crash-recovery Ask 2) — force the shared
OnceCell<AsyncDatabase> back to empty so the next
connect() re-opens the catalog instead of handing back a
stale cached handle. Pairs with
spg_embedded::Database::force_unlock: when the operator
asserts “no one owns this catalog; nuke the lock”, any
previously-shared AsyncDatabase that still holds the
engine in this process must also be discarded so the new
boot’s connect_with opens fresh.
Replaces the Arc<OnceCell<_>> with a brand-new empty cell;
existing clones of these options that already grabbed an
Arc clone to the prior cell keep using it (they’re the
callers that opted in to the shared handle); this method
only resets THIS handle. The typical mailrs shape — one
SpgConnectOptions per pool, recycled at force_unlock
time — is correctly served.
Trait Implementations§
Source§impl Clone for SpgConnectOptions
impl Clone for SpgConnectOptions
Source§fn clone(&self) -> SpgConnectOptions
fn clone(&self) -> SpgConnectOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConnectOptions for SpgConnectOptions
impl ConnectOptions for SpgConnectOptions
type Connection = SpgConnection
Source§fn connect(&self) -> BoxFuture<'_, Result<SpgConnection, Error>>
fn connect(&self) -> BoxFuture<'_, Result<SpgConnection, Error>>
self.Source§fn log_statements(self, level: LevelFilter) -> Self
fn log_statements(self, level: LevelFilter) -> Self
levelSource§fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
fn log_slow_statements(self, level: LevelFilter, duration: Duration) -> Self
duration
at the specified level.Source§fn to_url_lossy(&self) -> Url
fn to_url_lossy(&self) -> Url
ConnectOptions. Read moreSource§fn disable_statement_logging(self) -> Self
fn disable_statement_logging(self) -> Self
Source§impl Debug for SpgConnectOptions
impl Debug for SpgConnectOptions
Source§impl Default for SpgConnectOptions
impl Default for SpgConnectOptions
Auto Trait Implementations§
impl !RefUnwindSafe for SpgConnectOptions
impl !UnwindSafe for SpgConnectOptions
impl Freeze for SpgConnectOptions
impl Send for SpgConnectOptions
impl Sync for SpgConnectOptions
impl Unpin for SpgConnectOptions
impl UnsafeUnpin for SpgConnectOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more