pub struct SqlStorage { /* private fields */ }Expand description
Stores sessions in a SQL database: see the crate documentation.
Implementations§
Source§impl SqlStorage
impl SqlStorage
Sourcepub async fn connect(url: &str, config: SqlConfig) -> Result<Self>
pub async fn connect(url: &str, config: SqlConfig) -> Result<Self>
Connects to the database at url: sqlite://path (with ?mode=rwc to create the file)
or postgres://…, whichever this build has the feature for.
§Errors
If the URL names a database this build doesn’t support, or the database can’t be reached.
Trait Implementations§
Source§impl Clone for SqlStorage
impl Clone for SqlStorage
Source§impl Debug for SqlStorage
impl Debug for SqlStorage
Source§impl SessionStorage for SqlStorage
impl SessionStorage for SqlStorage
Source§fn open(&self, id: &SessionId) -> Result<Box<dyn SessionLog>, Error>
fn open(&self, id: &SessionId) -> Result<Box<dyn SessionLog>, Error>
Opens the log for
id, creating it with both sequence numbers at 1 if it does not exist.
The gateway holds at most one open log per session. The default fails, for stores that
open only with begin_open. Read moreSource§fn is_durable(&self) -> bool
fn is_durable(&self) -> bool
Whether what this store keeps survives the process ending: false for
MemoryStorage. A store that routes sessions to others is durable
only if every store it can route to is. The default says it is.Auto Trait Implementations§
impl !RefUnwindSafe for SqlStorage
impl !UnwindSafe for SqlStorage
impl Freeze for SqlStorage
impl Send for SqlStorage
impl Sync for SqlStorage
impl Unpin for SqlStorage
impl UnsafeUnpin for SqlStorage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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