dungeon-cell
Cell and Cell-like types that can store any type without dynamic memory.
Currently only the [DungeonCore
] primitive is implemented (unsized, cell, stack vec, ... are in progress).
Example
use ;
// a default DungeonCore can store any 'static type that fits in the layout
let mut core = > default;
// we can store a i32 and get it back
core.store;
assert_eq!;
// we can store a f64 and get it back
core.store;
assert_eq!;
// lets get adventurous and store a String
core.store;
assert_eq!;
// we can't take a type the core isn't storing
core.store;
assert_eq!;
// we can borrow both unique and shared
core.store;
*core..unwrap += 10;
assert_eq!;
Features
"alloc"
- Enable support foralloc
types."std"
- Enable support forstd
types. Also enables"alloc"
."unsize"
- Enable use of the nightly featureunsize
. Requires a nightly compiler."many_arg_fn"
- Enable implementations for functions with 11-30 arguments.
No-std Support
This crate is #![no_std]
by default, it can be used anywhere Rust can.
Minimum Supported Rust Version
Requires Rust 1.64.0.
This crate follows the "Latest stable Rust" policy. The listed MSRV won't be changed unless needed. However, updating the MSRV anywhere up to the latest stable at time of release is allowed.