Skip to content

docs: elaborate on differences to other crates #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@

This crate provides the [`Be`] (big-endian) and [`Le`] (little-endian) byte-order-aware numeric types.

Unlike the popular [`byteorder`] crate, which focuses on the action of encoding and decoding numbers to and from byte streams, this crate focuses on the state of numbers.
This is useful to create structs that contain fields of a specific endianness for interoperability, such as in virtio.
In comparison to other crates that focus on state, this crate closely follows naming conventions from [`core::num`], has rich functionality, and extensive documentation of each method.

[`Be`]: https://docs.rs/endian-num/latest/endian_num/struct.Be.html
[`Le`]: https://docs.rs/endian-num/latest/endian_num/struct.Le.html
[`byteorder`]: https://docs.rs/byteorder
[`core::num`]: https://doc.rust-lang.org/stable/core/num/index.html

The core API looks _roughly_ like this (correspondingly for `Be`):

Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//!
//! This crate provides the [`Be`] (big-endian) and [`Le`] (little-endian) byte-order-aware numeric types.
//!
//! The types aim to provide a similar API to other numeric types from [`core::num`], such as [`NonZero`], [`Saturating`], and [`Wrapping`].
//! Unlike the popular [`byteorder`] crate, which focuses on the action of encoding and decoding numbers to and from byte streams, this crate focuses on the state of numbers.
//! This is useful to create structs that contain fields of a specific endianness for interoperability, such as in virtio.
//! In comparison to other crates that focus on state, this crate closely follows naming conventions from [`core::num`], has rich functionality, and extensive documentation of each method.
//!
//! [`NonZero`]: core::num::NonZero
//! [`Saturating`]: core::num::Saturating
//! [`Wrapping`]: core::num::Wrapping
//! [`byteorder`]: https://docs.rs/byteorder
//!
//! The core API looks _roughly_ like this (correspondingly for `Be`):
//!
Expand Down