commit | 8cedf65b8263f7addcb996b062a6cac59e1f411c | [log] [tgz] |
---|---|---|
author | Nikolina Ilic <[email protected]> | Sun Nov 17 23:37:48 2024 +0000 |
committer | Nikolina Ilic <[email protected]> | Mon Nov 18 16:25:26 2024 +0000 |
tree | b61d95ec9886160da286dc347580a37fa35c0f2b | |
parent | 61a465c3335c310ded5917ca720c576941dd1671 [diff] |
ptr_meta: Add no_std variant The ptr_meta no_std variant will be used for the uefi no_std dependency. Use cargo_embargo tool to generate the Android.bp file. cargo_embargo generate cargo_embargo.json Test: m libptr_meta_nostd Change-Id: I5469ca484e58ee846ac82d8982553947e3a7d62c
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; }