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
sourceimpl PortDescriptor
impl PortDescriptor
Creation and configuration.
Used when creating a server.
sourcepub fn http(host_data: Arc<HostCollection>) -> Self
pub fn http(host_data: Arc<HostCollection>) -> Self
Uses the defaults for non-secure HTTP with host_data
sourcepub fn https(host_data: Arc<HostCollection>) -> Self
Available on crate feature https
only.
pub fn https(host_data: Arc<HostCollection>) -> Self
https
only.Uses the defaults for secure HTTP, HTTPS, with host_data
.
Gets a rustls::ServerConfig
from HostCollection::make_config()
.
sourcepub fn with_server_config(
port: u16,
host_data: Arc<HostCollection>,
server_config: Option<Arc<ServerConfig>>
) -> Self
Available on crate feature https
only.
pub fn with_server_config(
port: u16,
host_data: Arc<HostCollection>,
server_config: Option<Arc<ServerConfig>>
) -> Self
https
only.Creates a new descriptor for port
with host_data
and an optional rustls::ServerConfig
.
sourcepub fn new(port: u16, host_data: Arc<HostCollection>) -> Self
pub fn new(port: u16, host_data: Arc<HostCollection>) -> Self
Creates a new descriptor for port
with host_data
.
If the feature https
is enabled, a rustls::ServerConfig
is created
from the host_data
.
sourcepub fn unsecure(port: u16, host_data: Arc<HostCollection>) -> Self
pub fn unsecure(port: u16, host_data: Arc<HostCollection>) -> Self
Creates a new non-secure descriptor for port
with host_data
.
Does not try to assign a certificate.
sourceimpl PortDescriptor
impl PortDescriptor
Inspection.
Used in ctl::Plugin
s.
sourcepub fn tls_config(&self) -> Option<&ServerConfig>
Available on crate feature https
only.
pub fn tls_config(&self) -> Option<&ServerConfig>
https
only.Get a reference to this port’s optional TLS config.
sourcepub fn hosts(&self) -> &HostCollection
pub fn hosts(&self) -> &HostCollection
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.
sourcepub fn internet_protocol(&self) -> BindIpVersion
pub fn internet_protocol(&self) -> BindIpVersion
Get the version of the internet protocol (IP) we are listening on
through Self::port
.
Trait Implementations
sourceimpl Clone for PortDescriptor
impl Clone for PortDescriptor
sourcefn clone(&self) -> PortDescriptor
fn clone(&self) -> PortDescriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for PortDescriptor
impl Send for PortDescriptor
impl Sync for PortDescriptor
impl Unpin for PortDescriptor
impl !UnwindSafe for PortDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more