Adding to @Daniel_Berge 's answer, you can easily dispatch on more specific aliases:
const Len{T} = Quantity{T,u"π"}
const Met{T} = Quantity{T,u"π",typeof(m)}
const Deg{T} = Quantity{T,NoDims,typeof(Β°)}
const Rad{T} = Quantity{T,NoDims,typeof(rad)}
You donβt need to construct concrete Unitful.jl types for dispatch. And you can let Julia figure out the exact type in a field using a type parameter:
struct Foo{L<:Met}
len::L
end