pub enum QDnsSockerAddr {
Ip(SocketAddr),
Host(String, u16),
}
Expand description
A struct which implements the ToSocketAddrs to resolve A and AAAA
directly to functions which argumnets are implementing ToSocketAddrs
Available only for the sync
version. Tokio has ToSocketAddrs sealed
.
Variants§
Ip(SocketAddr)
Host(String, u16)
Implementations§
Source§impl QDnsSockerAddr
impl QDnsSockerAddr
Sourcepub fn resolve<D>(host: D) -> Result<Self>
pub fn resolve<D>(host: D) -> Result<Self>
Creates instance for A and AAAA records resolution from configured
in /etc/resolv.conf
DNS servers. The instance performs the DNS resolve
when passed to functions which arguments implements ToSocketAddrs.
§Arguments
host
-domain
:port
i.e example.com:443. Theip``port
is also possible and no DNS resolution will be performed.
Trait Implementations§
Source§impl Clone for QDnsSockerAddr
impl Clone for QDnsSockerAddr
Source§fn clone(&self) -> QDnsSockerAddr
fn clone(&self) -> QDnsSockerAddr
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 moreSource§impl Debug for QDnsSockerAddr
impl Debug for QDnsSockerAddr
Source§impl ToSocketAddrs for QDnsSockerAddr
impl ToSocketAddrs for QDnsSockerAddr
Source§type Iter = IntoIter<SocketAddr>
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond
to.
Source§fn to_socket_addrs(&self) -> Result<Self::Iter>
fn to_socket_addrs(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
SocketAddr
s. Read moreAuto Trait Implementations§
impl Freeze for QDnsSockerAddr
impl RefUnwindSafe for QDnsSockerAddr
impl Send for QDnsSockerAddr
impl Sync for QDnsSockerAddr
impl Unpin for QDnsSockerAddr
impl UnwindSafe for QDnsSockerAddr
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