pub struct ServerArgs {
pub server_addr: SocketAddr,
pub server_tls_key: Option<TlsKeyPath>,
pub server_tls_certs: Option<TlsCertPath>,
}Available on crate feature
server only.Expand description
Command-line arguments used to configure a server
Fields§
§server_addr: SocketAddrThe server’s address
server_tls_key: Option<TlsKeyPath>The path to the server’s TLS key file.
This should be a PEM-encoded file containing a single PKCS#8 or RSA private key.
server_tls_certs: Option<TlsCertPath>The path to the server’s TLS certificate file.
This should be a PEM-encoded file containing at least one TLS end-entity certificate.
Implementations§
Source§impl ServerArgs
impl ServerArgs
Sourcepub async fn bind(self) -> Result<Bound, Error>
pub async fn bind(self) -> Result<Bound, Error>
Attempts to load credentials and bind the server socket
§Panics
This method panics if neither of the “rustls-tls” or “openssl-tls” Cargo features are enabled. See the module-level documentation for details.
Trait Implementations§
Source§impl Clone for ServerArgs
impl Clone for ServerArgs
Source§fn clone(&self) -> ServerArgs
fn clone(&self) -> ServerArgs
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerArgs
impl RefUnwindSafe for ServerArgs
impl Send for ServerArgs
impl Sync for ServerArgs
impl Unpin for ServerArgs
impl UnwindSafe for ServerArgs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more