wtx 0.52.1

A collection of different transport implementations and related tools focused primarily on web technologies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#[cfg(feature = "std")]
pub(crate) fn convert_to_io_slices<'buffer, 'bytes>(
  buffer: &'buffer mut [::std::io::IoSlice<'bytes>; 8],
  elems: &[&'bytes [u8]],
) -> crate::Result<&'buffer mut [::std::io::IoSlice<'bytes>]> {
  if elems.len() > 8 {
    return crate::misc::unlikely_elem(Err(crate::net::NetError::VectoredWriteOverflow.into()));
  }
  for (elem, io_slice) in elems.iter().zip(&mut *buffer) {
    *io_slice = ::std::io::IoSlice::new(elem);
  }
  Ok(buffer.get_mut(..elems.len()).unwrap_or_default())
}