#[non_exhaustive]pub struct SqlConfig {
pub lease: Duration,
pub holder: String,
pub max_session_bytes: u64,
pub sync: bool,
pub max_connections: u32,
}Expand description
How a SqlStorage keeps sessions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.lease: DurationHow long a session’s lease lasts from opening its log or its last commit, after which another gateway may take the session over. Longer than the longest heartbeat interval, with a margin: see the crate documentation.
holder: StringWho holds the leases this store takes, shown to a gateway refused one: by default the host name, the process ID and the time the store was configured.
max_session_bytes: u64The most bytes of messages each session keeps. Past it, the oldest go, down to 7/8 of it, so that deleting them is rare.
sync: boolSQLite only: whether each commit waits for the database file to reach the device
(synchronous = FULL), so state survives power loss, or only for the OS to have it
(NORMAL), so it survives a process crash. PostgreSQL’s durability is the server’s.
max_connections: u32The most connections the store opens to the database.
Implementations§
Source§impl SqlConfig
impl SqlConfig
Sourcepub const DEFAULT_MAX_SESSION_BYTES: u64
pub const DEFAULT_MAX_SESSION_BYTES: u64
The default byte budget for each session’s messages, as
DiskStorage::DEFAULT_MAX_SESSION_BYTES.
Sourcepub const DEFAULT_LEASE: Duration
pub const DEFAULT_LEASE: Duration
The default lease: two minutes, comfortably longer than the usual 30-second heartbeat.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqlConfig
impl RefUnwindSafe for SqlConfig
impl Send for SqlConfig
impl Sync for SqlConfig
impl Unpin for SqlConfig
impl UnsafeUnpin for SqlConfig
impl UnwindSafe for SqlConfig
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
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> ⓘ
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