1
Fork 0

Documentation.

This commit is contained in:
Alex Helfet 2017-12-22 13:41:02 +00:00
parent 448e852454
commit 585535d0a0
3 changed files with 12 additions and 8 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "framed"
version = "0.1.0"
description = "Send and receive frames (arrays of bytes of varied length) over streams of bytes."
description = "Send and receive slices of bytes over lossy streams of bytes."
authors = ["Alex Helfet <alex.helfet@gmail.com>"]
categories = ["embedded", "encoding", "network-programming"]
keywords = ["no_std", "networking", "datalink", "protocol", "embedded"]

View file

@ -1,7 +1,6 @@
# `framed`
Rust crate to send and receive frames (arrays of bytes of varied length)
over streams of bytes.
Rust crate to send and receive slices of bytes over lossy streams of bytes.
See [rustdoc on docs.rs](https://docs.rs/crate/framed)

View file

@ -1,19 +1,24 @@
//! Sending and receiving frames (arrays of bytes of varied length)
//! over streams of bytes.
//! Send and receive slices of bytes over lossy streams of bytes.
//!
//! Conforming to / inspired by the [data link layer][dll] or layer 2
//! in the OSI networking model, this module enables sending slices of
//! bytes of definite length over an underlying transport that only
//! supports sending an unstructured stream of bytes (a [physical
//! bytes of definite length over an underlying lossy transport that
//! only supports sending an unstructured stream of bytes (a [physical
//! layer][pl], such as ITM, UART or SPI).
//!
//! [dll]: https://en.wikipedia.org/wiki/Data_link_layer
//! [pl]: https://en.wikipedia.org/wiki/Physical_layer
//!
//! The transport may corrupt the stream by dropping or modifying some
//! bytes en route. When the transport returns corrupt data the
//! decoder may return errors or corrupted payloads, but if the
//! transport starts operating without losses again the decoder should
//! return new uncorrupted frames.
//!
//! ## Encoding
//!
//! Currently the encoding is:
//! * The frame [COBS]-encoded to remove bytes equal to zero
//! * The payload [COBS]-encoded to remove bytes equal to zero
//! * A terminating zero byte.
//! [COBS]: https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
//!