Struct connect::Connection [−][src]
pub struct Connection { /* fields omitted */ }
An object of Connection
represents an incoming or outgoing connection.
Methods
impl Connection
[src]
impl Connection
pub fn new(stream: TcpStream, mode: ConnectionMode) -> Connection
[src]
pub fn new(stream: TcpStream, mode: ConnectionMode) -> Connection
Creates a new instance of Connection
with given TcpStream
and ConnectionMode
.
pub fn handle(&self) -> ConnectionHandle
[src]
pub fn handle(&self) -> ConnectionHandle
Returns ConnectionHandle
for this connection.
pub fn connect(addr: &SocketAddr) -> Result<Connection>
[src]
pub fn connect(addr: &SocketAddr) -> Result<Connection>
Returns an Outgoing
connection to given address.
Trait Implementations
impl Evented for Connection
[src]
impl Evented for Connection
fn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
[src]
fn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
Register self
with the given Poll
instance. Read more
fn reregister(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
[src]
fn reregister(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
Re-register self
with the given Poll
instance. Read more
fn deregister(&self, poll: &Poll) -> Result<()>
[src]
fn deregister(&self, poll: &Poll) -> Result<()>
Deregister self
from the given Poll
instance Read more
Auto Trait Implementations
impl Send for Connection
impl Send for Connection
impl Sync for Connection
impl Sync for Connection