Struct SessionPersistence
pub struct SessionPersistence(Inner);Expand description
How a client’s session is durably persisted across restarts.
Construct it from a backend builder rather than directly: pass a
FilePersistence or TursoPersistence to
ClientBuilder::persistence, or use
none for no persistence (the default).
Tuple Fields§
§0: InnerImplementations§
§impl SessionPersistence
impl SessionPersistence
pub const fn none() -> Self
pub const fn none() -> Self
No persistence: session state is kept in memory only and discarded on exit.
pub(crate) const fn is_configured(&self) -> bool
pub(crate) const fn is_configured(&self) -> bool
Whether a backend is configured (used to resolve
CleanStart::Auto).
pub(crate) async fn build(self) -> Result<(JournaledSession, Persistence)>
pub(crate) async fn build(self) -> Result<(JournaledSession, Persistence)>
Loads any persisted session and opens the runtime backend.
Trait Implementations§
§impl From<FilePersistence> for SessionPersistence
impl From<FilePersistence> for SessionPersistence
§fn from(config: FilePersistence) -> Self
fn from(config: FilePersistence) -> Self
Converts to this type from the input type.
§impl From<TursoPersistence> for SessionPersistence
Available on crate feature turso only.
impl From<TursoPersistence> for SessionPersistence
Available on crate feature
turso only.§fn from(config: TursoPersistence) -> Self
fn from(config: TursoPersistence) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SessionPersistence
impl !RefUnwindSafe for SessionPersistence
impl Send for SessionPersistence
impl Sync for SessionPersistence
impl Unpin for SessionPersistence
impl !UnwindSafe for SessionPersistence
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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