doc: adding example for type definitions
auto merge of #19136 : alfie/rust/master, r=steveklabnik

An example of how type definitions work would be handy