Amanieu / intrusive-rs

Intrusive collections for Rust
Apache License 2.0
412 stars 48 forks source link

Feature Request: Support for enum variants #55

Open vinaychandra opened 3 years ago

vinaychandra commented 3 years ago

If an enum variant contains the Link field and the user can guarantee the variant, it should be possible to push the Link into the enum variant type so that only that variant can support the collection rather than wrapping the whole enum in another struct containing the links

Example:

enum SomeEnum {
    variant1: {
        link: Link
        ...
    }
}

Instead of

struct SomeWrapper {
    link: Link
    enum: SomeEnum
}