pub struct UdpSocket {
io: UdpSocket,
}
Fields
io: UdpSocket
Implementations
sourceimpl UdpSocket
impl UdpSocket
pub fn new(socket: UdpSocket) -> Result<UdpSocket>
pub fn local_addr(&self) -> Result<SocketAddr>
pub fn try_clone(&self) -> Result<UdpSocket>
pub fn send_to(&self, buf: &[u8], target: &SocketAddr) -> Result<usize>
pub fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub fn send(&self, buf: &[u8]) -> Result<usize>
pub fn recv(&self, buf: &mut [u8]) -> Result<usize>
pub fn connect(&self, addr: SocketAddr) -> Result<()>
pub fn broadcast(&self) -> Result<bool>
pub fn set_broadcast(&self, on: bool) -> Result<()>
pub fn multicast_loop_v4(&self) -> Result<bool>
pub fn set_multicast_loop_v4(&self, on: bool) -> Result<()>
pub fn multicast_ttl_v4(&self) -> Result<u32>
pub fn set_multicast_ttl_v4(&self, ttl: u32) -> Result<()>
pub fn multicast_loop_v6(&self) -> Result<bool>
pub fn set_multicast_loop_v6(&self, on: bool) -> Result<()>
pub fn ttl(&self) -> Result<u32>
pub fn set_ttl(&self, ttl: u32) -> Result<()>
pub fn join_multicast_v4(
&self,
multiaddr: &Ipv4Addr,
interface: &Ipv4Addr
) -> Result<()>
pub fn join_multicast_v6(
&self,
multiaddr: &Ipv6Addr,
interface: u32
) -> Result<()>
pub fn leave_multicast_v4(
&self,
multiaddr: &Ipv4Addr,
interface: &Ipv4Addr
) -> Result<()>
pub fn leave_multicast_v6(
&self,
multiaddr: &Ipv6Addr,
interface: u32
) -> Result<()>
pub fn set_only_v6(&self, only_v6: bool) -> Result<()>
pub fn only_v6(&self) -> Result<bool>
pub fn take_error(&self) -> Result<Option<Error>>
pub fn readv(&self, bufs: &mut [&mut IoVec]) -> Result<usize>
pub fn writev(&self, bufs: &[&IoVec]) -> Result<usize>
Trait Implementations
sourceimpl Evented for UdpSocket
impl Evented for UdpSocket
sourcefn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
fn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
Register self
with the given Poll
instance. Read more
Auto Trait Implementations
impl RefUnwindSafe for UdpSocket
impl Send for UdpSocket
impl Sync for UdpSocket
impl Unpin for UdpSocket
impl UnwindSafe for UdpSocket
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more