#[non_exhaustive]pub enum MetaBackendOptions {
Psql(PsqlMetaStorageOptions),
Mem(MemMetaStorageOptions),
}Expand description
Selects and parameterizes the metadata storage backend.
This is the forward-looking, backend-agnostic way to say where the metadata lives. Each
variant owns its backend’s full parameter set (e.g. Psql carries a
PsqlMetaStorageOptions), so backend-specific knobs never leak into backend-agnostic options.
Build the selected backend into an AnyBackend with build, then hand it to
Operon::new.
To pin a backend at compile time, build its concrete options directly (e.g.
PsqlMetaStorageOptions::build).
§Stability
This enum is #[non_exhaustive]: adding a backend variant must stay a non-breaking change.
Reach it through the provided constructors (e.g. psql) or a From conversion rather than
naming variants directly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Psql(PsqlMetaStorageOptions)
The Postgres backend and its configuration.
Mem(MemMetaStorageOptions)
The in-memory backend and its configuration.
Implementations§
Source§impl MetaBackendOptions
impl MetaBackendOptions
Sourcepub fn psql(uri: impl Into<String>) -> Self
pub fn psql(uri: impl Into<String>) -> Self
Selects the Postgres backend with the given connection URI and default tuning.
For finer control, build a PsqlMetaStorageOptions and convert it with
Into/From.
Sourcepub fn mem() -> Self
pub fn mem() -> Self
Selects the in-memory backend.
The metadata lives in process and is lost when it exits.
Sourcepub fn build(self) -> Result<AnyBackend, MetaStorageError<AnyBackendError>>
pub fn build(self) -> Result<AnyBackend, MetaStorageError<AnyBackendError>>
Builds the metadata backend selected by these options into an AnyBackend.
The concrete backend is resolved at runtime from the chosen variant.
To pin a backend at compile time, build its concrete options instead
(e.g. PsqlMetaStorageOptions::build).
Trait Implementations§
Source§impl Debug for MetaBackendOptions
impl Debug for MetaBackendOptions
Source§impl From<MemMetaStorageOptions> for MetaBackendOptions
impl From<MemMetaStorageOptions> for MetaBackendOptions
Source§fn from(options: MemMetaStorageOptions) -> Self
fn from(options: MemMetaStorageOptions) -> Self
Source§impl From<PsqlMetaStorageOptions> for MetaBackendOptions
impl From<PsqlMetaStorageOptions> for MetaBackendOptions
Source§fn from(options: PsqlMetaStorageOptions) -> Self
fn from(options: PsqlMetaStorageOptions) -> Self
Auto Trait Implementations§
impl Freeze for MetaBackendOptions
impl RefUnwindSafe for MetaBackendOptions
impl Send for MetaBackendOptions
impl Sync for MetaBackendOptions
impl Unpin for MetaBackendOptions
impl UnsafeUnpin for MetaBackendOptions
impl UnwindSafe for MetaBackendOptions
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
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