pub struct SendBufferSize(/* private fields */);
Expand description
Socket option for the send buffer size of a socket.
Implements the SOL_SOCKET/SO_SNDBUF socket option.
§Examples
Setting the option:
use asyncio::*;
use asyncio::ip::*;
use asyncio::socket_base::SendBufferSize;
let ctx = &IoContext::new().unwrap();
let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap();
soc.set_option(SendBufferSize::new(8192)).unwrap();
Getting the option:
use asyncio::*;
use asyncio::ip::*;
use asyncio::socket_base::SendBufferSize;
let ctx = &IoContext::new().unwrap();
let soc = TcpSocket::new(ctx, Tcp::v4()).unwrap();
let opt: SendBufferSize = soc.get_option().unwrap();
let size: usize = opt.get();
Implementations§
Trait Implementations§
Source§impl Clone for SendBufferSize
impl Clone for SendBufferSize
Source§fn clone(&self) -> SendBufferSize
fn clone(&self) -> SendBufferSize
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 SendBufferSize
impl Default for SendBufferSize
Source§fn default() -> SendBufferSize
fn default() -> SendBufferSize
Returns the “default value” for a type. Read more
Source§impl<P: Protocol> GetSocketOption<P> for SendBufferSize
impl<P: Protocol> GetSocketOption<P> for SendBufferSize
Source§impl<P: Protocol> SetSocketOption<P> for SendBufferSize
impl<P: Protocol> SetSocketOption<P> for SendBufferSize
Auto Trait Implementations§
impl Freeze for SendBufferSize
impl RefUnwindSafe for SendBufferSize
impl Send for SendBufferSize
impl Sync for SendBufferSize
impl Unpin for SendBufferSize
impl UnwindSafe for SendBufferSize
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