rob 0.1.0

Reference-or-box, with similar functionality to Cow
Documentation
  • Coverage
  • 100%
    11 out of 11 items documented3 out of 10 items with examples
  • Size
  • Source code size: 23.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • eduardosm/rust-rob
    4 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • eduardosm

This crate provides Rob<'a, T> a type that can contain either a borrwed reference or an owned Box. It is similar to std::borrow::Cow<'a, T>, but it always uses a Box to stored owned values.

The main difference with Cow is that Rob is not implemented as an enum, instead it is a struct with a pointer and a flag that indicates whether the value is owned or not. This allows to use the value by accessing directly the pointer, without the overhead of matching an enum needed by Cow.