evobox 0.1.1

A pointer type which allows for safe transformations of its content without reallocation.
Documentation
  • Coverage
  • 75%
    9 out of 12 items documented7 out of 10 items with examples
  • Size
  • Source code size: 17.74 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • lcnr/evobox
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lcnr

Evobox

A pointer type which allows for safe transformations of its content without reallocation. This crate does not depend on the standard library, and can be used in #![no_std] contexts. It does however require the alloc crate.

Examples

use evobox::{EvolveBox, L};

let s: EvolveBox<L<&str, L<String, L<u32>>>> = EvolveBox::new("7");
let owned = s.evolve(|v| v.to_string());
assert_eq!(owned.as_str(), "7");

let seven = owned.try_evolve(|s| s.parse()).expect("invalid integer");
assert_eq!(*seven, 7);