#[non_exhaustive]pub struct ServiceConfig {
pub header_read_timeout: Option<Duration>,
pub request_body: ServiceRequestBodyConfig,
pub event_stream: ServiceEventStreamConfig,
}Expand description
Typed service-wide configuration shared by every protocol.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header_read_timeout: Option<Duration>Request-head deadline, defaulting to one minute; None disables it.
Legacy servers manage their own Hyper accept loop and must apply this value to their connection builder. This field alone does not enforce it.
request_body: ServiceRequestBodyConfigGlobal request body collection allowances, poll budget, and per-operation overrides.
Generated serde reads the immutable SDK configuration. Operation overrides replace the whole allowance record.
event_stream: ServiceEventStreamConfigEvent-stream read deadlines and per-operation overrides.
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub fn with_header_read_timeout(self, timeout: Option<Duration>) -> Self
pub fn with_header_read_timeout(self, timeout: Option<Duration>) -> Self
Sets the request-head deadline. None or zero disables it.
pub fn with_event_stream(self, event_stream: ServiceEventStreamConfig) -> Self
Sourcepub fn with_request_body(self, request_body: ServiceRequestBodyConfig) -> Self
pub fn with_request_body(self, request_body: ServiceRequestBodyConfig) -> Self
Sets the request body collection and streaming poll configuration.
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
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 ServiceConfig
impl Debug for ServiceConfig
Auto Trait Implementations§
impl Freeze for ServiceConfig
impl RefUnwindSafe for ServiceConfig
impl Send for ServiceConfig
impl Sync for ServiceConfig
impl Unpin for ServiceConfig
impl UnsafeUnpin for ServiceConfig
impl UnwindSafe for ServiceConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 moreCreates a shared type from an unshared type.