pub struct V6Only(/* private fields */);
Expand description
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 asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = TcpListener::new(ctx, Tcp::v6()).unwrap();
soc.set_option(V6Only::new(true)).unwrap();
Getting the option:
use asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = TcpListener::new(ctx, Tcp::v6()).unwrap();
let opt: V6Only = soc.get_option().unwrap();
let is_set: bool = opt.get();
Implementations§
Trait Implementations§
Source§impl<P: IpProtocol> GetSocketOption<P> for V6Only
impl<P: IpProtocol> GetSocketOption<P> for V6Only
Source§impl<P: IpProtocol> SetSocketOption<P> for V6Only
impl<P: IpProtocol> SetSocketOption<P> for V6Only
Auto Trait Implementations§
impl Freeze for V6Only
impl RefUnwindSafe for V6Only
impl Send for V6Only
impl Sync for V6Only
impl Unpin for V6Only
impl UnwindSafe for V6Only
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