https://github.com/webern/rs_poc_wrapper
A proof of concept of a trait for use in the Bottlerocket model
https://github.com/webern/rs_poc_wrapper
Last synced: about 1 year ago
JSON representation
A proof of concept of a trait for use in the Bottlerocket model
- Host: GitHub
- URL: https://github.com/webern/rs_poc_wrapper
- Owner: webern
- License: mit
- Created: 2022-10-30T05:22:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-03T16:59:13.000Z (over 3 years ago)
- Last Synced: 2025-01-24T21:25:10.915Z (over 1 year ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wrapped
This is prep work for fixing Bottlerocket https://github.com/bottlerocket-os/bottlerocket/issues/2257.
In this POC I've demonstrated for myself a way to use a `Wrapped` trait to represent what is currently always...
```rust
struct Something {
inner: String
}
```
...in Bottlerocket.
The idea is to replace `String` with any type `T` (with some trait bounds).
Currently, I do the "impls" with macro_rules because that is *way* easier than a procedural macro.
Also, there are some follow-ups, like getting `AsRef` to work when the inner type is `AsRef`.