slice-rc 0.1.0

A variety of reference-counted with better support for slices than std::rc::Rc
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Slice `Rc`


This crate provides a variation of reference-counted pointer that allows sub-slices to also contribute to the reference counter. A basic example of that different:

```rust
use slice_rc::Src;

fn main() {
  let hello_world: Src<str> = Src::new("Hello World!");
  let world: Src<str> = hello_world.slice(6..11);
  
  assert_eq!(hello_world, "Hello World!");
  assert_eq!(world, "World");
}
```

See the documentation for more elaborate examples.