Struct kvarn::host::Collection

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

A collection of Hosts, with an optional default and arbitrarily many others, indexed by [Host.name].

Tries to route to the host with it’s name. If no host with a matching name is found, it’ll fall back to default, if that’s Some.

When called from localhost, the first host added is always used.

If the feature https is enabled, [rustls::server::ResolvesServerCert] is implemented using the pattern described above.

Implementations§

source§

impl Collection

source

pub fn builder() -> CollectionBuilder

Creates a new CollectionBuilder with default_host as the default.

source

pub fn simple_non_secure( default_host_name: impl