docs.rs failed to build stack_dst-0.0.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
stack_dst-0.8.1
Stack-allocated dynamically-sized types
Overview
This crate provides a simple way of returnings DSTs up to a certain size without requiring a heap allocation.
Basic usage
The core type is StackDST<Trait>
, which represents a fixed-capacity allocation of an unsized type.
The new
method on this type allows creating a instance from a concrete type, returning None
if the instance is too large
for the allocated region.
Example
One of the most obvious uses is to allow returning capturing closures without having to box them. In the example below, the closure
takes ownership of value
, and is saved to a StackDST
use StackDST;
let closure = make_closure;
assert_eq!;
Status
- Works for most test cases
- Not rigourously tested
- No support for heap fallback