-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in 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(()),
} |
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.