Amanieu / intrusive-rs

Intrusive collections for Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Support for enum variants

vinaychandra opened this issue · comments

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
}