Skip to content

johnschug/inline_dyn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A container type for storing dynamically-sized types inline.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages