pub struct SanitizedConfig {
pub port: u16,
pub host: String,
pub workers: Option<usize>,
pub tls_enabled: bool,
pub sanitized: bool,
}Expand description
Sanitized server configuration for API exposure.
Removes sensitive fields like database URLs, API keys, and tokens while preserving operational settings for client consumption.
Fields§
§port: u16Server port
host: StringServer host address
workers: Option<usize>Number of worker threads
tls_enabled: boolWhether TLS is enabled
sanitized: boolIndicates configuration has been sanitized
Implementations§
Source§impl SanitizedConfig
impl SanitizedConfig
Sourcepub fn from_config(config: &HttpServerConfig) -> Self
pub fn from_config(config: &HttpServerConfig) -> Self
Create sanitized configuration from ServerConfig.
Removes sensitive fields:
- TLS private keys and certificates (replaced with boolean flag)
- Database connection strings (not included)
- API keys and tokens (not included)
Sourcepub const fn is_sanitized(&self) -> bool
pub const fn is_sanitized(&self) -> bool
Verify configuration has been properly sanitized.
Trait Implementations§
Source§impl Clone for SanitizedConfig
impl Clone for SanitizedConfig
Source§fn clone(&self) -> SanitizedConfig
fn clone(&self) -> SanitizedConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 SanitizedConfig
impl Debug for SanitizedConfig
Source§impl<'de> Deserialize<'de> for SanitizedConfig
impl<'de> Deserialize<'de> for SanitizedConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SanitizedConfig
impl RefUnwindSafe for SanitizedConfig
impl Send for SanitizedConfig
impl Sync for SanitizedConfig
impl Unpin for SanitizedConfig
impl UnsafeUnpin for SanitizedConfig
impl UnwindSafe for SanitizedConfig
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,
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