1 00:00:06,000 --> 00:00:09,540 The clone trade is for types that can make copies of themselves. 2 00:00:09,660 --> 00:00:15,780 For this to work, it needs to construct an independent copy using the self keyword and then return 3 00:00:15,810 --> 00:00:16,110 it. 4 00:00:16,620 --> 00:00:25,130 A clones definition is as what's followed, so we have our trait clone, which also implements the sized 5 00:00:25,150 --> 00:00:29,220 trait, and then we have a couple of methods associated with it. 6 00:00:30,480 --> 00:00:36,570 Cloning a value typically means allocating copies of anything it owns, which can make clones very time 7 00:00:36,570 --> 00:00:37,860 and memory expensive. 8 00:00:38,250 --> 00:00:40,920 Just imagine taking a vector of strings and cloning. 9 00:00:41,310 --> 00:00:44,310 Every string inside the vector would also be cloned. 10 00:00:44,310 --> 00:00:48,330 So as you can expect, a clone can indeed be very expensive. 11 00:00:48,780 --> 00:00:56,670 The types like AI 32 and Boolean implement clone, but other things such as mutex, which we will talk 12 00:00:56,670 --> 00:00:59,580 about in the concurrency section, do not.