fat_type

Crates.iofat_type
lib.rsfat_type
version0.3.0
sourcesrc
created_at2021-06-17 04:07:08.555886
updated_at2023-01-23 06:54:44.749103
descriptionA type which permits thin references to arrays and dynamic types.
homepage
repositoryhttps://gitlab.com/nwsharp/fat_type
max_upload_size
id411135
size37,294
Nathan Sharp (nwsharp)

documentation

README

fat_type

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.

Documentation

Inline rustdoc documentation is available. A mirror of this documentation is available at https://docs.rs/fat_type.

Contributing

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.

Pull Requests

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.

Contribution Agreement

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.

License

fat_type is licensed under the terms of the Apache License, Version 2.0 or the MIT License.

Copyright

This document is Copyright (C) 2022 Nathan Sharp.

Permission is granted to reproduce this document, in any form, free of charge.

Commit count: 0

cargo fmt