Skip to content

feat: Allow Named Field Variants in Enums to be inside  #15

@john-bv

Description

@john-bv

In the current rfc for 0.3.0 (#13) I mention the possibility to use this ability within enums and have them be derivable with BinaryIo.

This feature would make the following code block valid:

#[derive(BinaryIo)]
#[repr(u8)]
pub enum NamedEnum {
	One { foo: u8 }
}

fn test() {
	let a = NamedEnum::One { foo: 3 };
	a.write_to_bytes(); // [0, 3]
}

Metadata

Metadata

Assignees

Labels

APIThis issue is related to the APIFeature RequestRequests a feature or change.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions