pub struct DoNotRoute(/* private fields */);
Expand description
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();
Implementations§
Trait Implementations§
Source§impl Clone for DoNotRoute
impl Clone for DoNotRoute
Source§fn clone(&self) -> DoNotRoute
fn clone(&self) -> DoNotRoute
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for DoNotRoute
impl Default for DoNotRoute
Source§fn default() -> DoNotRoute
fn default() -> DoNotRoute
Returns the “default value” for a type. Read more
Source§impl<P: Protocol> GetSocketOption<P> for DoNotRoute
impl<P: Protocol> GetSocketOption<P> for DoNotRoute
Source§impl<P: Protocol> SetSocketOption<P> for DoNotRoute
impl<P: Protocol> SetSocketOption<P> for DoNotRoute
Auto Trait Implementations§
impl Freeze for DoNotRoute
impl RefUnwindSafe for DoNotRoute
impl Send for DoNotRoute
impl Sync for DoNotRoute
impl Unpin for DoNotRoute
impl UnwindSafe for DoNotRoute
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