Rust Types - Taxonomy
By Nikita Bishonen ⢠5 minutes read ā¢
Hello! Today Iām sharing my thoughts on type taxonomy in Rust. This is the first version of the taxonomy and post, and Iād be grateful for any ideas to improve it.
Taxonomy
Taxonomy (from Ancient Greek ĻĪ¬Ī¾Ī¹Ļ ā arrangement, order and νĻĪ¼ĪæĻ ā law) ā the doctrine of principles and practice of classification and systematization of complex organized hierarchically related entities.
I wanted to decorate my study with a graphical illustration of the ātaxonomyā of the data type system, similar to what Rust uses. Unfortunately, my searches didnāt yield the desired result, so I decided to create my own illustration and share it with you in this publication.
Types
Theories
There are many theories, some of which are conditioned by the history of the development of computer science, others have real practical value and theoretical justification. Iāll provide links to two popular theories from both categories:
But I wonāt try to delve into details since I understand them with difficulty, let alone the ability to explain them.

Type Theory and Rust
The main question I was looking for an answer to is the type theory behind Rust and its projection onto the types we use when writing Rust code.
Iām not the only one asking this question: https://users.rust-lang.org/t/practical-intro-to-type-theory/18204/5
Thereās also a small presentation on this topic: https://av.tib.eu/media/52178
āMental modelā: https://ia0.github.io/unsafe-mental-model/type-theory.html
And an interesting post: https://www.kurtlawrence.info/blog/category-theory-with-rust-pt1
But they all have lots of text and donāt have a ācomprehensiveā chart that I could hang on my wall.
Rust Types Taxonomy

Ultimately, based on my knowledge of theory, I created the first version of this taxonomy. I really love using trees (especially binary trees) to build hierarchies, as I find it easier to navigate and understand their essence. The visualization itself is, of course, the goal of this publication, but for interested and inexperienced readers, I provide some explanations and links below.
P-type
Product type - no, thatās not it. We combine several types into one, obtaining the product of possible values of these types as a new set of values. Which types in Rust implement it?
- Tuple: Tuple
- Struct: Struct
- Tuple Struct: Tuple Struct
- Unit-Like Struct: Unit-Like Struct
- Array: Array
- Slice: Slice
Ī£-type
Sum type unlike the P-type, a sum type provides stricter control over possible values of used types.
- Enum: Tagged Union
- Option: Option
- Result: Result
Pointer types
Rust has capabilities for working with memory, so the language contains both references and pointers. What interests us are only the āhigh-levelā concepts.
- References: References
- Smart pointers
- Box: Allocates a value in the heap. Box
- Rc/Arc: Reference counters. Reference counters
- Ref/RefMut + RefCell: Borrowing at the program execution level. Runtime borrowing
Other types
- Functions: Not included in the current version of the taxonomy, so they are mentioned only for reference.
- Closures: Closures
- FnOnce: Documentation
- FnMut: Documentation
- Fn: Documentation
- Trait objects: Trait Objects
- Phantom types: Phantom Data