https://github.com/johnschug/inline_dyn
A container type for storing dynamically-sized types inline.
https://github.com/johnschug/inline_dyn
library memory-management rust
Last synced: 6 months ago
JSON representation
A container type for storing dynamically-sized types inline.
- Host: GitHub
- URL: https://github.com/johnschug/inline_dyn
- Owner: johnschug
- License: apache-2.0
- Created: 2020-01-26T06:50:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-20T18:48:23.000Z (7 months ago)
- Last Synced: 2025-11-23T23:23:34.830Z (7 months ago)
- Topics: library, memory-management, rust
- Language: Rust
- Homepage:
- Size: 52.7 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# inline_dyn
[![crates.io version][version]][crate]
[![docs.rs][docs badge]][docs]
[![Build Status][build]][ci]
A container type for storing dynamically-sized types (e.g., trait objects, slices) inline.
# Example
Creating an owned trait object without dynamic allocation:
```rust
use inline_dyn::fmt::InlineDynDisplay;
// Can store any type that implements `Display` as long as it is layout
// compatible with `usize`.
let val: InlineDynDisplay = ::new(42u8);
assert_eq!(val.to_string(), "42");
```
# License
Licensed under either of Apache License (Version 2.0) or MIT license at your
discretion.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
be dual licensed as above, without any additional terms or conditions.
[version]: https://img.shields.io/crates/v/inline_dyn?style=flat-square
[crate]: https://crates.io/crates/inline_dyn
[docs badge]: https://img.shields.io/badge/docs.rs-inline__dyn-yellow?style=flat-square
[docs]: https://docs.rs/inline_dyn
[build]: https://img.shields.io/github/actions/workflow/status/johnschug/inline_dyn/ci.yml?branch=master&style=flat-square
[ci]: https://github.com/johnschug/inline_dyn/actions/workflows/ci.yml