#[non_exhaustive]pub enum ProgressHost {
Sqlite(SqliteProgress),
Postgres(PostgresProgress),
}Expand description
One database hosting a record’s progress ledger.
TWO variants where DatabaseBackend has four, and that is a measurement rather than an
oversight: store/progress/ contains sqlite/ and postgres/, and there is no MySQL or MongoDB
ledger. What the missing two make unrepresentable is a ledger in a database that ships none. When a
third backend arrives, a variant lands here and of gains an arm; nothing else moves.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Source§impl ProgressHost
impl ProgressHost
Sourcepub const fn kind(&self) -> DatabaseKind
pub const fn kind(&self) -> DatabaseKind
Which database this is.
Sourcepub const fn of(kind: DatabaseKind) -> Option<Self>
pub const fn of(kind: DatabaseKind) -> Option<Self>
kind’s ledger, or None when the framework ships none for it.
The ONE authority on which of DatabaseKind’s four can host a ledger. A front end asks this
rather than testing a list, so a database is admitted only when there is a variant for it to
land in — the predicate and the constructor cannot drift, because there is no predicate.
Sourcepub const fn hosts(kind: DatabaseKind) -> bool
pub const fn hosts(kind: DatabaseKind) -> bool
Whether kind can host a ledger — of’s question without its answer, for a caller
that needs the fact rather than the value.