diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /third_party/rust/pin-project/examples/README.md | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/pin-project/examples/README.md')
-rw-r--r-- | third_party/rust/pin-project/examples/README.md | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/third_party/rust/pin-project/examples/README.md b/third_party/rust/pin-project/examples/README.md new file mode 100644 index 0000000000..0f30a7fc82 --- /dev/null +++ b/third_party/rust/pin-project/examples/README.md @@ -0,0 +1,39 @@ +# Examples and generated code of each feature of pin-project + +### Basic usage of `#[pin_project]` on structs + +- [example](struct-default.rs) +- [generated code](struct-default-expanded.rs) + +### Basic usage of `#[pin_project]` on enums + +- [example](enum-default.rs) +- [generated code](enum-default-expanded.rs) + +### Manual implementation of `Unpin` by `UnsafeUnpin` + +- [example](unsafe_unpin.rs) +- [generated code](unsafe_unpin-expanded.rs) +- [`UnsafeUnpin` documentation](https://docs.rs/pin-project/1/pin_project/trait.UnsafeUnpin.html) + +### Manual implementation of `Drop` by `#[pinned_drop]` + +- [example](pinned_drop.rs) +- [generated code](pinned_drop-expanded.rs) +- [`#[pinned_drop]` documentation](https://docs.rs/pin-project/1/pin_project/attr.pinned_drop.html) + +### `project_replace()` method + +- [example](project_replace.rs) +- [generated code](project_replace-expanded.rs) +- [`project_replace()` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#project_replace-method) + +### Ensure `!Unpin` by `#[pin_project(!Unpin)]` + +- [example](not_unpin.rs) +- [generated code](not_unpin-expanded.rs) +- [`!Unpin` documentation](https://docs.rs/pin-project/1/pin_project/attr.pin_project.html#unpin) + +Note: These generated code examples are the little simplified version of the +actual generated code. See [expansion tests](../tests#expansion-tests-expand-expandtestrs) if you +want to see the exact version of the actual generated code. |