pin-cell 0.2.0

A pin-safe cell
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented0 out of 10 items with examples
  • Size
  • Source code size: 11.59 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.76 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dignifiedquire/pin-cell
    14 5 2
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • withoutboats dignifiedquire

PinCell

This library defines the PinCell type, a pinning variant of the standard library's RefCell.

It is not safe to "pin project" through a RefCell - getting a pinned reference to something inside the RefCell when you have a pinned refernece to the RefCell - because RefCell is too powerful.

A PinCell is slightly less powerful than RefCell: unlike a RefCell, one cannot get a mutable reference into a PinCell, only a pinned mutable reference (Pin<&mut T>). This makes pin projection safe, allowing you to use interior mutability with the knowledge that T will never actually be moved out of the RefCell that wraps it.

License