- Return error for invalid version instead of panicking (#31)
- Added opt-in serde support to facilitate session and ack management (storing subscriptions and pids to disk or database). The actual encode()/decode() APIs are unchanged.
- Upgrated bytes dependency to 0.5. This brings growable buffers and a nicer API, amongst other things.
- Implemented
Default for Pid,From<u16> for Pid, andTryFrom<Pid> for u16. Thetry_from()method already existed but now comes from thestd::convert::TryFromtrait. encode()now takes anything that implements theBufMuttrait, not just aByteMutstruct. For technical reasons,decode()still takesBytesMut.- Added option to opt-out of std library, allowing usage in
#[no_std]projects, at the only cost of giving up theErrortrait from std as well asstd::iointegration.
- Fix off-by one error when adding to a Pid wraps over.
- The minimum rust version is now 1.39.
- Improved
Piddocs.
This is a fairly large release with API fixes and improvements, bug fixes, and much better test coverage and documentation.
- We now return a dedicated error type instead of abusing
std::io::Error. PacketIdentifierwas renamed toPid. It now avoids the illegal value 0, wraps around automatically, and can be hashed.Publish.qosandPublish.pidhave been merged together, avoiding accidental illegal combinations.Connect.passwordandConnect.will.payloadcan now contain binary data.- The
Protocolenum doesn't carry extra data anymore. - All public structs/enum/functions are now (re)exported from the crate root, and the rest has been made private.
- The letter-casing of packet types is more consistent.
- Packet subtypes can be converted to
Packetusing.into().
- Much improved documentation. See it with
cargo doc --open. - More thorough unittesting, including exhaustive and random value ranges testing.
- Lots of corner-case bugfixes, particularly when decoding partial or corrupted data.
- The minimum rust version is now 1.32.
- Raised
mqttrs's bus factor to 2 ;)
- Fix issue #8: Decoding an incomplete packet still consumes bytes from the buffer.