pub struct ProductionDefaultsConfig { /* private fields */ }Expand description
Configuration for RustAPI’s built-in production baseline preset.
This preset bundles together the most common foundation pieces for a production HTTP service:
- request IDs on every response
- structured tracing spans with service metadata
- standard
/health,/ready, and/liveprobes
Implementations§
Source§impl ProductionDefaultsConfig
impl ProductionDefaultsConfig
Sourcepub fn new(service_name: impl Into<String>) -> Self
pub fn new(service_name: impl Into<String>) -> Self
Create a new production baseline configuration.
Sourcepub fn version(self, version: impl Into<String>) -> Self
pub fn version(self, version: impl Into<String>) -> Self
Annotate tracing spans and default health payloads with an application version.
Sourcepub fn tracing_level(self, level: Level) -> Self
pub fn tracing_level(self, level: Level) -> Self
Set the tracing log level used by the preset tracing layer.
Sourcepub fn health_endpoint_config(self, config: HealthEndpointConfig) -> Self
pub fn health_endpoint_config(self, config: HealthEndpointConfig) -> Self
Override the default health endpoint paths.
Sourcepub fn request_id(self, enabled: bool) -> Self
pub fn request_id(self, enabled: bool) -> Self
Enable or disable request ID propagation.
Sourcepub fn health_endpoints(self, enabled: bool) -> Self
pub fn health_endpoints(self, enabled: bool) -> Self
Enable or disable built-in health endpoints.
Trait Implementations§
Source§impl Clone for ProductionDefaultsConfig
impl Clone for ProductionDefaultsConfig
Source§fn clone(&self) -> ProductionDefaultsConfig
fn clone(&self) -> ProductionDefaultsConfig
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 moreAuto Trait Implementations§
impl Freeze for ProductionDefaultsConfig
impl RefUnwindSafe for ProductionDefaultsConfig
impl Send for ProductionDefaultsConfig
impl Sync for ProductionDefaultsConfig
impl Unpin for ProductionDefaultsConfig
impl UnsafeUnpin for ProductionDefaultsConfig
impl UnwindSafe for ProductionDefaultsConfig
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