pub enum StorageBackend {
Sqlite,
Postgres {
url: String,
pool: StoragePoolSection,
},
}Expand description
Type-state projection of StorageSection with cross-field invariants
enforced.
StorageSection is deserialized from config.toml with relaxed shape so
existing user configs continue to load — backend: String, url: Option<String>. That means a misconfigured backend = "postgres" with
no url only fails at daemon startup with a string-mismatch error, and
callers downstream of the parse have to keep re-checking the
invariant.
StorageBackend is the parsed form: variants carry exactly the fields
they require, so it is impossible to construct a Postgres variant
without a URL or to ask for a pool configuration in a Sqlite variant.
Use StorageSection::parsed at the boundary; downstream code
matches on the enum.
Variants§
Trait Implementations§
Source§impl Clone for StorageBackend
impl Clone for StorageBackend
Source§fn clone(&self) -> StorageBackend
fn clone(&self) -> StorageBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StorageBackend
impl Debug for StorageBackend
impl Eq for StorageBackend
Source§impl PartialEq for StorageBackend
impl PartialEq for StorageBackend
impl StructuralPartialEq for StorageBackend
Auto Trait Implementations§
impl Freeze for StorageBackend
impl RefUnwindSafe for StorageBackend
impl Send for StorageBackend
impl Sync for StorageBackend
impl Unpin for StorageBackend
impl UnsafeUnpin for StorageBackend
impl UnwindSafe for StorageBackend
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