Struct trust_dns_client::tcp::TcpClientConnection
source · pub struct TcpClientConnection { /* private fields */ }
Expand description
Tcp client connection
Use with trust_dns_client::client::Client
impls
Implementations§
source§impl TcpClientConnection
impl TcpClientConnection
sourcepub fn new(name_server: SocketAddr) -> ClientResult<Self>
pub fn new(name_server: SocketAddr) -> ClientResult<Self>
Creates a new client connection.
Note this has side affects of establishing the connection to the specified DNS server and starting the event_loop. Expect this to change in the future.
Default connection timeout is 5 seconds
Arguments
name_server
- address of the name server to use for queries
sourcepub fn with_timeout(
name_server: SocketAddr,
timeout: Duration
) -> ClientResult<Self>
pub fn with_timeout( name_server: SocketAddr, timeout: Duration ) -> ClientResult<Self>
Creates a new client connection.
Note this has side affects of establishing the connection to the specified DNS server and starting the event_loop. Expect this to change in the future.
Arguments
name_server
- address of the name server to use for queriestimeout
- connection timeout
sourcepub fn with_bind_addr_and_timeout(
name_server: SocketAddr,
bind_addr: Option<SocketAddr>,
timeout: Duration
) -> ClientResult<Self>
pub fn with_bind_addr_and_timeout( name_server: SocketAddr, bind_addr: Option<SocketAddr>, timeout: Duration ) -> ClientResult<Self>
Creates a new client connection.
Note this has side affects of establishing the connection to the specified DNS server and starting the event_loop. Expect this to change in the future.
Arguments
name_server
- address of the name server to use for queriesbind_addr
- IP address and port to connect fromtimeout
- connection timeout
Trait Implementations§
source§impl ClientConnection for TcpClientConnection
impl ClientConnection for TcpClientConnection
§type Sender = DnsMultiplexer<TcpClientStream<AsyncIoTokioAsStd<TcpStream>>, Signer>
type Sender = DnsMultiplexer<TcpClientStream<AsyncIoTokioAsStd<TcpStream>>, Signer>
The associated DNS RequestSender type.
§type SenderFuture = DnsMultiplexerConnect<TcpClientConnect<AsyncIoTokioAsStd<TcpStream>>, TcpClientStream<AsyncIoTokioAsStd<TcpStream>>, Signer>
type SenderFuture = DnsMultiplexerConnect<TcpClientConnect<AsyncIoTokioAsStd<TcpStream>>, TcpClientStream<AsyncIoTokioAsStd<TcpStream>>, Signer>
A future that resolves to the RequestSender
source§fn new_stream(&self, signer: Option<Arc<Signer>>) -> Self::SenderFuture
fn new_stream(&self, signer: Option<Arc<Signer>>) -> Self::SenderFuture
Construct a new stream for use in the Client
source§impl Clone for TcpClientConnection
impl Clone for TcpClientConnection
source§fn clone(&self) -> TcpClientConnection
fn clone(&self) -> TcpClientConnection
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 moreimpl Copy for TcpClientConnection
Auto Trait Implementations§
impl RefUnwindSafe for TcpClientConnection
impl Send for TcpClientConnection
impl Sync for TcpClientConnection
impl Unpin for TcpClientConnection
impl UnwindSafe for TcpClientConnection
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