pub struct MulticastHops(/* private fields */);
Expand description
Socket option for time-to-live associated with outgoing multicast packets.
Implements the IPPROTO_IP/IP_MULTICAST_TTL or IPPROTO_IPV6/IPV6_MULTICAST_HOPS socket option.
§Examples
Setting the option:
use asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = UdpSocket::new(ctx, Udp::v4()).unwrap();
soc.set_option(MulticastHops::new(4)).unwrap();
Getting the option:
use asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = UdpSocket::new(ctx, Udp::v4()).unwrap();
let opt: MulticastHops = soc.get_option().unwrap();
let hops: u8 = opt.get();
Implementations§
Trait Implementations§
Source§impl Clone for MulticastHops
impl Clone for MulticastHops
Source§fn clone(&self) -> MulticastHops
fn clone(&self) -> MulticastHops
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for MulticastHops
impl Default for MulticastHops
Source§fn default() -> MulticastHops
fn default() -> MulticastHops
Returns the “default value” for a type. Read more
Source§impl<P: IpProtocol> GetSocketOption<P> for MulticastHops
impl<P: IpProtocol> GetSocketOption<P> for MulticastHops
Source§impl<P: IpProtocol> SetSocketOption<P> for MulticastHops
impl<P: IpProtocol> SetSocketOption<P> for MulticastHops
Auto Trait Implementations§
impl Freeze for MulticastHops
impl RefUnwindSafe for MulticastHops
impl Send for MulticastHops
impl Sync for MulticastHops
impl Unpin for MulticastHops
impl UnwindSafe for MulticastHops
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