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

Creation and configuration.

Used when creating a server.

Uses the defaults for non-secure HTTP with host_data

Available on crate feature https only.

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

Available on crate feature https only.

Creates a new descriptor for port with host_data and an optional [rustls::ServerConfig].

Creates a new descriptor for port with host_data. If the feature https is enabled, a rustls::ServerConfig is created from the host_data.

Creates a new non-secure descriptor for port with host_data. Does not try to assign a certificate.

Binds to IPv4 only. The default is to bind both.

This disables IPv6 for this port.

Binds to IPv6 only. The default is to bind both.

This disables IPv4 for this port.

Inspection.

Used in ctl::Plugins.

Get the port this description is associated with.

Available on crate feature https only.

Get a reference to this port’s optional TLS config.

Get the associated hosts.

This can be used to remove entries from the response & file cache.

Remember, this collection can be the same as for any other port descriptor.

Get the version of the internet protocol (IP) we are listening on through Self::port.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more