Open
Description
As a follow-up to #84, it would be helpful to eliminate the gratuitous wrapper struct for anonymous SEQUENCE OF
declarations. For example:
For:
Ticket ::= SEQUENCE {
ages SEQUENCE OF INTEGER (1..5),
passenger Passenger OPTIONAL
}
Passenger ::= ENUMERATED {
adult (0),
youth (1),
...
}
Go from:
#[doc = " Anonymous SEQUENCE OF member "]
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate, value("1..=5"), identifier = "INTEGER")]
pub struct AnonymousTicketAges(pub u8);
#[doc = " Inner type "]
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate)]
pub struct TicketAges(pub SequenceOf<AnonymousTicketAges>);
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(automatic_tags)]
pub struct Ticket {
pub ages: TicketAges,
pub passenger: Option<Passenger>,
}
To:
#[doc = "Ticket::ages SEQUENCE OF element"]
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(delegate, value("1..=5"), identifier = "INTEGER")]
pub struct TicketAgesElement(pub u8);
#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq, Eq, Hash)]
#[rasn(automatic_tags)]
pub struct Ticket {
pub ages: SequenceOf<TicketAgesElement>,
pub passenger: Option<Passenger>,
}
This would reduce a significant amount of boilerplate code for complex ASN.1.
Metadata
Metadata
Assignees
Labels
No labels