messagepack-async 0.2.3

A simple functional library for read/writing messagepack with tokio.
Documentation
//! # MessagePack-Async
//!
//! `messagepack-async` is a simple, functional library for reading and writing
//! MessagePack with `std::io::{Read, Write}` and `tokio::io::{AsyncRead, AsyncWrite}`.
//!
//! No features are enabled by default so you will either need to enable at least one of
//! `sync` or `tokio` depending on what you're planning on reading/writing to.
//!
//! ```toml
//! [dependencies]
//! # Stdlib
//! messagepack-async = { version = "0.2.3", features = [ "sync" ] }
//! # Tokio
//! messagepack-async = { version = "0.2.3", features = [ "tokio" ] }
//! ```
//!
//! ## The Traits
//!
//! This crate provides four traits; [`sync::ReadFrom`], [`sync::WriteTo`],
//! [`tokio::ReadFrom`], and [`tokio::WriteTo`]. These provide methods to read and
//! write [`Value`]s to sources and sinks that implement the read/write traits from
//! the stdlib or [tokio](https://docs.rs/tokio/latest/tokio/).
//!
//! Note that `write_to` will write **exactly** the value you supply. That means
//! if you write a `Int::U64(0)` to a sink, it won't write the value as a U8 even
//! though it could be represented as such.
//!
//! ```rust
//! use messagepack_async::{Value, Int, sync::{ReadFrom, WriteTo}};
//! let mut data = vec![];
//! let value = Value::Int(Int::U64(0));
//! value.write_to(&mut data).unwrap();
//! let mut cursor = data.as_slice();
//! let read_value = Value::read_from(&mut cursor).unwrap();
//! assert_eq!(value, read_value);
//! ```
//!
//! The implementation of [`std::cmp::PartialEq`] is derived so differentiates
//! between different variants of [`Int`].
//!
//! If you need to minimise the size in bytes of the values you write, create your
//! values with the [`Value::int`], [`Value::signed_int`], and
//! [`Value::unsigned_int`] constructors for [`Value`].

pub mod value;

pub use value::{Ext, Float, Int, Value};

#[cfg(feature = "tokio")]
pub mod tokio;

#[cfg(feature = "sync")]
pub mod sync;