Struct asyncio::ip::UnicastHops [] [src]

pub struct UnicastHops(_);

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();

Methods

impl UnicastHops
[src]

Trait Implementations

impl Default for UnicastHops
[src]

Returns the "default value" for a type. Read more

impl Clone for UnicastHops
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<P: IpProtocol> SocketOption<P> for UnicastHops
[src]

impl<P: IpProtocol> GetSocketOption<P> for UnicastHops
[src]

impl<P: IpProtocol> SetSocketOption<P> for UnicastHops
[src]