|
|
@@ -1,3 +1,21 @@
|
|
|
+//! # Io trait
|
|
|
+//! The [Io] trait allows types to be written and read generically to byte vecs.
|
|
|
+//! See its documentation for usage and manual implementation.
|
|
|
+//!
|
|
|
+//! # Derive macro
|
|
|
+//! The derive macro `#[derive(Io)]` can be used to trivially implement `Io` for your types.
|
|
|
+//! All serialized fields must implement the `Io` trait for it to work.
|
|
|
+//! Fields can have the `#[io(ignore)]` attribute added which will:
|
|
|
+//! 1. Ignore the field when writing the full struct/enum.
|
|
|
+//! 2. Use `Default` for reading as there is nothing to read from.
|
|
|
+//!
|
|
|
+//! # Std types
|
|
|
+//! Currently a few types from std are supported:
|
|
|
+//! - All numbers
|
|
|
+//! - `String`
|
|
|
+//! - `Box` `HashMap` `Option` and `Vec` of types that implement `Io`
|
|
|
+//! - `Duration` and `SystemTime`.
|
|
|
+
|
|
|
use std::io::{Error, ErrorKind};
|
|
|
|
|
|
mod io;
|