Expand description
Octonary transcoder.
This library provides facilities for safe (and hopefully sound) transmutations of Rust objects, mainly to and from octonary (bytewise) representations. These transformations may be done in two ways:
- In-place transmutations: Objects can be reinterpret between different types in-place.
- Serialisations: Objects can also be serialise into a portable representation.
These interfaces are generally safe and are designed so that most programmes can completely avoid any unsafe code.
§Security
Do note that this project is still relatively early in its development. But even with the hundreds of man-hours of development so far, I very much recommend auditing it before using it in production (nevertheless the so-far soundness holes uncovered.) I would not yet use this project in critical systems – although I am confident that it will become realistic to do so at some point.
§Interface stability and versioning
Breaking changes are common, and usage of this library will require continuous maintenance so as to avoid becoming stuck on an unmaintained major release. Nonetheless, core designs are likely to remain more or less the same, and most breakage will be in the form of lesser, syntactical changes, e.g. identifier renaming or parameter reordering.
The octonary format used by serialisations is not stabilised and are not on track to become stabilised. Instead, users should use in-place transmutations or custom serialisers for specific specifications.
§Copyright and licence
Copyright © 2024‐2026 Gabriel Bjørnager Jensen.
This library is distributed under either an MIT
licence or version 2.0 of the Apache License, at
your option. See LICENCE-MIT.txt and
LICENCE-APACHE.txt for more information.
SPDX identifier: MIT OR Apache-2.0
Modules§
- serdes
serdes - Serialisation/deserialisation facilities.
Traits§
- From
Octets - Denotes a type that can represent all octets (bytes.)
- Immutable
- Denotes an interiour-immutable type.
- Into
Octets - Denotes a type representable as octets (bytes.)
- Outlay
- Denotes an outlayable type.
- Unaligned
- Denotes an unaligned type.
- Zeroable
- Denotes a type that is zeroable.
Functions§
- boxed_
from_ ⚠fn_ with_ metadata alloc - Allocates a boxed object with a custom initialiser.
- fill
- Overwrites an object with a specific octet value.
- fill_
unchecked ⚠ - Unsafely overwrites an object with a specific octet value.
- fill_
zeros - Overwrites an object with all-zeros.
- filled
- Unsafely constructs an object from a repeated octet value.
- octets_
of - Retrieves a slice over object octets.
- octets_
of_ mut - Retrieves a mutable slice over object octets.
- transmute
- Transmutes an object to another type.
- transmute_
copy - Transmutes an object to another type, copying the representation.
- transmute_
mut - Transmutes a mutable reference to another type.
- transmute_
mut_ with_ metadata - Transmutes a mutable reference to another type, using predefined metadata.
- transmute_
ref - Transmutes a reference to another type.
- transmute_
ref_ with_ metadata - Transmutes a mutable reference to another type, using predefined metadata.
- transmute_
unchecked ⚠ - Unsafely transmutes an object to another type.
- zeroed
- Constructs a zeroed object.
- zeroed_
boxed_ with_ metadata alloc - Allocates a zeroed, boxed object via metadata.
Derive Macros§
- From
Octets proc_macro - Implements
FromOctetsfor the given type. - Immutable
proc_macro - Implements
Immutablefor the given type. - Zeroable
proc_macro - Implements
Zeroablefor the given type.