kvarn

Struct RunConfig

source
pub struct RunConfig { /* private fields */ }
Expand description

Configuration for Self::execute. This mainly consists of an array of PortDescriptors.

It also allows control of handover.

Will bind a TcpListener on every port added using Self::bind

This ↑ will change when HTTP/3 support arrives, then Udp will also be used.

§Examples

See Self::execute as it uses this, created by a macro invocation.

let host = Host::unsecure("localhost", "web", Extensions::default(), host::Options::default());
let data = HostCollection::builder().insert(host).build();
let port_descriptor = PortDescriptor::new(8080, data);

let config = RunConfig::new()
    .bind(port_descriptor)
    .set_ctl_path("/run/kvarn-instance-1.sock");
config.execute().await.shutdown();

Implementations§

source§

impl RunConfig

source

pub fn new() -> Self