stackpin

Crates.iostackpin
lib.rsstackpin
version0.0.2
sourcesrc
created_at2019-10-12 09:33:43.094223
updated_at2019-10-12 09:37:07.040711
descriptionCrate for data that should be pinned to the stack at the point of declaration.
homepage
repositoryhttps://github.com/dureuill/stackpin
max_upload_size
id171874
size46,219
Louis Dureuil (dureuill)

documentation

https://docs.rs/stackpin

README

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.

Commit count: 20

cargo fmt