deque_cell

Crates.iodeque_cell
lib.rsdeque_cell
version0.1.0
sourcesrc
created_at2015-08-18 22:47:36.383527
updated_at2015-12-11 23:58:31.338387
descriptionProvides an efficient wrapper around VecDeque, enabling safe internal mutability without the overhead of RefCell's runtime checks.
homepagehttps://github.com/Diggsey/deque_cell
repositoryhttps://github.com/Diggsey/deque_cell
max_upload_size
id2871
size2,326
Diggory Blake (Diggsey)

documentation

README

deque_cell

Provides an efficient wrapper around VecDeque, enabling safe internal mutability without the overhead of RefCell's runtime checks.

API

Method names match those of VecDeque, but mutating methods take &self rather than &mut self. Safety is preserved by disallowing internal references to the VecDeque.

Example use

DequeCell<T> can be used to store a queue of actions to perform when mutable access to a resource is possible. When mutable access is gained, each action can be popped from the queue and executed, with exclusive access to the resource. Due to the internal mutability of the queue, these actions can themselves push additional actions onto the queue.

Commit count: 3

cargo fmt