1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
use std::io; use mio::net::TcpListener; pub struct Tcp{} impl Tcp { pub fn bind(addr:&str) -> io::Result<TcpListener> { let addr = addr.parse().unwrap(); TcpListener::bind(addr) } }