Commit Graph

13 Commits

Author SHA1 Message Date
Lokathor
73ae1ee89e (cargo-release) version 1.1.0 2022-03-29 23:15:56 -06:00
Gray Olson
b472189ff8
Add NoPadding, AnyBitPattern, and CheckedBitPattern traits (#91)
* add MaybePod and NoPadding traits

* MaybePod and NoPadding derive macros

* fix doctest

* fmt

* fix bad doc link

* move new casting functions into separate modules

* fmt

* fix doctest and derive test

* remove relaxed module, add anybitpattern

* rename MaybePod to CheckedCastFromPod

* rename checked casting functions

* rework CheckedCastFromPod into CheckedBitPattern

* add anybitpattern derive, fix up other derives

* fix doctest

* fix derive trait of bits type

* export AnyBitPattern derive

* export anybitpattern from traits

* actually export derive macro for AnyBitPattern

* make bits struct pub because of type leaking rules

* allow clippy lint in derive

* add copy bound to CheckedBitPattern

* - replace Pod bounds with NoPadding+AnyBitPattern
- add try and panic versions of checked cast functions
- slightly update docs

* fix derive tests

* - adapt the allocation module cast functions as well
- as part of that, make AnyBitPattern a subtrait of Zeroable
- AnyBitPattern derive also derives Zeroable

* @JakobDegen and @zakarumych nits

* superset -> subset on CheckedBitPattern and NoPadding docs

* derive Debug on generated `Bits` structs, which can be useful for debugging failures

* don't derive debug on spirv target arch

* make it work on 1.34

* merge conflicts

* fix erroneous behavior in doctest
2022-03-29 17:01:02 -06:00
Lokathor
df53958735 (cargo-release) start next development iteration 1.0.2-alpha.0 2020-11-27 09:33:20 -07:00
Lokathor
1cf639571b (cargo-release) version 1.0.1 2020-11-27 09:32:36 -07:00
Lokathor
c171ac4f5b (cargo-release) start next development iteration 1.0.1-alpha.0 2020-08-27 21:34:05 -06:00
Lokathor
9aedc156a8 (cargo-release) version 1.0.0 2020-08-27 21:33:46 -06:00
Lokathor
a6418a963d clarify versions. 2020-08-27 21:27:48 -06:00
Lokathor
e202fa2756 (cargo-release) version 1.0.0-alpha.3 2020-08-21 15:27:04 -06:00
Lokathor
14fa8650f0 (cargo-release) version 1.0.0-alpha.2 2020-08-20 19:46:44 -06:00
Lokathor
044c1c3057 (cargo-release) version 1.0.0-alpha.1 2020-08-20 19:41:51 -06:00
Lokathor
87e48ba1d9 ready bytemuck_derive for an alpha publish. 2020-08-20 19:37:56 -06:00
Lokathor
a64f697cd5 give the derives crate a better description. 2020-08-20 19:05:59 -06:00
Robin Appelman
cf944452b7
add basic derive macro for Pod, Zeroable and TransparentWrapper for structs (#30)
* add basic derive macro for Pod and Zeroable for structs

* add derive macro for TransparentWrapper

* use core::mem::size_of instead of std::mem::size_of in generated code

* cleanup error handling a bit

* remove unneeded iter logic

* remove unneeded clone and order impl

* fix generics

* fix doc typo

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>

* remove unneeded lifetime anotation

* use unreachable for already rejected patch

Co-authored-by: Lucien Greathouse <me@lpghatguy.com>
2020-08-20 19:04:36 -06:00