Struct asio::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 asio::*;
use asio::ip::*;
use asio::socket_base::DoNotRoute;

let io = &IoService::new();
let soc = UdpSocket::new(io, Udp::v4()).unwrap();

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

Getting the option:

use asio::*;
use asio::ip::*;
use asio::socket_base::DoNotRoute;

let io = &IoService::new();
let soc = UdpSocket::new(io, Udp::v4()).unwrap();

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

Methods

impl DoNotRoute
[src]

fn new(on: bool) -> DoNotRoute

fn get(&self) -> bool

fn set(&mut self, on: bool)

Trait Implementations

impl Clone for DoNotRoute
[src]

fn clone(&self) -> DoNotRoute

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl Default for DoNotRoute
[src]

fn default() -> DoNotRoute

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

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

type Data = i32

fn level(&self, _: &P) -> i32

fn name(&self, _: &P) -> i32

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

fn data_mut(&mut self) -> &mut Self::Data

fn resize(&mut self, _size: usize)

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

fn data(&self) -> &Self::Data

fn size(&self) -> usize