What’s the best/most succinct way to define a struct that is only used inside of one module? I sometimes have structures that I want to be more explicit than a map but that have no use elsewhere.
Is there an accepted solution to this problem in the community?
There is no way to do that. Structs are a module based definition for specialized maps and just like the defining modules themselfs are globally accessible so are their struct features.
Both answers so far address limiting external accessibility, but in my literal reading of the OP I don’t see that concern. So my naive answer is: just do a defstruct in the module which will be the sole consumer of the struct.
Yeah that’s an option, but if that’s the only one I’d rather keep it a Map, as my hunch says that no description might be better than a misleading description.