stackpin 0.0.2

Crate for data that should be pinned to the stack at the point of declaration.
Documentation
  • Coverage
  • 90.91%
    10 out of 11 items documented2 out of 8 items with examples
  • Size
  • Source code size: 45.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.43 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • dureuill/stackpin
    13 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dureuill

stackpin

This crate exposes a StackPinned type that allows to represent !Unpin data that should be pinned to the stack at the point of declaration.

To do so, this crate provides a FromUnpinned trait and a stack_let! macro that enable safe construction of Pin<StackPinned> objects (aliased to PinStack for short).

Getting instances pinned at the point of declaration is as easy as:

stack_let!(unmovable = Unmovable::new_unpinned("Intel the Beagle")); // this creates the unmovable instance on the stack and binds `unmovable` with a `PinStack<Unmovable>`

For Unmovable a struct implementing the FromUnpinned<String> trait.

See the crate documentation for details, or look directly at the examples.