Back to the unit-like struct

Now that we have an understanding of tuples and the tuple struct, we can now look at the unit-like struct. This can be considered to be a struct with an empty tuple and as with a tuple struct, it defines a new type.

Typically, we will use this in conjunction with a trait or if you don't have any data to store in it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset