pub struct NetConfig {
pub net: NetSection,
}Expand description
Top-level network-layer configuration loaded from a TOML file.
All sections are optional; missing sections default to None and leave the
corresponding builder values untouched. Use NetConfig::from_path to
load and NetConfig::apply_to to fold the values into a builder.
Fields§
§net: NetSection[net] section.
Implementations§
Source§impl NetConfig
impl NetConfig
Sourcepub fn from_path(path: impl AsRef<Path>) -> NetResult<Self>
pub fn from_path(path: impl AsRef<Path>) -> NetResult<Self>
Load a NetConfig from a TOML file on disk.
Cert/key paths and JWT secret paths in the TOML are resolved relative to the TOML file’s parent directory.
§Errors
Returns NetError::InvalidRequest if the file cannot be read or
contains invalid TOML.
Sourcepub fn merge_env(self) -> NetResult<Self>
pub fn merge_env(self) -> NetResult<Self>
Layer this config on top of environment-variable overrides and return the result. TOML values are kept when the corresponding env var is unset.
§Errors
Returns NetError::InvalidRequest if any env var present has an
invalid value (unparseable address, non-numeric QPS, …).
Sourcepub fn load_layered(path: impl AsRef<Path>) -> NetResult<Self>
pub fn load_layered(path: impl AsRef<Path>) -> NetResult<Self>
Convenience: load from file then layer env vars.
Equivalent to NetConfig::from_path(path)?.merge_env().
Sourcepub fn apply_to<S>(&self, builder: AqlServerBuilder<S>) -> AqlServerBuilder<S>
pub fn apply_to<S>(&self, builder: AqlServerBuilder<S>) -> AqlServerBuilder<S>
Apply this config’s values to an AqlServerBuilder.
Builder methods called after this fold continue to take precedence
— apply_to only sets values for fields that are Some in the config.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for NetConfig
impl<'de> Deserialize<'de> for NetConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for NetConfig
Auto Trait Implementations§
impl Freeze for NetConfig
impl RefUnwindSafe for NetConfig
impl Send for NetConfig
impl Sync for NetConfig
impl Unpin for NetConfig
impl UnsafeUnpin for NetConfig
impl UnwindSafe for NetConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.