Skip to main content

DbBackendConfig

Struct DbBackendConfig 

Source
pub struct DbBackendConfig {
Show 14 fields pub backend: String, pub sqlite_path: Option<PathBuf>, pub host: String, pub port: String, pub database: String, pub user: String, pub password_env_name: String, pub tls_mode: String, pub tls_root_cert: String, pub tls_cert: String, pub tls_key: String, pub socket_path: Option<PathBuf>, pub charset: Option<String>, pub options: Option<String>,
}
Expand description

Shared backend configuration resolved from runtime config before backend.

§Fields

  • backend: Stored field on DbBackendConfig.
  • sqlite_path: Stored field on DbBackendConfig.
  • host: Stored field on DbBackendConfig.
  • port: Stored field on DbBackendConfig.
  • database: Stored field on DbBackendConfig.
  • user: Stored field on DbBackendConfig.
  • password_env_name: Stored field on DbBackendConfig.
  • tls_mode: Stored field on DbBackendConfig.
  • tls_root_cert: Stored field on DbBackendConfig.
  • tls_cert: Stored field on DbBackendConfig.
  • tls_key: Stored field on DbBackendConfig.
  • socket_path: Stored field on DbBackendConfig.
  • charset: Stored field on DbBackendConfig.
  • options: Stored field on DbBackendConfig.

§Examples

ⓘ
let _ = std::mem::size_of::<pharos_runtime_integrations::backend::DbBackendConfig>();
  • crate::backend for constructors, helpers, and neighboring runtime types.

Fields§

§backend: String§sqlite_path: Option<PathBuf>§host: String§port: String§database: String§user: String§password_env_name: String§tls_mode: String§tls_root_cert: String§tls_cert: String§tls_key: String§socket_path: Option<PathBuf>§charset: Option<String>§options: Option<String>

Implementations§

Source§

impl DbBackendConfig

Source

pub fn isolated( &self, namespace: &str, data_root: &Path, app_id: &str, ) -> Result<Self, BackendError>

Keeps the configured adapter and credentials while isolating a generated app’s storage namespace and optional local database file.

Source

pub fn settings(&self) -> Result<Vec<(&'static str, String)>, BackendError>

Serializes validated connection settings without resolving secret values. This keeps preview and operator configuration on one shared contract.

Source

pub fn from_lookup( app_id: &str, lookup: impl FnMut(&str) -> Option<String>, ) -> Result<Self, BackendError>

Resolves the shared connection contract from effective app/runtime values. Callers supply their own cached or operator lookup; defaults remain identical.

Source

pub fn matches_local_path_hint(&self, hint: &Path) -> bool

Accepts a legacy local-path hint only when it names the configured source. The hint never changes backend selection or redirects an app to another file.

Trait Implementations§

Source§

impl Clone for DbBackendConfig

Source§

fn clone(&self) -> DbBackendConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DbBackendConfig

Source§

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

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

impl Default for DbBackendConfig

Source§

fn default() -> DbBackendConfig

Returns the “default value” for a type. Read more
Source§

impl PartialEq for DbBackendConfig

Source§

fn eq(&self, other: &DbBackendConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for DbBackendConfig

Source§

impl StructuralPartialEq for DbBackendConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.