Documentation.
This commit is contained in:
parent
448e852454
commit
585535d0a0
3 changed files with 12 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "framed"
|
name = "framed"
|
||||||
version = "0.1.0"
|
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>"]
|
authors = ["Alex Helfet <alex.helfet@gmail.com>"]
|
||||||
categories = ["embedded", "encoding", "network-programming"]
|
categories = ["embedded", "encoding", "network-programming"]
|
||||||
keywords = ["no_std", "networking", "datalink", "protocol", "embedded"]
|
keywords = ["no_std", "networking", "datalink", "protocol", "embedded"]
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# `framed`
|
# `framed`
|
||||||
|
|
||||||
Rust crate to send and receive frames (arrays of bytes of varied length)
|
Rust crate to send and receive slices of bytes over lossy streams of bytes.
|
||||||
over streams of bytes.
|
|
||||||
|
|
||||||
See [rustdoc on docs.rs](https://docs.rs/crate/framed)
|
See [rustdoc on docs.rs](https://docs.rs/crate/framed)
|
||||||
|
|
||||||
|
|
15
src/lib.rs
15
src/lib.rs
|
@ -1,19 +1,24 @@
|
||||||
//! Sending and receiving frames (arrays of bytes of varied length)
|
//! Send and receive slices of bytes over lossy streams of bytes.
|
||||||
//! over streams of bytes.
|
|
||||||
//!
|
//!
|
||||||
//! Conforming to / inspired by the [data link layer][dll] or layer 2
|
//! Conforming to / inspired by the [data link layer][dll] or layer 2
|
||||||
//! in the OSI networking model, this module enables sending slices of
|
//! in the OSI networking model, this module enables sending slices of
|
||||||
//! bytes of definite length over an underlying transport that only
|
//! bytes of definite length over an underlying lossy transport that
|
||||||
//! supports sending an unstructured stream of bytes (a [physical
|
//! only supports sending an unstructured stream of bytes (a [physical
|
||||||
//! layer][pl], such as ITM, UART or SPI).
|
//! layer][pl], such as ITM, UART or SPI).
|
||||||
//!
|
//!
|
||||||
//! [dll]: https://en.wikipedia.org/wiki/Data_link_layer
|
//! [dll]: https://en.wikipedia.org/wiki/Data_link_layer
|
||||||
//! [pl]: https://en.wikipedia.org/wiki/Physical_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
|
//! ## Encoding
|
||||||
//!
|
//!
|
||||||
//! Currently the encoding is:
|
//! 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.
|
//! * A terminating zero byte.
|
||||||
//! [COBS]: https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
|
//! [COBS]: https://en.wikipedia.org/wiki/Consistent_Overhead_Byte_Stuffing
|
||||||
//!
|
//!
|
||||||
|
|
Loading…
Reference in a new issue