Skip to main content

derive_deftly_template_DirectorySignatureHashesAccu

Macro derive_deftly_template_DirectorySignatureHashesAccu 

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

Ad-hoc derives for [DirectorySignatureHash] impls, avoiding copypasta bugs

§Input

  • pub enum DirectorySignatureHashAlgo
  • Unit variants
  • Each variant with #[deftly(hash_len = "N")] where N is the digest length in bytes.

§Generated code

  • pub enum DirectorySignaturesHashesAccu, with each variant a 1-tuple containing Option<[u8; N]>. (These are None if this hash has not been computed yet.)

  • DirectorySignaturesHashesAccu::parse_keyword_and_hash

  • DirectorySignaturesHashesAccu::hash_slice_for_verification

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