pub struct SocketLayer { /* private fields */ }Implementations§
source§impl SocketLayer
impl SocketLayer
pub fn model(&self) -> Model
pub fn main_pipeline_len(&self) -> usize
pub fn v4_pipeline_len(&self) -> usize
pub fn v6_pipeline_len(&self) -> usize
pub fn switch_model(&self, model: Model) -> Result<()>
sourcepub fn local_ports(&self) -> Result<Vec<u16>>
pub fn local_ports(&self) -> Result<Vec<u16>>
Acquire the local ports UDP sockets bind on
pub async fn send_buf_to( &self, buf: BytesMut, route_key: &RouteKey, ) -> Result<()>
sourcepub async fn send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
pub async fn send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
Writing buf to the target denoted by route_key
pub async fn send_multiple_to( &self, bufs: &[IoSlice<'_>], route_key: &RouteKey, ) -> Result<()>
sourcepub fn try_send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
pub fn try_send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
Try to write buf to the target denoted by route_key
sourcepub async fn send_to_addr<A: Into<SocketAddr>>(
&self,
buf: &[u8],
addr: A,
) -> Result<()>
pub async fn send_to_addr<A: Into<SocketAddr>>( &self, buf: &[u8], addr: A, ) -> Result<()>
Writing buf to the target denoted by SocketAddr
pub async fn send_buf_to_addr<A: Into<SocketAddr>>( &self, buf: BytesMut, addr: A, ) -> Result<()>
sourcepub fn try_send_to_addr<A: Into<SocketAddr>>(
&self,
buf: &[u8],
addr: A,
) -> Result<()>
pub fn try_send_to_addr<A: Into<SocketAddr>>( &self, buf: &[u8], addr: A, ) -> Result<()>
Try to write buf to the target denoted by SocketAddr
sourcepub fn get(
&self,
addr: SocketAddr,
index: usize,
) -> Result<UdpPipeWriterIndex<'_>>
pub fn get( &self, addr: SocketAddr, index: usize, ) -> Result<UdpPipeWriterIndex<'_>>
Acquire the PipeWriter by the index
sourcepub async fn detect_pub_addrs<A: Into<SocketAddr>>(
&self,
buf: &[u8],
addr: A,
) -> Result<()>
pub async fn detect_pub_addrs<A: Into<SocketAddr>>( &self, buf: &[u8], addr: A, ) -> Result<()>
Send bytes to the target denoted by SocketAddr with every main underlying socket
Auto Trait Implementations§
impl !Freeze for SocketLayer
impl !RefUnwindSafe for SocketLayer
impl Send for SocketLayer
impl Sync for SocketLayer
impl Unpin for SocketLayer
impl !UnwindSafe for SocketLayer
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