Tour of Rust Table of Contents

Unit-like Structs

Structs do not have to have any fields at all.

As mentioned in Chapter 1 a unit is another word for an empty tuple (). This is why this kind of struct is called Unit-like.

This type of struct is rarely used.