pub struct UdpSocket { /* private fields */ }Expand description
Synchronous low level UDP socket.
Implementations§
Source§impl UdpSocket
impl UdpSocket
Sourcepub fn from_config(config: &UdpConfig) -> Result<Self>
pub fn from_config(config: &UdpConfig) -> Result<Self>
Create a socket from the provided configuration.
Sourcepub fn new(domain: Domain, sock_type: SockType) -> Result<Self>
pub fn new(domain: Domain, sock_type: SockType) -> Result<Self>
Create a socket of arbitrary type (DGRAM or RAW).
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
Retrieve the local socket address.
Sourcepub fn to_std(self) -> Result<StdUdpSocket>
pub fn to_std(self) -> Result<StdUdpSocket>
Convert into a raw std::net::UdpSocket.
pub fn as_raw_fd(&self) -> RawFd
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