pub struct UdpSocket { /* private fields */ }Implementations§
Source§impl UdpSocket
UdpSocket API Implementation
the default socket implementation is aynchronous socket, do not require the app to set non-blocking mode
impl UdpSocket
UdpSocket API Implementation the default socket implementation is aynchronous socket, do not require the app to set non-blocking mode
pub fn new(local_addr: &SocketAddr) -> Result<Self, RESULT>
pub fn get_socket_by_id(id: i32) -> Self
pub fn set_send_buf_size(&mut self, buf_size: usize) -> RESULT
pub fn set_recv_buf_size(&mut self, buf_size: usize) -> RESULT
pub fn send_to(&mut self, dst: &SocketAddr, buf: &[u8]) -> Result<usize, RESULT>
pub fn recv_from( &mut self, buf: &mut [u8], ) -> Result<(usize, SocketAddr), RESULT>
pub fn get_local_addr(&self) -> Option<SocketAddr>
pub fn get_socket_id(&self) -> i32
Sourcepub fn get_os_socket(&self) -> RawFdType
pub fn get_os_socket(&self) -> RawFdType
get underlying os raw socket id
pub fn close(&mut self) -> RESULT
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UdpSocket
impl RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl UnwindSafe for UdpSocket
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