android13/external/rust/crates/pin-project/examples
liiir1985 7f62dcda9f initial 2024-06-22 20:45:49 +08:00
..
README.md initial 2024-06-22 20:45:49 +08:00
enum-default-expanded.rs initial 2024-06-22 20:45:49 +08:00
enum-default.rs initial 2024-06-22 20:45:49 +08:00
not_unpin-expanded.rs initial 2024-06-22 20:45:49 +08:00
not_unpin.rs initial 2024-06-22 20:45:49 +08:00
pinned_drop-expanded.rs initial 2024-06-22 20:45:49 +08:00
pinned_drop.rs initial 2024-06-22 20:45:49 +08:00
project_replace-expanded.rs initial 2024-06-22 20:45:49 +08:00
project_replace.rs initial 2024-06-22 20:45:49 +08:00
struct-default-expanded.rs initial 2024-06-22 20:45:49 +08:00
struct-default.rs initial 2024-06-22 20:45:49 +08:00
unsafe_unpin-expanded.rs initial 2024-06-22 20:45:49 +08:00
unsafe_unpin.rs initial 2024-06-22 20:45:49 +08:00

README.md

Examples and generated code of each feature of pin-project

Basic usage of #[pin_project] on structs

Basic usage of #[pin_project] on enums

Manual implementation of Unpin by UnsafeUnpin

Manual implementation of Drop by #[pinned_drop]

project_replace() method

Ensure !Unpin by #[pin_project(!Unpin)]

Note: These generated code examples are the little simplified version of the actual generated code. See expansion tests if you want to see the exact version of the actual generated code.