pub struct TCPConnect { /* private fields */ }
Expand description
TCP stream connector with DNS caching.
This type is internally reference-counted and can be freely cloned.
Implementations§
Source§impl TCPConnect
impl TCPConnect
Sourcepub fn builder() -> TCPConnectBuilder
pub fn builder() -> TCPConnectBuilder
Create a new builder to configure the TCPConnect
instance.
§Examples
use std::time::Duration;
use tcp_connect::TCPConnect;
let comet = TCPConnect::builder()
.dns_ttl(Duration::from_secs(60))
.dns_max_stale_time(Duration::from_secs(1))
.build();
pub fn connect(&self, addr: &str) -> Result<TcpStream>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TCPConnect
impl RefUnwindSafe for TCPConnect
impl Send for TCPConnect
impl Sync for TCPConnect
impl Unpin for TCPConnect
impl UnwindSafe for TCPConnect
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