Function async_pop::new

source ·
pub async fn new<S: Read + Write + Unpin>(stream: S) -> Result<Client<S>>
Expand description

Creates a new pop3 client from an existing stream.

Examples

extern crate pop3;
use std::net::TcpStream;

fn main() {
    // Not recommended to use plaintext, just an example.
    let stream = TcpStream::connect(("outlook.office365.com", 110)).unwrap();

    let mut client = pop3::new(stream).unwrap();

    client.quit().unwrap();
}