Skip to main content

SmtpStream

Trait SmtpStream 

Source
pub trait SmtpStream:
    Read
    + Write
    + Send
    + Any {
    // Required method
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Available on crate feature client only.
Expand description

Marker for everything the client can run against; auto-implemented for any blocking Read + Write + Send + 'static impl. The Send supertrait flows the auto-trait through the Box<dyn SmtpStream> type erasure so SmtpClientStd can travel between threads. as_any_mut lets specialized callers (e.g. byte-level proxies that need StreamStd::set_read_timeout) downcast the boxed stream back to its concrete type.

Required Methods§

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Downcasts the boxed stream back to its concrete type.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Read + Write + Send + Any> SmtpStream for T