inline_dyn

Crates.ioinline_dyn
lib.rsinline_dyn
version0.2.1
sourcesrc
created_at2020-10-13 07:47:09.052344
updated_at2023-12-12 06:09:07.176842
descriptionA container type for storing dynamically-sized types inline
homepage
repositoryhttps://github.com/johnschug/inline_dyn
max_upload_size
id299112
size58,898
John Schug (johnschug)

documentation

README

inline_dyn

crates.io version docs.rs Build Status

A container type for storing dynamically-sized types (e.g., trait objects, slices) inline.

Example

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");

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.

Commit count: 19

cargo fmt