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. The only unsafe
interfaces provided are traits and the low-level
transmute_unchecked function.
§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.
- Init
- Denotes a type that is always initialised.
- Into
Octets - Denotes a type representable as octets (bytes).
- Outlay
- Denotes an outlayable type.
- Zeroable
- Denotes a type that is zeroable.
Functions§
- transmute
- Transmutes an object to another type.
- 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.
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.