pub struct UnicastHops(/* private fields */);
Expand description
Socket option for time-to-live associated with outgoing unicast packets.
Implements the IPPROTO_IP/IP_UNICAST_TTL or IPPROTO_IPV6/IPV6_UNICAST_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(UnicastHops::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: UnicastHops = soc.get_option().unwrap();
let hops: u8 = opt.get();
Implementations§
Trait Implementations§
Source§impl Clone for UnicastHops
impl Clone for UnicastHops
Source§fn clone(&self) -> UnicastHops
fn clone(&self) -> UnicastHops
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 UnicastHops
impl Default for UnicastHops
Source§fn default() -> UnicastHops
fn default() -> UnicastHops
Returns the “default value” for a type. Read more
Source§impl<P: IpProtocol> GetSocketOption<P> for UnicastHops
impl<P: IpProtocol> GetSocketOption<P> for UnicastHops
Source§impl<P: IpProtocol> SetSocketOption<P> for UnicastHops
impl<P: IpProtocol> SetSocketOption<P> for UnicastHops
Auto Trait Implementations§
impl Freeze for UnicastHops
impl RefUnwindSafe for UnicastHops
impl Send for UnicastHops
impl Sync for UnicastHops
impl Unpin for UnicastHops
impl UnwindSafe for UnicastHops
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