aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2020-09-17 19:44:27 +0200
committerDanny Milosavljevic <dannym@scratchpost.org>2020-09-18 22:12:17 +0200
commit7e25147e15e7fc69e8064dbe266e3a683fa48d54 (patch)
tree3a096e6bf1363d43b72dbb4b8058bcd951043b02 /gnu
parentaa9ba865deadf8b95c629daca6e57eb4f3edefbe (diff)
downloadguix-7e25147e15e7fc69e8064dbe266e3a683fa48d54.tar
guix-7e25147e15e7fc69e8064dbe266e3a683fa48d54.tar.gz
gnu: Add rust-packed-struct.
* gnu/packages/crates-io.scm (rust-packed-struct): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/crates-io.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 1257d6160a..5b1c435c98 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -30762,3 +30762,44 @@ implementation that works everywhere, even WASM!")
(description
"This package provides a library for parsing compiled zoneinfo files.")
(license license:expat)))
+
+(define-public rust-packed-struct
+ (package
+ (name "rust-packed-struct")
+ (version "0.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (crate-uri "packed_struct" version))
+ (file-name
+ (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "10b2fmxchmcigwagnhi42frj74dl02wyv0xwmbr9839qfh7gijlh"))))
+ (build-system cargo-build-system)
+ (arguments
+ `(#:cargo-inputs
+ (("rust-serde" ,rust-serde-1)
+ ("rust-serde-derive" ,rust-serde-derive-1))))
+ (home-page "http://www.hashmismatch.net/libraries/packed-struct/")
+ (synopsis "Binary-level structure packing and unpacking generator")
+ (description "This package provides bit-level packing an unpacking
+of structs. The library provides a meta-programming approach, using
+attributes to define fields and how they should be packed. The resulting
+trait implementations provide safe packing, unpacking and runtime debugging
+formatters with per-field documentation generated for each structure.
+
+@itemize
+@item Plain Rust structures, decorated with attributes
+@item MSB or LSB integers of user-defined bit widths
+@item Primitive enum code generation helper
+@item MSB0 or LSB0 bit positioning
+@item Documents the field's packing table
+@item Runtime packing visualization
+@item Nested packed types
+@item Arrays of packed structures as fields
+@item Reserved fields, their bits are always 0 or 1
+@end itemize")
+ ;; User can choose either license.
+ (license (list license:expat license:asl2.0))))
+