Trait TryWrite
pub trait TryWrite:
Send
+ Sync
+ 'static {
// Required methods
fn try_write(&self, buf: &[u8]) -> Result<usize>;
fn writable(&self) -> impl Future<Output = Result<()>> + Send;
// Provided method
fn unix_fd(&self) -> Option<RawFd> { ... }
}Expand description
The write side of a Socket. Shard threads write without a runtime.
Required Methods§
fn try_write(&self, buf: &[u8]) -> Result<usize>
fn try_write(&self, buf: &[u8]) -> Result<usize>
Writes what the socket takes now; WouldBlock when it takes nothing.
fn writable(&self) -> impl Future<Output = Result<()>> + Send
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.