Crate parsenic

Source
Expand description
§A simple no-std/no-alloc I/O and parsing crate

The main two traits for parsing are Read and Write, implemented by Reader, which reads from a fixed-size slice of bytes, and Writer, which writes to a fixed-size slice of bytes. The Read and Write traits are designed to be extended with extension traits, using traitful::extend.

Extension traits for big-endian an little-endian parsing are provided in this crate as well; be::Read, be::Write, le::Read, le::Write. When importing a Read or Write extension trait, using as _ will avoid namespace conflicts.

§Synchronous and Asynchronous

The Read and Write traits are synchronous by design. This makes it simple to read and write on in-memory data without touching I/O. For I/O bound reading and writing, there are the io::Source and io::Destination traits which work by buffering the bytes to be sent on an io::Sender or received on an io::Receiver.

§Features

Some non-default features can enable unstable (no API stability guarantees) functionality.

  • unstable-io: Bumps MSRV to 1.84, enables the io module
  • unstable-error: Bumps MSRV to 1.81, implements Error for error types

Modules§

be
Big endian parsing
class
Classifications of primitive types
error
Error types
io
unstable-io feature required; I/O primitives (MSRV 1.84)
le
Little endian parsing
result
Result type aliases

Structs§

Empty
Reader that is always at EOF
Purge
Writer that moves data into the void
Reader
Reader that reads from a slice of bytes
Writer
Writer that writes to a slice of bytes

Traits§

Read
Basic reading methods
Write
Basic writing methods

Functions§

empty
Construct a new handle to an empty reader.
purge
Create an instance of a writer which will successfully consume all bytes.