pub struct WasiSocketsCtxView<'a> {
pub ctx: &'a mut WasiSocketsCtx,
pub table: &'a mut ResourceTable,
}
Fields§
§ctx: &'a mut WasiSocketsCtx
§table: &'a mut ResourceTable
Trait Implementations§
Source§impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
Source§impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
fn convert_error_code(&mut self, error: SocketError) -> Result<ErrorCode>
Source§impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
Source§fn create_tcp_socket(
&mut self,
address_family: IpAddressFamily,
) -> SocketResult<Resource<TcpSocket>>
fn create_tcp_socket( &mut self, address_family: IpAddressFamily, ) -> SocketResult<Resource<TcpSocket>>
Create a new TCP socket. Read more
Source§impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
Source§fn create_udp_socket(
&mut self,
address_family: IpAddressFamily,
) -> SocketResult<Resource<UdpSocket>>
fn create_udp_socket( &mut self, address_family: IpAddressFamily, ) -> SocketResult<Resource<UdpSocket>>
Create a new UDP socket. Read more
Source§impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
Source§fn resolve_addresses(
&mut self,
network: Resource<Network>,
name: String,
) -> Result<Resource<ResolveAddressStream>, SocketError>
fn resolve_addresses( &mut self, network: Resource<Network>, name: String, ) -> Result<Resource<ResolveAddressStream>, SocketError>
Resolve an internet host name to a list of IP addresses. Read more
Source§impl HostIncomingDatagramStream for WasiSocketsCtxView<'_>
impl HostIncomingDatagramStream for WasiSocketsCtxView<'_>
Source§fn receive(
&mut self,
this: Resource<IncomingDatagramStream>,
max_results: u64,
) -> SocketResult<Vec<IncomingDatagram>>
fn receive( &mut self, this: Resource<IncomingDatagramStream>, max_results: u64, ) -> SocketResult<Vec<IncomingDatagram>>
Receive messages on the socket. Read more
Source§fn subscribe(
&mut self,
this: Resource<IncomingDatagramStream>,
) -> Result<Resource<DynPollable>>
fn subscribe( &mut self, this: Resource<IncomingDatagramStream>, ) -> Result<Resource<DynPollable>>
Create a
pollable
which will resolve once the stream is ready to receive again. Read morefn drop(&mut self, this: Resource<IncomingDatagramStream>) -> Result<(), Error>
Source§impl HostIncomingDatagramStream for WasiSocketsCtxView<'_>
impl HostIncomingDatagramStream for WasiSocketsCtxView<'_>
Source§fn receive(
&mut self,
self_: Resource<IncomingDatagramStream>,
max_results: u64,
) -> Result<Vec<IncomingDatagram>, SocketError>
fn receive( &mut self, self_: Resource<IncomingDatagramStream>, max_results: u64, ) -> Result<Vec<IncomingDatagram>, SocketError>
Receive messages on the socket. Read more
Source§fn subscribe(
&mut self,
self_: Resource<IncomingDatagramStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<IncomingDatagramStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the stream is ready to receive again. Read morefn drop(&mut self, rep: Resource<IncomingDatagramStream>) -> Result<()>
Source§impl HostNetwork for WasiSocketsCtxView<'_>
impl HostNetwork for WasiSocketsCtxView<'_>
Source§impl HostOutgoingDatagramStream for WasiSocketsCtxView<'_>
impl HostOutgoingDatagramStream for WasiSocketsCtxView<'_>
Source§fn check_send(
&mut self,
this: Resource<OutgoingDatagramStream>,
) -> SocketResult<u64>
fn check_send( &mut self, this: Resource<OutgoingDatagramStream>, ) -> SocketResult<u64>
Check readiness for sending. This function never blocks. Read more
Source§async fn send(
&mut self,
this: Resource<OutgoingDatagramStream>,
datagrams: Vec<OutgoingDatagram>,
) -> SocketResult<u64>
async fn send( &mut self, this: Resource<OutgoingDatagramStream>, datagrams: Vec<OutgoingDatagram>, ) -> SocketResult<u64>
Send messages on the socket. Read more
Source§fn subscribe(
&mut self,
this: Resource<OutgoingDatagramStream>,
) -> Result<Resource<DynPollable>>
fn subscribe( &mut self, this: Resource<OutgoingDatagramStream>, ) -> Result<Resource<DynPollable>>
Create a
pollable
which will resolve once the stream is ready to send again. Read morefn drop(&mut self, this: Resource<OutgoingDatagramStream>) -> Result<(), Error>
Source§impl HostOutgoingDatagramStream for WasiSocketsCtxView<'_>
impl HostOutgoingDatagramStream for WasiSocketsCtxView<'_>
Source§fn check_send(
&mut self,
self_: Resource<OutgoingDatagramStream>,
) -> Result<u64, SocketError>
fn check_send( &mut self, self_: Resource<OutgoingDatagramStream>, ) -> Result<u64, SocketError>
Check readiness for sending. This function never blocks. Read more
Source§fn send(
&mut self,
self_: Resource<OutgoingDatagramStream>,
datagrams: Vec<OutgoingDatagram>,
) -> Result<u64, SocketError>
fn send( &mut self, self_: Resource<OutgoingDatagramStream>, datagrams: Vec<OutgoingDatagram>, ) -> Result<u64, SocketError>
Send messages on the socket. Read more
Source§fn subscribe(
&mut self,
self_: Resource<OutgoingDatagramStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<OutgoingDatagramStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the stream is ready to send again. Read morefn drop(&mut self, rep: Resource<OutgoingDatagramStream>) -> Result<()>
Source§impl HostResolveAddressStream for WasiSocketsCtxView<'_>
impl HostResolveAddressStream for WasiSocketsCtxView<'_>
Source§fn resolve_next_address(
&mut self,
resource: Resource<ResolveAddressStream>,
) -> Result<Option<IpAddress>, SocketError>
fn resolve_next_address( &mut self, resource: Resource<ResolveAddressStream>, ) -> Result<Option<IpAddress>, SocketError>
Returns the next address from the resolver. Read more
Source§fn subscribe(
&mut self,
resource: Resource<ResolveAddressStream>,
) -> Result<Resource<DynPollable>>
fn subscribe( &mut self, resource: Resource<ResolveAddressStream>, ) -> Result<Resource<DynPollable>>
Create a
pollable
which will resolve once the stream is ready for I/O. Read morefn drop(&mut self, resource: Resource<ResolveAddressStream>) -> Result<()>
Source§impl HostTcpSocket for WasiSocketsCtxView<'_>
impl HostTcpSocket for WasiSocketsCtxView<'_>
Source§async fn start_bind(
&mut self,
this: Resource<TcpSocket>,
network: Resource<Network>,
local_address: IpSocketAddress,
) -> SocketResult<()>
async fn start_bind( &mut self, this: Resource<TcpSocket>, network: Resource<Network>, local_address: IpSocketAddress, ) -> SocketResult<()>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind(&mut self, this: Resource<TcpSocket>) -> SocketResult<()>
Source§async fn start_connect(
&mut self,
this: Resource<TcpSocket>,
network: Resource<Network>,
remote_address: IpSocketAddress,
) -> SocketResult<()>
async fn start_connect( &mut self, this: Resource<TcpSocket>, network: Resource<Network>, remote_address: IpSocketAddress, ) -> SocketResult<()>
Connect to a remote endpoint. Read more
fn finish_connect( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<(Resource<DynInputStream>, Resource<DynOutputStream>)>
Source§fn start_listen(&mut self, this: Resource<TcpSocket>) -> SocketResult<()>
fn start_listen(&mut self, this: Resource<TcpSocket>) -> SocketResult<()>
Start listening for new connections. Read more
fn finish_listen(&mut self, this: Resource<TcpSocket>) -> SocketResult<()>
Source§fn accept(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<(Resource<TcpSocket>, Resource<DynInputStream>, Resource<DynOutputStream>)>
fn accept( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<(Resource<TcpSocket>, Resource<DynInputStream>, Resource<DynOutputStream>)>
Accept a new client socket. Read more
Source§fn local_address(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<IpSocketAddress>
fn local_address( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<IpSocketAddress>
Get the bound local address. Read more
Source§fn remote_address(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<IpSocketAddress>
fn remote_address( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<IpSocketAddress>
Get the remote address. Read more
Source§fn is_listening(&mut self, this: Resource<TcpSocket>) -> Result<bool, Error>
fn is_listening(&mut self, this: Resource<TcpSocket>) -> Result<bool, Error>
Whether the socket is in the
listening
state. Read moreSource§fn address_family(
&mut self,
this: Resource<TcpSocket>,
) -> Result<IpAddressFamily, Error>
fn address_family( &mut self, this: Resource<TcpSocket>, ) -> Result<IpAddressFamily, Error>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn set_listen_backlog_size(
&mut self,
this: Resource<TcpSocket>,
value: u64,
) -> SocketResult<()>
fn set_listen_backlog_size( &mut self, this: Resource<TcpSocket>, value: u64, ) -> SocketResult<()>
Hints the desired listen queue size. Implementations are free to ignore this. Read more
Source§fn keep_alive_enabled(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<bool>
fn keep_alive_enabled( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<bool>
Enables or disables keepalive. Read more
fn set_keep_alive_enabled( &mut self, this: Resource<TcpSocket>, value: bool, ) -> SocketResult<()>
Source§fn keep_alive_idle_time(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<u64>
fn keep_alive_idle_time( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<u64>
Amount of time the connection has to be idle before TCP starts sending keepalive packets. Read more
fn set_keep_alive_idle_time( &mut self, this: Resource<TcpSocket>, value: u64, ) -> SocketResult<()>
Source§fn keep_alive_interval(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<u64>
fn keep_alive_interval( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<u64>
The time between keepalive packets. Read more
fn set_keep_alive_interval( &mut self, this: Resource<TcpSocket>, value: u64, ) -> SocketResult<()>
Source§fn keep_alive_count(&mut self, this: Resource<TcpSocket>) -> SocketResult<u32>
fn keep_alive_count(&mut self, this: Resource<TcpSocket>) -> SocketResult<u32>
The maximum amount of keepalive packets TCP should send before aborting the connection. Read more
fn set_keep_alive_count( &mut self, this: Resource<TcpSocket>, value: u32, ) -> SocketResult<()>
Source§fn hop_limit(&mut self, this: Resource<TcpSocket>) -> SocketResult<u8>
fn hop_limit(&mut self, this: Resource<TcpSocket>) -> SocketResult<u8>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_hop_limit( &mut self, this: Resource<TcpSocket>, value: u8, ) -> SocketResult<()>
Source§fn receive_buffer_size(
&mut self,
this: Resource<TcpSocket>,
) -> SocketResult<u64>
fn receive_buffer_size( &mut self, this: Resource<TcpSocket>, ) -> SocketResult<u64>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, this: Resource<TcpSocket>, value: u64, ) -> SocketResult<()>
fn send_buffer_size(&mut self, this: Resource<TcpSocket>) -> SocketResult<u64>
fn set_send_buffer_size( &mut self, this: Resource<TcpSocket>, value: u64, ) -> SocketResult<()>
Source§fn subscribe(
&mut self,
this: Resource<TcpSocket>,
) -> Result<Resource<DynPollable>>
fn subscribe( &mut self, this: Resource<TcpSocket>, ) -> Result<Resource<DynPollable>>
Create a
pollable
which can be used to poll for, or block on,
completion of any of the asynchronous operations of this socket. Read moreSource§fn shutdown(
&mut self,
this: Resource<TcpSocket>,
shutdown_type: ShutdownType,
) -> SocketResult<()>
fn shutdown( &mut self, this: Resource<TcpSocket>, shutdown_type: ShutdownType, ) -> SocketResult<()>
Initiate a graceful shutdown. Read more
fn drop(&mut self, this: Resource<TcpSocket>) -> Result<(), Error>
Source§impl HostTcpSocket for WasiSocketsCtxView<'_>
impl HostTcpSocket for WasiSocketsCtxView<'_>
Source§fn start_bind(
&mut self,
self_: Resource<TcpSocket>,
network: Resource<Network>,
local_address: IpSocketAddress,
) -> Result<(), SocketError>
fn start_bind( &mut self, self_: Resource<TcpSocket>, network: Resource<Network>, local_address: IpSocketAddress, ) -> Result<(), SocketError>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind(&mut self, self_: Resource<TcpSocket>) -> Result<(), SocketError>
Source§fn start_connect(
&mut self,
self_: Resource<TcpSocket>,
network: Resource<Network>,
remote_address: IpSocketAddress,
) -> Result<(), SocketError>
fn start_connect( &mut self, self_: Resource<TcpSocket>, network: Resource<Network>, remote_address: IpSocketAddress, ) -> Result<(), SocketError>
Connect to a remote endpoint. Read more
fn finish_connect( &mut self, self_: Resource<TcpSocket>, ) -> Result<(Resource<InputStream>, Resource<OutputStream>), SocketError>
Source§fn start_listen(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<(), SocketError>
fn start_listen( &mut self, self_: Resource<TcpSocket>, ) -> Result<(), SocketError>
Start listening for new connections. Read more
fn finish_listen( &mut self, self_: Resource<TcpSocket>, ) -> Result<(), SocketError>
Source§fn accept(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<(Resource<TcpSocket>, Resource<InputStream>, Resource<OutputStream>), SocketError>
fn accept( &mut self, self_: Resource<TcpSocket>, ) -> Result<(Resource<TcpSocket>, Resource<InputStream>, Resource<OutputStream>), SocketError>
Accept a new client socket. Read more
Source§fn local_address(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<IpSocketAddress, SocketError>
fn local_address( &mut self, self_: Resource<TcpSocket>, ) -> Result<IpSocketAddress, SocketError>
Get the bound local address. Read more
Source§fn remote_address(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<IpSocketAddress, SocketError>
fn remote_address( &mut self, self_: Resource<TcpSocket>, ) -> Result<IpSocketAddress, SocketError>
Get the remote address. Read more
Source§fn is_listening(&mut self, self_: Resource<TcpSocket>) -> Result<bool>
fn is_listening(&mut self, self_: Resource<TcpSocket>) -> Result<bool>
Whether the socket is in the
listening
state. Read moreSource§fn address_family(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<IpAddressFamily>
fn address_family( &mut self, self_: Resource<TcpSocket>, ) -> Result<IpAddressFamily>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn set_listen_backlog_size(
&mut self,
self_: Resource<TcpSocket>,
value: u64,
) -> Result<(), SocketError>
fn set_listen_backlog_size( &mut self, self_: Resource<TcpSocket>, value: u64, ) -> Result<(), SocketError>
Hints the desired listen queue size. Implementations are free to ignore this. Read more
Source§fn keep_alive_enabled(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<bool, SocketError>
fn keep_alive_enabled( &mut self, self_: Resource<TcpSocket>, ) -> Result<bool, SocketError>
Enables or disables keepalive. Read more
fn set_keep_alive_enabled( &mut self, self_: Resource<TcpSocket>, value: bool, ) -> Result<(), SocketError>
Source§fn keep_alive_idle_time(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<Duration, SocketError>
fn keep_alive_idle_time( &mut self, self_: Resource<TcpSocket>, ) -> Result<Duration, SocketError>
Amount of time the connection has to be idle before TCP starts sending keepalive packets. Read more
fn set_keep_alive_idle_time( &mut self, self_: Resource<TcpSocket>, value: Duration, ) -> Result<(), SocketError>
Source§fn keep_alive_interval(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<Duration, SocketError>
fn keep_alive_interval( &mut self, self_: Resource<TcpSocket>, ) -> Result<Duration, SocketError>
The time between keepalive packets. Read more
fn set_keep_alive_interval( &mut self, self_: Resource<TcpSocket>, value: Duration, ) -> Result<(), SocketError>
Source§fn keep_alive_count(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<u32, SocketError>
fn keep_alive_count( &mut self, self_: Resource<TcpSocket>, ) -> Result<u32, SocketError>
The maximum amount of keepalive packets TCP should send before aborting the connection. Read more
fn set_keep_alive_count( &mut self, self_: Resource<TcpSocket>, value: u32, ) -> Result<(), SocketError>
Source§fn hop_limit(&mut self, self_: Resource<TcpSocket>) -> Result<u8, SocketError>
fn hop_limit(&mut self, self_: Resource<TcpSocket>) -> Result<u8, SocketError>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_hop_limit( &mut self, self_: Resource<TcpSocket>, value: u8, ) -> Result<(), SocketError>
Source§fn receive_buffer_size(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<u64, SocketError>
fn receive_buffer_size( &mut self, self_: Resource<TcpSocket>, ) -> Result<u64, SocketError>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, self_: Resource<TcpSocket>, value: u64, ) -> Result<(), SocketError>
fn send_buffer_size( &mut self, self_: Resource<TcpSocket>, ) -> Result<u64, SocketError>
fn set_send_buffer_size( &mut self, self_: Resource<TcpSocket>, value: u64, ) -> Result<(), SocketError>
Source§fn subscribe(
&mut self,
self_: Resource<TcpSocket>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<TcpSocket>, ) -> Result<Resource<Pollable>>
Create a
pollable
which can be used to poll for, or block on,
completion of any of the asynchronous operations of this socket. Read moreSource§fn shutdown(
&mut self,
self_: Resource<TcpSocket>,
shutdown_type: ShutdownType,
) -> Result<(), SocketError>
fn shutdown( &mut self, self_: Resource<TcpSocket>, shutdown_type: ShutdownType, ) -> Result<(), SocketError>
Initiate a graceful shutdown. Read more
fn drop(&mut self, rep: Resource<TcpSocket>) -> Result<()>
Source§impl HostUdpSocket for WasiSocketsCtxView<'_>
impl HostUdpSocket for WasiSocketsCtxView<'_>
Source§async fn start_bind(
&mut self,
this: Resource<UdpSocket>,
network: Resource<Network>,
local_address: IpSocketAddress,
) -> SocketResult<()>
async fn start_bind( &mut self, this: Resource<UdpSocket>, network: Resource<Network>, local_address: IpSocketAddress, ) -> SocketResult<()>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind(&mut self, this: Resource<UdpSocket>) -> SocketResult<()>
Source§async fn stream(
&mut self,
this: Resource<UdpSocket>,
remote_address: Option<IpSocketAddress>,
) -> SocketResult<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>)>
async fn stream( &mut self, this: Resource<UdpSocket>, remote_address: Option<IpSocketAddress>, ) -> SocketResult<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>)>
Set up inbound & outbound communication channels, optionally to a specific peer. Read more
Source§fn local_address(
&mut self,
this: Resource<UdpSocket>,
) -> SocketResult<IpSocketAddress>
fn local_address( &mut self, this: Resource<UdpSocket>, ) -> SocketResult<IpSocketAddress>
Get the current bound address. Read more
Source§fn remote_address(
&mut self,
this: Resource<UdpSocket>,
) -> SocketResult<IpSocketAddress>
fn remote_address( &mut self, this: Resource<UdpSocket>, ) -> SocketResult<IpSocketAddress>
Get the address the socket is currently streaming to. Read more
Source§fn address_family(
&mut self,
this: Resource<UdpSocket>,
) -> Result<IpAddressFamily, Error>
fn address_family( &mut self, this: Resource<UdpSocket>, ) -> Result<IpAddressFamily, Error>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn unicast_hop_limit(&mut self, this: Resource<UdpSocket>) -> SocketResult<u8>
fn unicast_hop_limit(&mut self, this: Resource<UdpSocket>) -> SocketResult<u8>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_unicast_hop_limit( &mut self, this: Resource<UdpSocket>, value: u8, ) -> SocketResult<()>
Source§fn receive_buffer_size(
&mut self,
this: Resource<UdpSocket>,
) -> SocketResult<u64>
fn receive_buffer_size( &mut self, this: Resource<UdpSocket>, ) -> SocketResult<u64>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, this: Resource<UdpSocket>, value: u64, ) -> SocketResult<()>
fn send_buffer_size(&mut self, this: Resource<UdpSocket>) -> SocketResult<u64>
fn set_send_buffer_size( &mut self, this: Resource<UdpSocket>, value: u64, ) -> SocketResult<()>
Source§fn subscribe(
&mut self,
this: Resource<UdpSocket>,
) -> Result<Resource<DynPollable>>
fn subscribe( &mut self, this: Resource<UdpSocket>, ) -> Result<Resource<DynPollable>>
Create a
pollable
which will resolve once the socket is ready for I/O. Read morefn drop(&mut self, this: Resource<UdpSocket>) -> Result<(), Error>
Source§impl HostUdpSocket for WasiSocketsCtxView<'_>
impl HostUdpSocket for WasiSocketsCtxView<'_>
Source§fn start_bind(
&mut self,
self_: Resource<UdpSocket>,
network: Resource<Network>,
local_address: IpSocketAddress,
) -> Result<(), SocketError>
fn start_bind( &mut self, self_: Resource<UdpSocket>, network: Resource<Network>, local_address: IpSocketAddress, ) -> Result<(), SocketError>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind(&mut self, self_: Resource<UdpSocket>) -> Result<(), SocketError>
Source§fn stream(
&mut self,
self_: Resource<UdpSocket>,
remote_address: Option<IpSocketAddress>,
) -> Result<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>), SocketError>
fn stream( &mut self, self_: Resource<UdpSocket>, remote_address: Option<IpSocketAddress>, ) -> Result<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>), SocketError>
Set up inbound & outbound communication channels, optionally to a specific peer. Read more
Source§fn local_address(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<IpSocketAddress, SocketError>
fn local_address( &mut self, self_: Resource<UdpSocket>, ) -> Result<IpSocketAddress, SocketError>
Get the current bound address. Read more
Source§fn remote_address(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<IpSocketAddress, SocketError>
fn remote_address( &mut self, self_: Resource<UdpSocket>, ) -> Result<IpSocketAddress, SocketError>
Get the address the socket is currently streaming to. Read more
Source§fn address_family(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<IpAddressFamily>
fn address_family( &mut self, self_: Resource<UdpSocket>, ) -> Result<IpAddressFamily>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn unicast_hop_limit(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<u8, SocketError>
fn unicast_hop_limit( &mut self, self_: Resource<UdpSocket>, ) -> Result<u8, SocketError>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_unicast_hop_limit( &mut self, self_: Resource<UdpSocket>, value: u8, ) -> Result<(), SocketError>
Source§fn receive_buffer_size(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<u64, SocketError>
fn receive_buffer_size( &mut self, self_: Resource<UdpSocket>, ) -> Result<u64, SocketError>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, self_: Resource<UdpSocket>, value: u64, ) -> Result<(), SocketError>
fn send_buffer_size( &mut self, self_: Resource<UdpSocket>, ) -> Result<u64, SocketError>
fn set_send_buffer_size( &mut self, self_: Resource<UdpSocket>, value: u64, ) -> Result<(), SocketError>
Source§fn subscribe(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<UdpSocket>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the socket is ready for I/O. Read morefn drop(&mut self, rep: Resource<UdpSocket>) -> Result<()>
impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
impl Host for WasiSocketsCtxView<'_>
Auto Trait Implementations§
impl<'a> Freeze for WasiSocketsCtxView<'a>
impl<'a> !RefUnwindSafe for WasiSocketsCtxView<'a>
impl<'a> Send for WasiSocketsCtxView<'a>
impl<'a> !Sync for WasiSocketsCtxView<'a>
impl<'a> Unpin for WasiSocketsCtxView<'a>
impl<'a> !UnwindSafe for WasiSocketsCtxView<'a>
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
§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self
file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more