Struct asyncio::socket_base::DoNotRoute [] [src]

pub struct DoNotRoute(_);

Socket option to don't use a gateway. send to local network host only.

Implements the SOL_SOCKET/SO_DONTROUTE socket option.

Examples

Setting the option:

use asyncio::*;
use asyncio::ip::*;
use asyncio::socket_base::DoNotRoute;

let ctx = &IoContext::new().unwrap();
let soc = UdpSocket::new(ctx, Udp::v4()).unwrap();

soc.set_option(DoNotRoute::new(true)).unwrap();

Getting the option:

use asyncio::*;
use asyncio::ip::*;
use asyncio::socket_base::DoNotRoute;

let ctx = &IoContext::new().unwrap();
let soc = UdpSocket::new(ctx, Udp::v4()).unwrap();

let opt: DoNotRoute = soc.get_option().unwrap();
let is_set: bool = opt.get();

Methods

impl DoNotRoute
[src]

Trait Implementations

impl Default for DoNotRoute
[src]

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

impl Clone for DoNotRoute
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<P: Protocol> SocketOption<P> for DoNotRoute
[src]

impl<P: Protocol> GetSocketOption<P> for DoNotRoute
[src]

impl<P: Protocol> SetSocketOption<P> for DoNotRoute
[src]