• Home
Name Date Size #Lines LOC

..--

README.mdD03-May-20241.4 KiB4026

enum-default-expanded.rsD03-May-20243.1 KiB10259

enum-default.rsD03-May-2024216 148

not_unpin-expanded.rsD03-May-20244 KiB12674

not_unpin.rsD03-May-2024342 1811

pinned_drop-expanded.rsD03-May-20245.1 KiB15587

pinned_drop.rsD03-May-2024412 2416

project_replace-expanded.rsD03-May-20245.2 KiB157100

project_replace.rsD03-May-2024223 159

struct-default-expanded.rsD03-May-20245.4 KiB15677

struct-default.rsD03-May-2024206 159

unsafe_unpin-expanded.rsD03-May-20243.2 KiB10866

unsafe_unpin.rsD03-May-2024294 1710

README.md

1# Examples and generated code of each feature of pin-project
2
3### Basic usage of `#[pin_project]` on structs
4
5- [example](struct-default.rs)
6- [generated code](struct-default-expanded.rs)
7
8### Basic usage of `#[pin_project]` on enums
9
10- [example](enum-default.rs)
11- [generated code](enum-default-expanded.rs)
12
13### Manual implementation of `Unpin` by `UnsafeUnpin`
14
15- [example](unsafe_unpin.rs)
16- [generated code](unsafe_unpin-expanded.rs)
17- [`UnsafeUnpin` documentation](https://docs.rs/pin-project/1/pin_project/trait.UnsafeUnpin.html)
18
19### Manual implementation of `Drop` by `#[pinned_drop]`
20
21- [example](pinned_drop.rs)
22- [generated code](pinned_drop-expanded.rs)
23- [`#[pinned_drop]` documentation](https://docs.rs/pin-project/1/pin_project/attr.pinned_drop.html)
24
25### `project_replace()` method
26
27- [example](project_replace.rs)
28- [generated code](project_replace-expanded.rs)
29- [`project_replace()` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#project_replace-method)
30
31### Ensure `!Unpin` by `#[pin_project(!Unpin)]`
32
33- [example](not_unpin.rs)
34- [generated code](not_unpin-expanded.rs)
35- [`!Unpin` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin)
36
37Note: These generated code examples are the little simplified version of the
38actual generated code. See [expansion tests](../tests#expansion-tests-expand-expandtestrs) if you
39want to see the exact version of the actual generated code.
40