Crate framez

Crate framez 

Source
Expand description

§framez

A zerocopy codec for encoding and decoding data in no_std environments.

This crate is based on embedded_io_async’s Read and Write traits.

It’s recommended to use embedded_io_adapters if you are using other async Read and Write traits like tokio’s AsyncRead and AsyncWrite.

See the examples for more information.

§Features

  • log: Enables logging using log.
  • tracing: Enables logging using tracing.
  • defmt: Enables logging using defmt and implements defmt::Format for structs and enums.

Modules§

codec
A ready to use set of codecs.
decode
Decoder trait definition.
encode
Encoder trait definition.
functions
Utility functions for reading and writing frames.
state
Internal states for reading and writing frames.

Macros§

maybe_next
Convenience macro to call maybe_next on a Framed or FramedRead.
next
Calls maybe_next! on a Framed or FramedRead in a loop until a frame is returned or an error occurs.
send
Convenience macro to call send on a Framed or FramedWrite.

Structs§

Framed
A framer that reads bytes from a Read source and decodes them into frames using a Decoder. And a sink that writes encoded frames into an underlying Write sink using an Encoder.
FramedRead
A framer that reads bytes from a Read source and decodes them into frames using a Decoder.
FramedWrite
A sink that writes encoded frames into an underlying Write sink using an Encoder.

Enums§

ReadError
An error that can occur while reading a frame.
WriteError
An error that can occur while writing a frame.