Struct asio::ip::V6Only [] [src]

pub struct V6Only(_);

Socket option for get/set an IPv6 socket supports IPv6 communication only.

Implements the IPPROTO_IPV6/IP_V6ONLY socket option.

Examples

Setting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = TcpListener::new(io, Tcp::v6()).unwrap();

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

Getting the option:

use asio::*;
use asio::ip::*;

let io = &IoService::new();
let soc = TcpListener::new(io, Tcp::v6()).unwrap();

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

Methods

impl V6Only
[src]

fn new(on: bool) -> V6Only

fn get(&self) -> bool

fn set(&mut self, on: bool)

Trait Implementations

impl Clone for V6Only
[src]

fn clone(&self) -> V6Only

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 V6Only
[src]

fn default() -> V6Only

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

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

type Data = i32

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

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

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

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

fn resize(&mut self, _size: usize)

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

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

fn size(&self) -> usize