passive

Crates.iopassive
lib.rspassive
version0.1.4
sourcesrc
created_at2020-05-01 12:11:05.168849
updated_at2020-05-01 21:24:10.305736
descriptionA trio of marker traits to classify passive data structures
homepage
repositoryhttps://github.com/nox/passive
max_upload_size
id236137
size23,429
Anthony Ramine (nox)

documentation

https://docs.rs/passive/0.1.4/

README

Passive

This crate defines a trio of marker traits to classify types that fit some definitions of "plain old data", also known as "passive data structures".

The Trio

  • AlwaysAligned represents types that are always aligned, in other words types whose alignment is of 1.
  • AlwaysValid represents types for which all bit patterns are valid, e.g. u8 but not bool.
  • Immutable represents types that don't provide any inner mutability.

Use the derive feature to safely derive implementations of those three traits.

Helper Types

The module packed provides a bunch of types representing packed integers, they are all always aligned, always valid, and immutable.

Licensing

This crate is licensed under both the Apache 2.0 and MIT licenses, so you are free to do whatever you want with it as long as you respect the terms from these two.

If you are a highly paid worker at Google, Facebook, Apple, Amazon, Microsoft, Palantir, Uber, Airbnb, Deliveroo, or any other company that prioritises profit over people as strongly as they do, you can still use this crate. I simply wish you will unionise and push back against the obsession for growth, control, and power that is rampant in your workplace. Please take a stand against the horrible working conditions they inflict on your lesser paid colleagues, and more generally their gross disrespect for the very human rights they claim to fight for.

Commit count: 5

cargo fmt