The other (not necessary orthogonal) option is to add just a get_layout function and just state that the result should be compared to the appropriate constants. (This would probably be a more attractive option if/when some of the constants are refactored to @enums.)
https://github.com/JuliaIO/HDF5.jl/issues/727#issuecomment-721152139