smol-bytes 0.1.5

High-performance, clone-efficient byte buffers optimized for small data.
Documentation
1
2
3
4
5
6
7
8
9
use smol_bytes::{INLINE_CAP, shared::Bytes};

fn main() {
  let inline: Bytes = Bytes::from_static(b"hello");
  println!("inline = {:?}", inline);

  let heap: Bytes = Bytes::from(vec![42u8; INLINE_CAP + 2]);
  println!("heap len = {}", heap.len());
}