Open
Description
I'd like to be able to use metadata generation during compilation type in const fn
environment. The result will be stored in const
or static
and avoiding build scripts and boilerplate would be very desirable.
Something like this:
const fn foo() {
let mut buffer = [0u8; MAX_METADATA_CAPACITY];
let metadata_size = MyType::type_info_encode_into(&mut buffer).unwrap();
let encoded_metadata = &encoded[..metadata_size];
// ...
}
Traits with const fn
methods are very much unstable, but derive macro could have generated a regular impl with a method in it.
Metadata
Metadata
Assignees
Labels
No labels