refcell-lock-api 0.1.0

A single-threaded implementation of lock_api for RefCell, to alllow abstracting between single-threaded & multi-threaded code
Documentation
  • Coverage
  • 83.33%
    5 out of 6 items documented1 out of 3 items with examples
  • Size
  • Source code size: 26.46 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.71 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Techcable/refcell-lock-api
    0 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Techcable

cell-lock-api

An single-threaded implementation of lock_api using a RefCell.

This is primarily intended to allow abstracting over single-threaded and multi-threaded code.

Example

use cell_lock_api::CellRwLock;
fn main() {
    let lock = CellRwLock::new(vec![7i32]);
    {
        let guard = lock.read();
        assert_eq!(*guard, vec![7]);
    }
    {
        let mut guard = lock.write();
        guard.push(18);
        guard.push(19);
    }
    assert_eq!(lock.into_inner(), vec![7, 18, 19])
}