Skip to main content

MetaBackendOptions

Enum MetaBackendOptions 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Psql(PsqlMetaStorageOptions)

The Postgres backend and its configuration.

§

Mem(MemMetaStorageOptions)

The in-memory backend and its configuration.

Implementations§

Source§

impl MetaBackendOptions

Source

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.

Source

pub fn mem() -> Self

Selects the in-memory backend.

The metadata lives in process and is lost when it exits.

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<MemMetaStorageOptions> for MetaBackendOptions

Source§

fn from(options: MemMetaStorageOptions) -> Self

Converts to this type from the input type.
Source§

impl From<PsqlMetaStorageOptions> for MetaBackendOptions

Source§

fn from(options: PsqlMetaStorageOptions) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more