[−][src]Struct fumio_reactor::net::TcpListener
A TCP listening socket.
Methods
impl TcpListener
[src]
pub fn default_builder_for(local: &SocketAddr) -> Result<TcpBuilder>
[src]
Create builder with default options, but doesn't bind yet.
To create a TcpListener
from a builder go through the std::net::TcpListener
created by
builder.listen(...)?
.
pub fn bind_port(port: u16) -> Result<Self>
[src]
Binds a new listener to IPv6 [::]
with V6_ONLY=false (i.e. also listen on IPv4) to the
given port.
If the port is 0 the OS will select a random port.
pub fn bind_ipv4_port(port: u16) -> Result<Self>
[src]
Binds a new listener to IPv4 0.0.0.0
to the given port.
If the port is 0 the OS will select a random port.
pub fn bind(local: SocketAddr) -> Result<Self>
[src]
Bind a new listener to the specified address
Uses default_builder_for(addr)
to construct a builder, binds the address and listens with
a backlog of up to 1024 connections.
pub fn bind_with(local: SocketAddr, handle: LazyHandle) -> Result<Self>
[src]
Bind a new listener to the specified address
Uses default_builder_for(addr)
to construct a builder, binds the address and listens with
a backlog of up to 1024 connections.
pub fn from_std(listener: TcpListener, handle: LazyHandle) -> Result<Self>
[src]
Wraps a std
listener
pub fn from_mio(listener: TcpListener, handle: LazyHandle) -> Result<Self>
[src]
Wraps a mio
listener
pub fn local_addr(&self) -> Result<SocketAddr>
[src]
Returns the local socket address of this listener.
pub fn try_clone(&self) -> Result<Self>
[src]
Creates a new independently owned handle to the underlying socket.
The new listener isn't registered to a reactor yet.
pub fn try_clone_with(&self, handle: LazyHandle) -> Result<Self>
[src]
Creates a new independently owned handle to the underlying socket.
ⓘImportant traits for TcpIncoming<'_>pub fn incoming(&mut self) -> TcpIncoming
[src]
Stream of incoming (TcpStream, SocketAddr)
connections.
pub fn incoming_std(&mut self) -> TcpIncomingStd
[src]
Stream of incoming (std::net::TcpStream, SocketAddr)
connections.
pub fn poll_accept(
&mut self,
cx: &mut Context
) -> Poll<Result<(TcpStream, SocketAddr)>>
[src]
&mut self,
cx: &mut Context
) -> Poll<Result<(TcpStream, SocketAddr)>>
Accept a new connection or register context.
pub fn poll_accept_std(
&mut self,
cx: &mut Context
) -> Poll<Result<(TcpStream, SocketAddr)>>
[src]
&mut self,
cx: &mut Context
) -> Poll<Result<(TcpStream, SocketAddr)>>
Accept a new std
connection or register context.
Trait Implementations
impl Debug for TcpListener
[src]
impl TryFrom<TcpListener> for TcpListener
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(l: TcpListener) -> Result<Self>
[src]
impl TryFrom<TcpListener> for TcpListener
[src]
Auto Trait Implementations
impl Send for TcpListener
impl Unpin for TcpListener
impl Sync for TcpListener
impl !UnwindSafe for TcpListener
impl !RefUnwindSafe for TcpListener
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,