pub struct Client<C, P, Cfg>{ /* private fields */ }
Implementations§
Source§impl<C, P, Cfg> Client<C, P, Cfg>
impl<C, P, Cfg> Client<C, P, Cfg>
Sourcepub fn new(resolver: AsyncResolver<C, P>, cfg: Arc<Cfg>) -> Client<C, P, Cfg>
pub fn new(resolver: AsyncResolver<C, P>, cfg: Arc<Cfg>) -> Client<C, P, Cfg>
Note: Passing as resolver
something that is configured with
Ipv6andIpv4
may lead to unexpected behavior, as the client will
attempt to connect to both the Ipv6 and the Ipv4 address if whichever
comes first doesn’t successfully connect. In particular, it means that
performance could be degraded.
pub async fn get_destination( &self, host: &Hostname, ) -> Result<Destination, TransportError>
pub async fn connect( &self, dest: &Destination, ) -> Result<Sender<Cfg>, TransportError>
pub async fn connect_to_mx( &self, host: &str, ) -> Result<Sender<Cfg>, TransportError>
pub async fn connect_to_ip( &self, ip: IpAddr, port: u16, ) -> Result<Sender<Cfg>, TransportError>
pub async fn connect_to_stream( &self, io: DynAsyncReadWrite, ) -> Result<Sender<Cfg>, TransportError>
Auto Trait Implementations§
impl<C, P, Cfg> Freeze for Client<C, P, Cfg>
impl<C, P, Cfg> !RefUnwindSafe for Client<C, P, Cfg>
impl<C, P, Cfg> Send for Client<C, P, Cfg>
impl<C, P, Cfg> Sync for Client<C, P, Cfg>
impl<C, P, Cfg> Unpin for Client<C, P, Cfg>
impl<C, P, Cfg> !UnwindSafe for Client<C, P, Cfg>
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