Struct kvarn::PortDescriptor

source ·
pub struct PortDescriptor { /* private fields */ }
Expand description

Describes port, certificate, and host data for a single port to bind.

See the note at the bottom of Host for an explanation about the relationship between Self::new and Self::unsecure.

Implementations§

source§

impl PortDescriptor

Creation and configuration.

Used when creating a server.

source

pub fn http(host_data: Arc<HostCollection>) -> Self

Uses the defaults for non-secure HTTP with host_data

source

pub fn https(host_data: Arc<HostCollection>) -> Self

Available on crate feature https only.

Uses the defaults for secure HTTP, HTTPS, with host_data. Gets a [rustls::ServerConfig] from HostCollection::make_config().