1 unstable release

0.2.0 Mar 10, 2020
0.1.0 Mar 10, 2020

#2553 in Data structures

MIT license

43KB
655 lines

Build Status Crate Docs

rust-arae

Cursed data structures
Documentation hosted on docs.rs.

arae = "0.2.0"

Example

use arae::{CurVec, CursedExt, Bounded};

// Create a new `CurVec` of length 10 with the elements 
// initialized via `Default::default`.
let mut vec = CurVec::new_with_default(10);

// Create two cursors pointing the the head of the vec.
let write_cursor = vec.head();
let read_cursor = vec.head();

*vec.get_mut(write_cursor) = 1;

assert_eq!(*vec.get(read_cursor), 1);

lib.rs:

arae provides Cursed, a trait for types that provide the ability to access their elements given a Cursor.

Example

use arae::{CurVec, CursedExt, Bounded};

// Create a new `CurVec` of length 10 with the elements
// initialized via `Default::default`.
let mut vec = CurVec::new_with_default(10);

// Create two cursors pointing the the head of the vec.
let write_cursor = vec.head();
let read_cursor = vec.head();

*vec.get_mut(write_cursor) = 1;

assert_eq!(*vec.get(read_cursor), 1);

Dependencies

~0–275KB