pub struct AsyncWasiSocket {
    pub state: WasiSocketState,
    /* private fields */
}

Fields§

§state: 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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.