Ada has 'Valid and so you can also do e.g.
If Guess'Valid then ...
In order to check that the data is valid for the types range whilst avoiding the exception that would occur if otherwise read whilst containing invalid data.
Gnat also has the non standard 'Valid_Scalars for records.
Which will check every scalar type in a record. This record may have been filled by unchecked_conversion which ironically does check the size at compile time. It is all very neat along with record overlays. I can't stress enough how far ahead of the competition Ada is for handling hardware registers whether memory mapped or received.
Where is the link for pattern matching as I am unsure of the necessity of it in Ada? I prefer Adas features to Darts new pattern matching atleast for json validation. I do not otherwise have extensive experience of Darts pattern matching though or any of Rusts.