pub enum DnsConfig {
UseSrv {
host: String,
srv: String,
fallback_port: u16,
resolver: Option<TokioResolver>,
},
NoSrv {
host: String,
port: u16,
resolver: Option<TokioResolver>,
},
Addr {
addr: String,
},
}Expand description
XMPP server connection configuration
Variants§
UseSrv
Available on crate feature
dns only.Use SRV record to find server host
Fields
§
resolver: Option<TokioResolver>Pre-configured DNS resolver
NoSrv
Available on crate feature
dns only.Manually define server host and port
Fields
§
resolver: Option<TokioResolver>Pre-configured DNS resolver
Addr
Manually define IP: port (TODO: socket)
Implementations§
Source§impl DnsConfig
impl DnsConfig
Sourcepub fn srv(host: &str, srv: &str, fallback_port: u16) -> Self
Available on crate feature dns only.
pub fn srv(host: &str, srv: &str, fallback_port: u16) -> Self
dns only.Constructor for DnsConfig::UseSrv variant
Sourcepub fn srv_default_client(host: &str) -> Self
Available on crate feature dns only.
pub fn srv_default_client(host: &str) -> Self
dns only.Constructor for the default SRV resolution strategy for clients (StartTLS)
Sourcepub fn srv_xmpps(host: &str) -> Self
Available on crate feature dns only.
pub fn srv_xmpps(host: &str) -> Self
dns only.Constructor for direct TLS connections using RFC 7590 _xmpps-client._tcp
Sourcepub fn no_srv(host: &str, port: u16) -> Self
Available on crate feature dns only.
pub fn no_srv(host: &str, port: u16) -> Self
dns only.Constructor for DnsConfig::NoSrv variant
Sourcepub fn with_resolver(&mut self, custom_resolver: TokioResolver)
Available on crate feature dns only.
pub fn with_resolver(&mut self, custom_resolver: TokioResolver)
dns only.Set pre-configured DNS resolver
Trait Implementations§
Source§impl From<DnsConfig> for DirectTlsServerConnector
Available on crate feature direct-tls only.
impl From<DnsConfig> for DirectTlsServerConnector
Available on crate feature
direct-tls only.Source§fn from(dns_config: DnsConfig) -> DirectTlsServerConnector
fn from(dns_config: DnsConfig) -> DirectTlsServerConnector
Converts to this type from the input type.
Source§impl From<DnsConfig> for StartTlsServerConnector
Available on crate feature starttls only.
impl From<DnsConfig> for StartTlsServerConnector
Available on crate feature
starttls only.Source§fn from(dns_config: DnsConfig) -> StartTlsServerConnector
fn from(dns_config: DnsConfig) -> StartTlsServerConnector
Converts to this type from the input type.
Source§impl From<DnsConfig> for TcpServerConnector
Available on crate feature insecure-tcp only.
impl From<DnsConfig> for TcpServerConnector
Available on crate feature
insecure-tcp only.Source§fn from(dns_config: DnsConfig) -> TcpServerConnector
fn from(dns_config: DnsConfig) -> TcpServerConnector
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for DnsConfig
impl !RefUnwindSafe for DnsConfig
impl Send for DnsConfig
impl Sync for DnsConfig
impl Unpin for DnsConfig
impl UnsafeUnpin for DnsConfig
impl !UnwindSafe for DnsConfig
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more