Struct smtp_client::Client
source · [−]pub struct Client<C, P, Cfg> where
C: DnsHandle<Error = ResolveError>,
P: ConnectionProvider<Conn = C>,
Cfg: Config, { /* private fields */ }
Implementations
sourceimpl<C, P, Cfg> Client<C, P, Cfg> where
C: DnsHandle<Error = ResolveError>,
P: ConnectionProvider<Conn = C>,
Cfg: Config,
impl<C, P, Cfg> Client<C, P, Cfg> where
C: DnsHandle<Error = ResolveError>,
P: ConnectionProvider<Conn = C>,
Cfg: Config,
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> !RefUnwindSafe for Client<C, P, Cfg>
impl<C, P, Cfg> Send for Client<C, P, Cfg> where
Cfg: Send + Sync,
impl<C, P, Cfg> Sync for Client<C, P, Cfg> where
Cfg: Send + Sync,
impl<C, P, Cfg> Unpin for Client<C, P, Cfg>
impl<C, P, Cfg> !UnwindSafe for Client<C, P, Cfg>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more