Expand description

Can be attached to a module. Doing so will declare that module as importable into a pallet via #[import_section].

Note that sections are imported by their module name/ident, and should be referred to by their full path from the perspective of the target pallet. Do not attempt to make use of use statements to bring pallet sections into scope, as this will not work (unless you do so as part of a wildcard import, in which case it will work).

Naming Logistics

Also note that because of how #[pallet_section] works, pallet section names must be globally unique within the crate in which they are defined. For more information on why this must be the case, see macro_magic’s #[export_tokens] macro.

Optionally, you may provide an argument to #[pallet_section] such as #[pallet_section(some_ident)], in the event that there is another pallet section in same crate with the same ident/name. The ident you specify can then be used instead of the module’s ident name when you go to import it via #[import_section].