Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lgrahl/sna
Serial Number Arithmetic (RFC 1982) for Rust
https://github.com/lgrahl/sna
arithmetic number rfc-1982 rust serial
Last synced: 11 days ago
JSON representation
Serial Number Arithmetic (RFC 1982) for Rust
- Host: GitHub
- URL: https://github.com/lgrahl/sna
- Owner: lgrahl
- License: mit
- Created: 2017-11-06T14:45:10.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-09T19:40:13.000Z (over 3 years ago)
- Last Synced: 2024-10-25T13:42:42.516Z (about 2 months ago)
- Topics: arithmetic, number, rfc-1982, rust, serial
- Language: Rust
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# sna
An implementation of **Serial Number Arithmetic** as defined by
[RFC 1982][rfc-1982] for Rust.![Version][version-badge]
[![Travis][travis-badge]][travis-url]
[![AppVeyor][appveyor-badge]][appveyor-url]
[![Codecov][codecov-badge]][codecov-url]## Usage
Add this to your `Cargo.toml`:
```toml
[dependencies]
sna = "0.1"
```Add this to your crate:
```rust
extern crate sna;
```## Examples
```rust
use sna::SerialNumber;let zero = SerialNumber(0u8);
let one = SerialNumber(1u8);assert_eq!(0u8, one + 255u8);
assert!(zero > 255u8);
```### Linting
To run clippy lints, compile the library with `--features clippy` on a nightly
compiler:$ cargo build --features clippy
If `nightly` is not your default compiler:
$ rustup run nightly cargo build --features clippy
[rfc-1982]: https://tools.ietf.org/html/rfc1982
[version-badge]: https://img.shields.io/crates/v/sna.svg
[travis-badge]: https://img.shields.io/travis/lgrahl/sna.svg
[travis-url]: https://travis-ci.org/lgrahl/sna
[appveyor-badge]: https://img.shields.io/appveyor/ci/lgrahl/sna.svg
[appveyor-url]: https://ci.appveyor.com/project/lgrahl/sna
[codecov-badge]: https://img.shields.io/codecov/c/github/lgrahl/sna.svg
[codecov-url]: https://codecov.io/gh/lgrahl/sna