1 use crate::MAX_DATA_LEN
;
3 /// The error returned by most functions in the [`encode`][crate::encode] module
4 #[derive(Debug, thiserror::Error)]
7 #[error("Cannot encode more than {MAX_DATA_LEN} bytes, got {length_in_bytes}")]
8 DataLengthLimitExceeded { length_in_bytes: usize }
,
9 #[error("Empty lines are invalid")]
13 #[cfg(all(not(feature = "blocking-io"), feature = "async-io"))]
15 #[cfg(all(not(feature = "blocking-io"), feature = "async-io"))]
18 #[cfg(feature = "blocking-io")]
20 #[cfg(feature = "blocking-io")]
21 pub use blocking_io
::*;
23 pub(crate) fn u16_to_hex(value
: u16) -> [u8; 4] {
24 let mut buf
= [0u8; 4];
25 faster_hex
::hex_encode(&value
.to_be_bytes(), &mut buf
).expect("two bytes to 4 hex chars never fails");