pub struct SettingsSource { /* private fields */ }Expand description
Typed access to the settings, resolving DB row, then env var, then built-in default.
Implementations§
Source§impl SettingsSource
impl SettingsSource
Sourcepub fn new(env: EnvFallbacks, pool: PgPool, ttl: Duration) -> Self
pub fn new(env: EnvFallbacks, pool: PgPool, ttl: Duration) -> Self
env is already resolved by the caller; pool should be small and bounded (e.g. from
dedicated_key_store_pool, or the service’s existing key-store pool).
Sourcepub fn env_only(env: EnvFallbacks) -> Self
pub fn env_only(env: EnvFallbacks) -> Self
For a process with no telemetry-DB pool configured.
Sourcepub fn pinned(isolation: Arc<IsolationConfig>) -> Self
pub fn pinned(isolation: Arc<IsolationConfig>) -> Self
An explicit isolation config that ignores both env and DB, for with_isolation_config
and tests. The self-service half is the built-in defaults, and the DataFusion config
overrides are empty.
Sourcepub fn with_overrides(env: EnvFallbacks, db: DbOverrides) -> Self
pub fn with_overrides(env: EnvFallbacks, db: DbOverrides) -> Self
A fixed set of DB values, never reading process env or a database.
Sourcepub fn env_isolation_config(&self) -> Arc<IsolationConfig> ⓘ
pub fn env_isolation_config(&self) -> Arc<IsolationConfig> ⓘ
The env-resolved isolation config, with no DB access. Used where the value has no effect
(auth disabled makes every scope ReadScope::All).
pub async fn isolation_config(&self) -> Result<Arc<IsolationConfig>>
pub async fn self_service(&self) -> Result<SelfServiceSettings>
Sourcepub async fn payload_retention(&self) -> Result<PayloadRetention>
pub async fn payload_retention(&self) -> Result<PayloadRetention>
The payload retention policy. Errors when the settings can’t be loaded, so the caller never falls back to the default horizon and deletes what an override was keeping.
Sourcepub async fn datafusion_config(
&self,
role: ServiceRole,
) -> Result<Arc<DataFusionConfigOverrides>>
pub async fn datafusion_config( &self, role: ServiceRole, ) -> Result<Arc<DataFusionConfigOverrides>>
The DataFusion config overrides for role: the stored value, else none.
Sourcepub async fn deployment_notes(&self) -> Result<Option<Arc<str>>>
pub async fn deployment_notes(&self) -> Result<Option<Arc<str>>>
The stored deployment notes, or None when unset or blank so a saved empty editor behaves
like no notes. Has no env fallback.
Sourcepub async fn warn_on_shadowed_env(&self)
pub async fn warn_on_shadowed_env(&self)
Best-effort startup diagnostic: warns about each env var that is set but ignored because the setting has a stored value.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SettingsSource
impl !RefUnwindSafe for SettingsSource
impl !UnwindSafe for SettingsSource
impl Send for SettingsSource
impl Sync for SettingsSource
impl Unpin for SettingsSource
impl UnsafeUnpin for SettingsSource
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].