1 unstable release

Uses old Rust 2015

0.1.0 Apr 5, 2018

#47 in #owned

MIT/Apache

12KB
296 lines

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.

No runtime deps