Skip to content

Retrieve data and vtable from Waker #2746

Open
@comex

Description

@comex

Currently, you can use RawWaker::new to create a RawWaker from a data pointer and vtable pointer, and you can use Waker::from_raw to create a Waker from a RawWaker.

But there are no APIs to perform either conversion in the opposite direction. Why not?

Retrieving the data and vtable pointer would be particularly useful for a Future that expects to be run on a particular executor: it could downcast the data pointer to perform custom operations on it, after verifying that the vtable pointer was an expected value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitProposals re. async / awaitAsyncAwait-TriagedT-libs-apiRelevant to the library API team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions