async fn write_all_and_close<W>(writer: &mut W, buf: &[u8]) -> Result<()> where
    W: AsyncWrite + Unpin
Available on crate feature experimental-api only.
Expand description

write_all the data to the writer & close the writer if write_all is successful.