Matthias Krüger a643e59800
Rollup merge of #91828 - oxalica:feat/waker-getters, r=dtolnay
Implement `RawWaker` and `Waker` getters for underlying pointers

implement #87021

New APIs:
- `RawWaker::data(&self) -> *const ()`
- `RawWaker::vtable(&self) -> &'static RawWakerVTable`
- ~`Waker::as_raw_waker(&self) -> &RawWaker`~ `Waker::as_raw(&self) -> &RawWaker`

This third one is an auxiliary function to make the two APIs above more useful. Since we can only get `&Waker` in `Future::poll`, without this, we need to `transmute` it into `&RawWaker` (relying on `repr(transparent)`) in order to access its data/vtable pointers.

~Not sure if it should be named `as_raw` or `as_raw_waker`. Seems we always use `as_<something-raw>` instead of just `as_raw`. But `as_raw_waker` seems not quite consistent with `Waker::from_raw`.~ As suggested in https://github.com/rust-lang/rust/pull/91828#discussion_r770729837, use `as_raw`.
2022-02-01 16:08:02 +01:00
..
2022-01-10 14:18:28 -08:00
2021-10-18 19:19:28 +09:00
2021-12-15 00:11:23 +08:00
2021-10-18 19:19:28 +09:00
2022-01-28 15:01:07 +01:00
2021-10-18 19:19:28 +09:00
2021-11-28 01:31:25 -05:00
2021-11-21 19:10:39 -08:00
2021-12-17 20:46:47 +08:00
2021-10-17 18:39:54 +09:00
2021-12-02 19:22:00 -08:00