Skip to main content

derive_deftly_template_CertSpecifier

Macro derive_deftly_template_CertSpecifier 

Source
macro_rules! derive_deftly_template_CertSpecifier {
    ({ $($driver:tt)* } [$($aoptions:tt)*] ($($future:tt)*) $($tpassthrough:tt)*) => { ... };
    ($($wrong:tt)*) => { ... };
}
Expand description

A helper for implementing KeyCertificateSpecifiers.

§Results of applying this macro

#[derive(Deftly)] #[derive_deftly(CertSpecifier)] struct SomeCertSpec ... generates:

  • impl KeyCertificateSpecifier for SomeCertSpec
  • struct SomeCertSpecPattern, a derived struct which contains an Option for each denotator field, and a non-optional field for the subject key KeyPathPattern. None in the pattern means “any”.
  • impl CertSpecifierPattern for SomeCertSpecPattern
  • impl TryFrom<KeyPath> for SomeCertSpec`

§Custom attributes

  • #[deftly(subject)] (mandatory, field): Designates a field that represents the subject key specifier. This should only be applied to one field.

  • #[deftly(denotator)] (field): Designates a field that should be represented in the key file leafname. The ArtiPath of the certificate is derived from the ArtiPath of the subject key, by concatenating the ArtiPath of the subject key with provided denotators provided. If no there are no denotators, the ArtiPath of the certificate is the same as the ArtiPath of the subject key.

This is a derive_deftly template. Do not invoke it directly. To use it, write: #[derive(Deftly)] #[derive_deftly(CertSpecifier)].