Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Stabilize enum-map #2

Closed
KamilaBorowska opened this issue Nov 30, 2017 · 2 comments
Closed

Stabilize enum-map #2

KamilaBorowska opened this issue Nov 30, 2017 · 2 comments
Milestone

Comments

@KamilaBorowska
Copy link
Owner

KamilaBorowska commented Nov 30, 2017

For 1.0.0, an Internal interface which will likely be renamed to Enum will need to be stabilized. The plan is once const generics become stable (see rust-lang/rust#44580) - although worth noting that this doesn't need full const generics, just being able to use associated consts within a struct, an Internal trait would be rewritten as such.

trait Enum {
    const DISCRIMINANTS: usize;
    fn discriminant(self) -> usize;
    fn from_discriminant(discriminant: usize) -> Self;
}
@KamilaBorowska
Copy link
Owner Author

Also, index_for_key function will be removed as it won't be needed after stabilizing Enum trait.

@KamilaBorowska KamilaBorowska added this to the 1.0.0 milestone Mar 30, 2018
@KamilaBorowska
Copy link
Owner Author

It would be neat to have a compact enum map representation for bincode and similar formats, but again, incompatible change.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant