-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
der: add IsConstructed
trait, impl'ed on any FixedTag
#1744
base: master
Are you sure you want to change the base?
der: add IsConstructed
trait, impl'ed on any FixedTag
#1744
Conversation
This doesn't seem to do a whole lot as-is. What else are you planning on impl'ing |
On trait |
If I remember correctly, the edge case is here: So it's a CHOICE with |
You should try to add it there, as I think for what you’re proposing the blanket impls(?) would conflict |
It will take me some time to recreate the |
I give up. It's pretty much impossible to implement this case in current #[derive(Choice)]
pub enum ObjectValue<T>
where
for<'a> T: /* what to put here ? */,
{
Indirect(Path),
#[asn1(context_specific = "0", tag_mode = "IMPLICIT")]
Direct(T),
} [Spoiler] error[E0277]
So
|
Btw /// ```asn1
/// ReferencedValue {Type} ::= CHOICE {
/// path Path,
/// url URL
/// }
/// URL ::= CHOICE {
/// url CHOICE {
/// printable PrintableString,
/// ia5 IA5String
/// },
/// urlWithDigest [3] SEQUENCE {
/// url IA5String,
/// digest DigestInfoWithDefault
/// }
/// }
/// ```
#[derive(Choice, Clone, Debug, Eq, PartialEq)]
#[tag_mode = "IMPLICIT"]
pub enum ReferencedValue {
Path(Path),
PrintableStringUrl(PrintableString),
Ia5StringUrl(Ia5String),
#[asn1(context_specific = "3")]
UrlWithDigest(()),
} |
der_derive: impl IsConstructed on derive(Choice) der: draft of test for IsConstructed vs Tagged edge case der: test: generic CHOICE inside [0] IMPLICIT CHOICE Revert "der: test: generic CHOICE inside [0] IMPLICIT CHOICE" This reverts commit dda1215. Revert "der: draft of test for IsConstructed vs Tagged edge case" This reverts commit 5daa9ba. der: add IsConstructed test docs
dda1215
to
5ee5ef6
Compare
Closes #1741
This PR drops the need to implement
Tagged
on all structs that are IMPLICIT.For example
CHOICE
does not implementFixedTag
, but is always constructed.