Skip to main content

Module ns_per_flavour_macros

Module ns_per_flavour_macros 

Source
Expand description

Machinery for defining multiple flavours of network status document

This module has one sub-module for each flavour. That sub-module is named after the flavour, and its source file is flavoured.rs. (We treat votes as a β€œflavour”.)

The following macros are defined for use by flavoured.rs for flavour-dependent elements:

  • ns_type!( TypeForVote, TypeForConsensus, [TypeForConsensusMd] ):

    Expands to the appropriate one of the two or three specified types. If TypeForConsensusMd is not specified, TypeForConsensus is used.

  • ns_expr!( value_for_vote, value_for_consensus, [value_for_consensus_md] ):

    Expands to the appropriate one of the two or three specified expressions. If value_for_consensus_md is not specified, TypeForConsensus is used.

  • ns_choose!( ( FOR VOTE.. )( FOR CONSENSUS.. )( FOR CONSENSUS MD.. ) ):

    Expands to the appropriate one of the two or three specified token streams. (The ( ) surrounding each argument are discarded.)

ModulesΒ§

cons
network status documents - types that vary by flavour
md
network status documents - types that vary by flavour
vote
network status documents - types that vary by flavour

MacrosΒ§

ns_choose πŸ”’
ns_choose πŸ”’
ns_choose πŸ”’
ns_do_one_flavour πŸ”’
Does the work for one flavour.
ns_export_flavoured_types πŸ”’
Export each flavour::Ty as TyFlavour
ns_expr πŸ”’
ns_expr πŸ”’
ns_expr πŸ”’
ns_type πŸ”’
ns_type πŸ”’
ns_type πŸ”’