This crate provides no-panic API for any type T
impl bytes::Buf
,
which is mentioned in issue#254.
issues and PRs are welcome.
```rust use bytes::{Bytes, Buf}; use crate::TryBuf;
let mut bytes = Bytes::from_static(&[1, 2, 3, 4]);
let a = bytes.trygetu16().unwrap(); assert_eq!(a, 0x0102);
let b = bytes.trygetu32() .unwraporelse(|e| { println!("fail to get u32: {}", e); 0 }); asserteq!(b, 0); asserteq!(2, bytes.remaining()); ```