commit | 4dc2762c1a9f14b15a4a90bf1eecb3c06b4d6756 | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Tue Dec 03 17:10:24 2024 +0000 |
committer | James Farrell <jamesfarrell@google.com> | Tue Dec 03 17:10:24 2024 +0000 |
tree | a72f02da0693ae0df2205e775b8e7d715f3ce94c | |
parent | 8cedf65b8263f7addcb996b062a6cac59e1f411c [diff] |
Migrate 9 newly imported crates to monorepo libusb1-sys ptr_meta ptr_meta_derive rusb ucs2 uefi uefi-macros uefi-raw uguid Bug: http://b/339424309 Test: treehugger Change-Id: I00850304c3f3142ce8f21dca91d816cb0f33f1aa
A radioactive stabilization of the ptr_meta
RFC.
Sized types already have Pointee
implemented for them, so most of the time you won't have to worry about them. However, trying to derive Pointee
for a struct that may or may not have a DST as its last field will cause an implementation conflict with the automatic sized implementation.
slice
s and str
sThese core types have implementations built in.
You can derive Pointee
for last-field DSTs:
use ptr_meta::Pointee; #[derive(Pointee)] struct Block<H, T> { header: H, elements: [T], }
You can generate a Pointee
for trait objects:
use ptr_meta::pointee; // Generates Pointee for dyn Stringy #[pointee] trait Stringy { fn as_string(&self) -> String; }