Crates.io | inline_dyn |
lib.rs | inline_dyn |
version | 0.2.1 |
source | src |
created_at | 2020-10-13 07:47:09.052344 |
updated_at | 2023-12-12 06:09:07.176842 |
description | A container type for storing dynamically-sized types inline |
homepage | |
repository | https://github.com/johnschug/inline_dyn |
max_upload_size | |
id | 299112 |
size | 58,898 |
A container type for storing dynamically-sized types (e.g., trait objects, slices) inline.
Creating an owned trait object without dynamic allocation:
use inline_dyn::fmt::InlineDynDisplay;
// Can store any type that implements `Display` as long as it is layout
// compatible with `usize`.
let val: InlineDynDisplay = <InlineDynDisplay>::new(42u8);
assert_eq!(val.to_string(), "42");
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.