pub struct UdpSocketManager { /* private fields */ }
Implementations§
Source§impl UdpSocketManager
impl UdpSocketManager
pub fn model(&self) -> Model
pub fn main_udp_v4_count(&self) -> usize
pub fn main_udp_v6_count(&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
Sourcepub async fn send_to<T, D: ToRouteKeyForUdp<T>>(
&self,
buf: &[u8],
dest: D,
) -> Result<()>
pub async fn send_to<T, D: ToRouteKeyForUdp<T>>( &self, buf: &[u8], dest: D, ) -> Result<()>
Writing buf
to the target denoted by route_key
Sourcepub fn try_send_to<T, D: ToRouteKeyForUdp<T>>(
&self,
buf: &[u8],
dest: D,
) -> Result<()>
pub fn try_send_to<T, D: ToRouteKeyForUdp<T>>( &self, buf: &[u8], dest: D, ) -> Result<()>
Try to write buf
to the target denoted by route_key
pub async fn batch_send_to<T, D: ToRouteKeyForUdp<T>>( &self, bufs: &[IoSlice<'_>], dest: D, ) -> Result<()>
pub async fn send_bytes_to<T, D: ToRouteKeyForUdp<T>>( &self, buf: BytesMut, dest: D, ) -> Result<()>
pub fn try_send_bytes_to<T, D: ToRouteKeyForUdp<T>>( &self, buf: BytesMut, dest: D, ) -> Result<()>
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 UdpSocketManager
impl !RefUnwindSafe for UdpSocketManager
impl Send for UdpSocketManager
impl Sync for UdpSocketManager
impl Unpin for UdpSocketManager
impl !UnwindSafe for UdpSocketManager
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