mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-19 00:00:12 +02:00
Make Buf and BufMut usable as trait objects (#186)
- All the `get_*` and `put_*` methods that take `T: ByteOrder` have a `where Self: Sized` bound added, so that they are only usable from sized types. It was impossible to make `Buf` or `BufMut` into trait objects before, so this change doesn't break anyone. - Add `get_n_be`/`get_n_le`/`put_n_be`/`put_n_le` methods that can be used on trait objects. - Deprecate the export of `ByteOrder` and methods generic on it. Fixes #163
This commit is contained in:
committed by
Carl Lerche
parent
86c83959dc
commit
ce79f0a268
@@ -92,6 +92,7 @@ mod bytes;
|
||||
mod debug;
|
||||
pub use bytes::{Bytes, BytesMut};
|
||||
|
||||
#[deprecated]
|
||||
pub use byteorder::{ByteOrder, BigEndian, LittleEndian};
|
||||
|
||||
// Optional Serde support
|
||||
|
||||
Reference in New Issue
Block a user