Struct wasmedge_wasi_socket::TcpListener
source · pub struct TcpListener {
pub address: Result<SocketAddr>,
pub port: Option<u16>,
/* private fields */
}
Fields§
§address: Result<SocketAddr>
§port: Option<u16>
Implementations§
source§impl TcpListener
impl TcpListener
sourcepub fn bind<A: ToSocketAddrs>(
addrs: A,
nonblocking: bool
) -> Result<TcpListener>
pub fn bind<A: ToSocketAddrs>( addrs: A, nonblocking: bool ) -> Result<TcpListener>
Create TCP socket and bind to the given address.
If multiple address is given, the first successful socket is returned.
sourcepub fn accept(&self, nonblocking: bool) -> Result<(TcpStream, SocketAddr)>
pub fn accept(&self, nonblocking: bool) -> Result<(TcpStream, SocketAddr)>
Accept incoming connections with given file descriptor flags.
pub fn incoming(&self) -> Incoming<'_> ⓘ
sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Get local address.
Trait Implementations§
source§impl AsMut<Socket> for TcpListener
impl AsMut<Socket> for TcpListener
source§impl AsRawFd for TcpListener
impl AsRawFd for TcpListener
source§impl AsRef<Socket> for TcpListener
impl AsRef<Socket> for TcpListener
source§impl Debug for TcpListener
impl Debug for TcpListener
source§impl FromRawFd for TcpListener
impl FromRawFd for TcpListener
source§unsafe fn from_raw_fd(fd: RawFd) -> Self
unsafe fn from_raw_fd(fd: RawFd) -> Self
Constructs a new instance of
Self
from the given raw file
descriptor. Read moresource§impl IntoRawFd for TcpListener
impl IntoRawFd for TcpListener
source§fn into_raw_fd(self) -> RawFd
fn into_raw_fd(self) -> RawFd
Consumes this object, returning the raw underlying file descriptor. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for TcpListener
impl Send for TcpListener
impl Sync for TcpListener
impl Unpin for TcpListener
impl !UnwindSafe for TcpListener
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more