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 onDbBackendConfig.sqlite_path: Stored field onDbBackendConfig.host: Stored field onDbBackendConfig.port: Stored field onDbBackendConfig.database: Stored field onDbBackendConfig.user: Stored field onDbBackendConfig.password_env_name: Stored field onDbBackendConfig.tls_mode: Stored field onDbBackendConfig.tls_root_cert: Stored field onDbBackendConfig.tls_cert: Stored field onDbBackendConfig.tls_key: Stored field onDbBackendConfig.socket_path: Stored field onDbBackendConfig.charset: Stored field onDbBackendConfig.options: Stored field onDbBackendConfig.
§Examples
ⓘ
let _ = std::mem::size_of::<pharos_runtime_integrations::backend::DbBackendConfig>();§Related
crate::backendfor 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
impl DbBackendConfig
Sourcepub fn isolated(
&self,
namespace: &str,
data_root: &Path,
app_id: &str,
) -> Result<Self, BackendError>
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.
Sourcepub fn settings(&self) -> Result<Vec<(&'static str, String)>, BackendError>
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.
Sourcepub fn from_lookup(
app_id: &str,
lookup: impl FnMut(&str) -> Option<String>,
) -> Result<Self, BackendError>
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.
Sourcepub fn matches_local_path_hint(&self, hint: &Path) -> bool
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
impl Clone for DbBackendConfig
Source§fn clone(&self) -> DbBackendConfig
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DbBackendConfig
impl Debug for DbBackendConfig
Source§impl Default for DbBackendConfig
impl Default for DbBackendConfig
Source§fn default() -> DbBackendConfig
fn default() -> DbBackendConfig
Returns the “default value” for a type. Read more
Source§impl PartialEq for DbBackendConfig
impl PartialEq for DbBackendConfig
Source§fn eq(&self, other: &DbBackendConfig) -> bool
fn eq(&self, other: &DbBackendConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for DbBackendConfig
impl StructuralPartialEq for DbBackendConfig
Auto Trait Implementations§
impl Freeze for DbBackendConfig
impl RefUnwindSafe for DbBackendConfig
impl Send for DbBackendConfig
impl Sync for DbBackendConfig
impl Unpin for DbBackendConfig
impl UnsafeUnpin for DbBackendConfig
impl UnwindSafe for DbBackendConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.