How to extract the Type of a generic struct and use it for pattern matching?

Thank you all very much! This may be a stupid question, but you are really nice people!