pub struct CoreConfig {
pub public_url: String,
pub public_host: String,
pub oauth: OAuthSettings,
pub allowed_origins: Vec<String>,
pub bind_addr: SocketAddr,
pub tls: TlsMode,
pub observability: ObservabilityConfig,
}Expand description
The settings every server shares; see the module documentation for the variables.
Fields§
§public_url: StringPUBLIC_URL without a trailing slash.
public_host: StringThe host of PUBLIC_URL, without IPv6 brackets.
oauth: OAuthSettingsThe authorization server’s settings.
allowed_origins: Vec<String>ALLOWED_ORIGINS.
bind_addr: SocketAddrBIND_ADDR.
tls: TlsModeHow to serve: plain HTTP, certificate files or self-signed.
observability: ObservabilityConfigLogging, metrics and tracing.
Implementations§
Source§impl CoreConfig
impl CoreConfig
Sourcepub fn from_env<F: Fn(&str) -> Option<String>>(
env: &mut EnvReader<F>,
service_name: &str,
crate_target: &str,
) -> Option<Self>
pub fn from_env<F: Fn(&str) -> Option<String>>( env: &mut EnvReader<F>, service_name: &str, crate_target: &str, ) -> Option<Self>
Reads the shared settings. service_name names the server in traces; crate_target is
the tracing target prefix of your crates, raised to debug by DEBUG. Errors go to
env.errors; None when there were any.
Sourcepub fn service_url(&self, service: &str) -> String
pub fn service_url(&self, service: &str) -> String
External URL of a service mounted at /<service>.
Trait Implementations§
Source§impl Clone for CoreConfig
impl Clone for CoreConfig
Auto Trait Implementations§
impl Forget for CoreConfig
impl Freeze for CoreConfig
impl RefUnwindSafe for CoreConfig
impl Send for CoreConfig
impl Sync for CoreConfig
impl Unpin for CoreConfig
impl UnsafeUnpin for CoreConfig
impl UnwindSafe for CoreConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> ⓘ
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 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> ⓘ
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