async_wasi::snapshots::common::net::async_tokio

Struct AsyncWasiSocket

Source
pub struct AsyncWasiSocket {
    pub state: Box<WasiSocketState>,
    /* private fields */
}

Fields§

§state: Box<WasiSocketState>

Implementations§

Source§

impl AsyncWasiSocket

Source§

impl AsyncWasiSocket

Source

pub fn from_tcplistener( listener: TcpListener, state: WasiSocketState, ) -> Result<Self>

Source

pub fn from_udpsocket(socket: UdpSocket, state: WasiSocketState) -> Result<Self>

Source§

impl AsyncWasiSocket

Source

pub fn open(state: WasiSocketState) -> Result<Self>

Source

pub fn bind(&mut self, addr: SocketAddr) -> Result<()>

Source

pub fn device(&self) -> Result<Option<Vec<u8>>>

Source

pub fn bind_device(&mut self, interface: Option<&[u8]>) -> Result<()>

Source

pub fn listen(&mut self, backlog: u32) -> Result<()>

Source

pub async fn accept(&mut self) -> Result<Self>

Source

pub async fn connect(&mut self, addr: SocketAddr) -> Result<()>

Source

pub async fn recv<'a>( &self, bufs: &mut [IoSliceMut<'a>], flags: c_int, ) -> Result<(usize, bool)>

Source

pub async fn recv_from<'a>( &self, bufs: &mut [IoSliceMut<'a>], flags: c_int, ) -> Result<(usize, bool, Option<SocketAddr>)>

Source

pub async fn send<'a>( &self, bufs: &[IoSlice<'a>], flags: c_int, ) -> Result<usize>

Source

pub async fn send_to<'a>( &self, bufs: &[IoSlice<'a>], addr: SocketAddr, flags: c_int, ) -> Result<usize>

Source

pub fn shutdown(&mut self, how: Shutdown) -> Result<()>

Source

pub fn get_peer(&mut self) -> Result<SocketAddr>

Source

pub fn get_local(&mut self) -> Result<SocketAddr>

Source

pub fn set_nonblocking(&mut self, nonblocking: bool) -> Result<()>

Source

pub fn get_nonblocking(&self) -> bool

Source

pub fn get_so_type(&self) -> (AddressFamily, SocketType)

Source

pub fn get_so_accept_conn(&self) -> Result<bool>

Source

pub fn sync_conn_state(&mut self)

Source

pub fn set_so_reuseaddr(&mut self, reuseaddr: bool) -> Result<()>

Source

pub fn get_so_reuseaddr(&self) -> bool

Source

pub fn set_so_recv_buf_size(&mut self, buf_size: usize) -> Result<()>

Source

pub fn get_so_recv_buf_size(&self) -> usize

Source

pub fn set_so_send_buf_size(&mut self, buf_size: usize) -> Result<()>

Source

pub fn get_so_send_buf_size(&mut self) -> usize

Source

pub fn set_so_recv_timeout(&mut self, timeout: Option<Duration>) -> Result<()>

Source

pub fn get_so_recv_timeout(&mut self) -> Option<Duration>

Source

pub fn set_so_send_timeout(&mut self, timeout: Option<Duration>) -> Result<()>

Source

pub fn get_so_send_timeout(&mut self) -> Option<Duration>

Source

pub fn get_so_error(&mut self) -> Result<Option<Error>>

Trait Implementations§

Source§

impl Debug for AsyncWasiSocket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.