Skip to content

Crate for data that should be pinned to the stack at the point of declaration.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

dureuill/stackpin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Crate for data that should be pinned to the stack at the point of declaration.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages