pub struct HttpServerConfig {
pub host: String,
pub port: u16,
pub read_timeout: Duration,
pub idle_timeout: Duration,
pub request_timeout: Duration,
pub max_body_bytes: usize,
pub enable_h2c: bool,
pub cors: Option<CorsPolicy>,
pub tls: Option<TlsConfig>,
}Expand description
HTTP server configuration owned by rskit-server.
Fields§
§host: StringBind address (default: 0.0.0.0).
port: u16Bind port (default: 8080).
read_timeout: DurationMaximum time to wait for a request header (default: 30 s).
idle_timeout: DurationIdle keep-alive connection timeout (default: 60 s).
request_timeout: DurationEnd-to-end request timeout enforced by the HTTP middleware stack (default: 30 s).
max_body_bytes: usizeMaximum accepted request body size in bytes (default: 2 MiB).
enable_h2c: boolEnable HTTP/2 cleartext (h2c) on the same port (default: true).
cors: Option<CorsPolicy>Optional CORS policy.
tls: Option<TlsConfig>Optional direct HTTPS serving configuration.
When configured, rustls is used with TLS 1.3 preferred and TLS 1.2 as the minimum protocol floor unless a stricter minimum is configured.
Implementations§
Trait Implementations§
Source§impl Clone for HttpServerConfig
impl Clone for HttpServerConfig
Source§fn clone(&self) -> HttpServerConfig
fn clone(&self) -> HttpServerConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HttpServerConfig
impl Debug for HttpServerConfig
Source§impl Default for HttpServerConfig
impl Default for HttpServerConfig
Source§impl<'de> Deserialize<'de> for HttpServerConfig
impl<'de> Deserialize<'de> for HttpServerConfig
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
Source§impl Validate for HttpServerConfig
impl Validate for HttpServerConfig
Auto Trait Implementations§
impl Freeze for HttpServerConfig
impl RefUnwindSafe for HttpServerConfig
impl Send for HttpServerConfig
impl Sync for HttpServerConfig
impl Unpin for HttpServerConfig
impl UnsafeUnpin for HttpServerConfig
impl UnwindSafe for HttpServerConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request