Struct mio::udp::UdpSocket [] [src]

pub struct UdpSocket {
    // some fields omitted
}

Methods

impl UdpSocket

fn v4() -> Result<UdpSocket>

Returns a new, unbound, non-blocking, IPv4 UDP socket

fn v6() -> Result<UdpSocket>

Returns a new, unbound, non-blocking, IPv6 UDP socket

fn bound(addr: &SocketAddr) -> Result<UdpSocket>

fn bind(&self, addr: &SocketAddr) -> Result<()>

fn local_addr(&self) -> Result<SocketAddr>

fn try_clone(&self) -> Result<UdpSocket>

fn send_to(&self, buf: &[u8], target: &SocketAddr) -> Result<Option<usize>>

fn recv_from(&self, buf: &mut [u8]) -> Result<Option<(usize, SocketAddr)>>

fn set_broadcast(&self, on: bool) -> Result<()>

fn set_multicast_loop(&self, on: bool) -> Result<()>

fn join_multicast(&self, multi: &IpAddr) -> Result<()>

fn leave_multicast(&self, multi: &IpAddr) -> Result<()>

fn set_multicast_time_to_live(&self, ttl: i32) -> Result<()>

impl UdpSocket

fn v4() -> Result<UdpSocket>

Returns a new, unbound, non-blocking, IPv4 UDP socket

fn v6() -> Result<UdpSocket>

Returns a new, unbound, non-blocking, IPv6 UDP socket

fn bound(addr: &SocketAddr) -> Result<UdpSocket>

fn bind(&self, addr: &SocketAddr) -> Result<()>

fn local_addr(&self) -> Result<SocketAddr>

fn try_clone(&self) -> Result<UdpSocket>

fn send_to(&self, buf: &[u8], target: &SocketAddr) -> Result<Option<usize>>

fn recv_from(&self, buf: &mut [u8]) -> Result<Option<(usize, SocketAddr)>>

fn set_broadcast(&self, on: bool) -> Result<()>

fn set_multicast_loop(&self, on: bool) -> Result<()>

fn join_multicast(&self, multi: &IpAddr) -> Result<()>

fn leave_multicast(&self, multi: &IpAddr) -> Result<()>

fn set_multicast_time_to_live(&self, ttl: i32) -> Result<()>

Trait Implementations

impl Evented for UdpSocket

fn register(&self, selector: &mut Selector, token: Token, interest: EventSet, opts: PollOpt) -> Result<()>

fn reregister(&self, selector: &mut Selector, token: Token, interest: EventSet, opts: PollOpt) -> Result<()>

fn deregister(&self, selector: &mut Selector) -> Result<()>

impl From<UdpSocket> for UdpSocket

fn from(sys: UdpSocket) -> UdpSocket

impl AsRawFd for UdpSocket

fn as_raw_fd(&self) -> RawFd

impl FromRawFd for UdpSocket

unsafe fn from_raw_fd(fd: RawFd) -> UdpSocket

impl Evented for UdpSocket

fn register(&self, selector: &mut Selector, token: Token, interest: EventSet, opts: PollOpt) -> Result<()>

fn reregister(&self, selector: &mut Selector, token: Token, interest: EventSet, opts: PollOpt) -> Result<()>

fn deregister(&self, selector: &mut Selector) -> Result<()>

impl From<UdpSocket> for UdpSocket

fn from(sys: UdpSocket) -> UdpSocket

impl AsRawFd for UdpSocket

fn as_raw_fd(&self) -> RawFd

impl FromRawFd for UdpSocket

unsafe fn from_raw_fd(fd: RawFd) -> UdpSocket

Derived Implementations

impl Debug for UdpSocket

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Debug for UdpSocket

fn fmt(&self, __arg_0: &mut Formatter) -> Result