pub struct SessionConfig {
pub handler: Arc<dyn Handler>,
pub limits: Limits,
pub server_name: Option<String>,
pub hsts: Option<String>,
pub alt_svc: Option<String>,
pub compression: Options,
}Expand description
Shared, per-server settings a Session needs. Cheap to clone.
Fields§
§handler: Arc<dyn Handler>The request handler, shared across all connections.
limits: LimitsHTTP parsing limits.
server_name: Option<String>Server header value (or None to omit).
hsts: Option<String>Strict-Transport-Security header value to send on secure
connections (e.g. "max-age=31536000"), or None to omit it. Never
sent over plain HTTP, where HSTS is meaningless.
alt_svc: Option<String>Alt-Svc header value advertising alternative services such as HTTP/3
(e.g. r#"h3=":443"; ma=86400"#), or None to omit it.
compression: OptionsResponse compression options.
Implementations§
Source§impl SessionConfig
impl SessionConfig
Sourcepub fn new(handler: Arc<dyn Handler>) -> SessionConfig
pub fn new(handler: Arc<dyn Handler>) -> SessionConfig
Build a config around a handler, with default limits and compression.
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for SessionConfig
impl !UnwindSafe for SessionConfig
impl Freeze for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
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