pub struct NoDelay(/* private fields */);
Expand description
Socket option for disabling the Nagle algorithm.
Implements the IPPROTO_TCP/TCP_NODELAY socket option.
§Examples
Setting the option:
use asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap();
soc.set_option(NoDelay::new(true)).unwrap();
Getting the option:
use asyncio::*;
use asyncio::ip::*;
let ctx = &IoContext::new().unwrap();
let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap();
let opt: NoDelay = soc.get_option().unwrap();
let is_set: bool = opt.get();
Implementations§
Trait Implementations§
Source§impl GetSocketOption<Tcp> for NoDelay
impl GetSocketOption<Tcp> for NoDelay
Source§impl SetSocketOption<Tcp> for NoDelay
impl SetSocketOption<Tcp> for NoDelay
Auto Trait Implementations§
impl Freeze for NoDelay
impl RefUnwindSafe for NoDelay
impl Send for NoDelay
impl Sync for NoDelay
impl Unpin for NoDelay
impl UnwindSafe for NoDelay
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