Crates.io | fat_type |
lib.rs | fat_type |
version | 0.3.0 |
source | src |
created_at | 2021-06-17 04:07:08.555886 |
updated_at | 2023-01-23 06:54:44.749103 |
description | A type which permits thin references to arrays and dynamic types. |
homepage | |
repository | https://gitlab.com/nwsharp/fat_type |
max_upload_size | |
id | 411135 |
size | 37,294 |
fat_type
provides the type Fat<T, U>
, which combines a value of type U
with the metadata
needed to construct references to it as a T
.
Because the metadata is stored with the value instead of in references, Fat<T>
is Thin
. This
property is mainly useful in niche foreign-function-interface use-cases or in memory-constrained
environments. As such, this library is no_std
.
In particular, the author has found this crate useful in passing around Rust closure types as userdata pointers in several C-language FFI projects.
Inline rustdoc documentation is available. A mirror of this documentation is available at https://docs.rs/fat_type.
fat_type
is developed at GitLab.
This crate is rigorously tested with Miri and maintains full compliance with strict pointer provenance.
Reasonable performance, correctness, documentation, and ease-of-use contributions are always welcome. Bug reports are accepted through GitLab, but feature requests are not.
Please ensure pull requests match the existing coding style and are formatted with rustfmt.
Spelling and grammatical errors are considered bugs, so please use spell-checking facilities prior to submitting a contribution.
By contributing, you grant all contributors a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, relicense, sublicense, and distribute your contributions.
Additionally, you affirm that you are legally entitled to grant such license and that your contributions are not and will not become patent-encumbered. In the event that you discover that such affirmation was made in error, you agree to post notice of such error in a conspicuous place (such as a GitLab Issue) within three days.
fat_type
is licensed under the terms of the Apache License, Version 2.0 or the
MIT License.
This document is Copyright (C) 2022 Nathan Sharp.
Permission is granted to reproduce this document, in any form, free of charge.