Type Alias vector_core::tls::MaybeTlsSettings
source · pub type MaybeTlsSettings = MaybeTls<(), TlsSettings>;
Aliased Type§
enum MaybeTlsSettings {
Raw(()),
Tls(TlsSettings),
}
Variants§
Raw(())
Tls(TlsSettings)
Implementations§
source§impl MaybeTlsSettings
impl MaybeTlsSettings
pub async fn bind(&self, addr: &SocketAddr) -> Result<MaybeTlsListener>
pub async fn bind_with_allowlist( &self, addr: &SocketAddr, allow_origin: Vec<IpNet>, ) -> Result<MaybeTlsListener>
source§impl MaybeTlsSettings
impl MaybeTlsSettings
pub async fn connect( &self, host: &str, addr: &SocketAddr, ) -> Result<MaybeTlsStream<TcpStream>>
source§impl MaybeTlsSettings
impl MaybeTlsSettings
pub fn enable_client() -> Result<Self>
pub fn tls_client(config: &Option<TlsConfig>) -> Result<Self>
sourcepub fn from_config(
config: &Option<TlsEnableableConfig>,
for_server: bool,
) -> Result<Self>
pub fn from_config( config: &Option<TlsEnableableConfig>, for_server: bool, ) -> Result<Self>
Generate an optional settings struct from the given optional
configuration reference. If config
is None
, TLS is
disabled. The for_server
parameter indicates the options
should be interpreted as being for a TLS server, which requires
an identity certificate and changes the certificate verification
default to false.
pub const fn http_protocol_name(&self) -> &'static str
Trait Implementations§
source§impl From<TlsSettings> for MaybeTlsSettings
impl From<TlsSettings> for MaybeTlsSettings
source§fn from(tls: TlsSettings) -> Self
fn from(tls: TlsSettings) -> Self
Converts to this type from the input type.