Trait netlink_sys::AsyncSocket
source · pub trait AsyncSocket: Sized + Unpin {
// Required methods
fn socket_ref(&self) -> &Socket;
fn socket_mut(&mut self) -> &mut Socket;
fn new(protocol: isize) -> Result<Self>;
fn poll_send(
&mut self,
cx: &mut Context<'_>,
buf: &[u8],
) -> Poll<Result<usize>>;
fn poll_send_to(
&mut self,
cx: &mut Context<'_>,
buf: &[u8],
addr: &SocketAddr,
) -> Poll<Result<usize>>;
fn poll_recv<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<()>>
where B: BufMut;
fn poll_recv_from<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<SocketAddr>>
where B: BufMut;
fn poll_recv_from_full(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(Vec<u8>, SocketAddr)>>;
}
Expand description
Trait to support different async backends
Required Methods§
sourcefn socket_ref(&self) -> &Socket
fn socket_ref(&self) -> &Socket
Access underyling Socket
sourcefn socket_mut(&mut self) -> &mut Socket
fn socket_mut(&mut self) -> &mut Socket
Mutable access to underyling Socket
sourcefn new(protocol: isize) -> Result<Self>
fn new(protocol: isize) -> Result<Self>
Wrapper for Socket::new
sourcefn poll_send(&mut self, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
fn poll_send(&mut self, cx: &mut Context<'_>, buf: &[u8]) -> Poll<Result<usize>>
Polling wrapper for Socket::send
sourcefn poll_send_to(
&mut self,
cx: &mut Context<'_>,
buf: &[u8],
addr: &SocketAddr,
) -> Poll<Result<usize>>
fn poll_send_to( &mut self, cx: &mut Context<'_>, buf: &[u8], addr: &SocketAddr, ) -> Poll<Result<usize>>
Polling wrapper for Socket::send_to
sourcefn poll_recv<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<()>>where
B: BufMut,
fn poll_recv<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<()>>where
B: BufMut,
Polling wrapper for Socket::recv
Passes 0 for flags, and ignores the returned length (the buffer will have advanced by the amount read).
sourcefn poll_recv_from<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<SocketAddr>>where
B: BufMut,
fn poll_recv_from<B>(
&mut self,
cx: &mut Context<'_>,
buf: &mut B,
) -> Poll<Result<SocketAddr>>where
B: BufMut,
Polling wrapper for Socket::recv_from
Passes 0 for flags, and ignores the returned length - just returns the address (the buffer will have advanced by the amount read).
sourcefn poll_recv_from_full(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(Vec<u8>, SocketAddr)>>
fn poll_recv_from_full( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<(Vec<u8>, SocketAddr)>>
Polling wrapper for Socket::recv_from_full
Passes 0 for flags, and ignores the returned length - just returns the address (the buffer will have advanced by the amount read).
Object Safety§
This trait is not object safe.