WEBVTT

1
00:00:03.305 --> 00:00:04.335
<00:00:03.305>Thank <00:00:03.614>you <00:00:03.923>very <00:00:04.232>much.

2
00:00:04.345 --> 00:00:07.055
<00:00:04.345>Thank <00:00:04.520>you <00:00:04.694>for <00:00:04.869>the <00:00:05.045>possibility <00:00:05.220>to <00:00:05.395>do <00:00:05.569>this <00:00:05.744>talk.

3
00:00:07.115 --> 00:00:10.935
<00:00:07.115>To <00:00:07.270>spend <00:00:07.426>one <00:00:07.581>hour <00:00:07.737>with <00:00:07.892>a <00:00:08.048>love <00:00:08.203>letter <00:00:08.359>to <00:00:08.515>Rust.

4
00:00:11.165 --> 00:00:12.775
<00:00:11.165>This <00:00:11.444>is <00:00:11.725>what <00:00:12.004>you <00:00:12.284>can <00:00:12.565>expect.

5
00:00:12.795 --> 00:00:16.415
<00:00:12.795>You <00:00:12.922>can <00:00:13.049>expect <00:00:13.176>three <00:00:13.304>quarter <00:00:13.431>an <00:00:13.558>hour <00:00:13.685>with <00:00:13.813>a <00:00:13.940>lot <00:00:14.067>of <00:00:14.195>cold.

6
00:00:16.415 --> 00:00:18.695
<00:00:16.415>Taking <00:00:16.648>a <00:00:16.881>look <00:00:17.115>why <00:00:17.348>Rust <00:00:17.581>is <00:00:17.814>attractive,

7
00:00:19.045 --> 00:00:20.775
<00:00:19.045>this <00:00:19.395>is <00:00:19.745>exactly <00:00:20.095>the <00:00:20.445>talk.

8
00:00:20.875 --> 00:00:23.135
<00:00:20.875>If <00:00:21.030>you <00:00:21.186>are <00:00:21.341>curious <00:00:21.497>what <00:00:21.652>this <00:00:21.808>rust <00:00:21.963>is <00:00:22.119>all <00:00:22.275>about

9
00:00:23.395 --> 00:00:25.855
<00:00:23.395>and <00:00:23.628>why <00:00:23.861>so <00:00:24.095>many <00:00:24.328>people <00:00:24.561>are <00:00:24.794>eager

10
00:00:25.915 --> 00:00:27.615
<00:00:25.915>to <00:00:26.195>learn <00:00:26.474>this <00:00:26.755>new <00:00:27.035>programming <00:00:27.314>language,

11
00:00:28.475 --> 00:00:31.495
<00:00:28.475>before <00:00:28.650>I <00:00:28.825>go <00:00:29.000>into <00:00:29.175>the <00:00:29.350>topic, <00:00:29.525>I <00:00:29.700>would <00:00:29.875>like

12
00:00:31.495 --> 00:00:32.735
<00:00:31.495>to <00:00:32.052>introduce <00:00:32.610>myself.

13
00:00:32.735 --> 00:00:35.695
<00:00:32.735>For <00:00:32.842>those <00:00:32.950>of <00:00:33.058>you <00:00:33.165>who <00:00:33.273>do <00:00:33.381>not <00:00:33.488>know <00:00:33.596>me, <00:00:33.704>my <00:00:33.811>name <00:00:33.919>is <00:00:34.027>Rhino <00:00:34.135>Tropic

14
00:00:35.755 --> 00:00:39.215
<00:00:35.755>and <00:00:35.930>I'm <00:00:36.105>broadcasting <00:00:36.280>here <00:00:36.455>from <00:00:36.630>a <00:00:36.805>city <00:00:36.980>called <00:00:37.155>Leon.

15
00:00:39.405 --> 00:00:41.175
<00:00:39.405>This <00:00:39.685>is <00:00:39.965>a <00:00:40.245>city <00:00:40.525>near <00:00:40.805>Lin.

16
00:00:41.675 --> 00:00:45.455
<00:00:41.675>I'm <00:00:41.830>a <00:00:41.986>passionate <00:00:42.141>programmer <00:00:42.297>for <00:00:42.452>more <00:00:42.608>than <00:00:42.763>25 <00:00:42.919>years <00:00:43.074>now

17
00:00:46.075 --> 00:00:48.775
<00:00:46.075>I'm <00:00:46.275>also <00:00:46.475>a <00:00:46.675>Microsoft <00:00:46.875>MVP <00:00:47.075>and <00:00:47.275>regional <00:00:47.475>director,

18
00:00:48.775 --> 00:00:51.815
<00:00:48.775>but <00:00:48.902>that <00:00:49.029>does <00:00:49.156>not <00:00:49.284>mean <00:00:49.411>that <00:00:49.538>I'm <00:00:49.665>on <00:00:49.793>the <00:00:49.920>payroll <00:00:50.047>of <00:00:50.175>Microsoft,

19
00:00:51.835 --> 00:00:54.375
<00:00:51.835>but <00:00:51.975>I <00:00:52.115>do <00:00:52.255>a <00:00:52.395>lot <00:00:52.535>of <00:00:52.675>work <00:00:52.815>in <00:00:52.955>the <00:00:53.095>Microsoft <00:00:53.235>area,

20
00:00:54.505 --> 00:00:57.855
<00:00:54.505>especially <00:00:54.680>in <00:00:54.855>the <00:00:55.030>context <00:00:55.205>of <00:00:55.380>the <00:00:55.555>Microsoft <00:00:55.730>Azure <00:00:55.905>Cloud

21
00:00:59.165 --> 00:01:02.055
<00:00:59.165>Technical, <00:00:59.398>uh, <00:00:59.631>professionally <00:00:59.865>I <00:01:00.098>am <00:01:00.331>a <00:01:00.565>trainer.

22
00:01:02.535 --> 00:01:04.375
<00:01:02.535>I <00:01:02.815>am <00:01:03.095>also <00:01:03.375>a <00:01:03.654>part-time <00:01:03.934>teacher

23
00:01:04.675 --> 00:01:07.455
<00:01:04.675>and <00:01:04.830>I <00:01:04.986>am <00:01:05.141>a <00:01:05.297>mentor <00:01:05.452>at <00:01:05.608>the <00:01:05.763>local <00:01:05.919>Code <00:01:06.075>Dojo.

24
00:01:07.455 --> 00:01:10.415
<00:01:07.455>And <00:01:07.582>that <00:01:07.709>brings <00:01:07.836>me <00:01:07.964>to <00:01:08.091>the <00:01:08.218>last <00:01:08.345>thing, <00:01:08.473>which <00:01:08.600>is <00:01:08.727>really <00:01:08.855>near

25
00:01:10.475 --> 00:01:12.055
<00:01:10.475>to <00:01:10.708>my <00:01:10.941>heart, <00:01:11.175>and <00:01:11.408>that <00:01:11.641>is <00:01:11.875>community.

26
00:01:12.295 --> 00:01:13.535
<00:01:12.295>I <00:01:12.667>love <00:01:13.039>community <00:01:13.411>work.

27
00:01:13.915 --> 00:01:16.335
<00:01:13.914>I'm <00:01:14.115>the <00:01:14.315>chairman <00:01:14.514>of <00:01:14.714>the <00:01:14.914>coding <00:01:15.115>Club <00:01:15.315>links

28
00:01:16.335 --> 00:01:18.615
<00:01:16.335>and <00:01:16.568>we <00:01:16.801>run <00:01:17.035>our <00:01:17.268>local <00:01:17.501>Coda <00:01:17.735>Dojo,

29
00:01:18.615 --> 00:01:20.495
<00:01:18.615>which <00:01:18.848>is <00:01:19.081>a <00:01:19.315>programming <00:01:19.548>club <00:01:19.781>for <00:01:20.015>kids.

30
00:01:20.915 --> 00:01:23.135
<00:01:20.914>No, <00:01:21.148>we <00:01:21.381>do <00:01:21.615>not <00:01:21.848>program <00:01:22.081>rust <00:01:22.315>there.

31
00:01:23.515 --> 00:01:27.935
<00:01:23.515>My <00:01:23.642>rust <00:01:23.769>life <00:01:23.896>in <00:01:24.024>terms <00:01:24.151>of <00:01:24.278>community <00:01:24.405>is <00:01:24.533>the <00:01:24.660>Rust <00:01:24.787>Lin <00:01:24.915>meetup

32
00:01:27.935 --> 00:01:31.375
<00:01:27.935>and <00:01:28.075>you <00:01:28.215>are <00:01:28.355>very <00:01:28.495>much <00:01:28.635>invited <00:01:28.775>to <00:01:28.915>join <00:01:29.055>us <00:01:29.195>for <00:01:29.335>one

33
00:01:31.375 --> 00:01:32.495
<00:01:31.375>of <00:01:31.711>our <00:01:32.047>upcoming <00:01:32.383>meetups.

34
00:01:32.495 --> 00:01:34.095
<00:01:32.495>We <00:01:32.845>do <00:01:33.195>monthly <00:01:33.545>meetups, <00:01:33.895>uh,

35
00:01:34.095 --> 00:01:37.375
<00:01:34.095>where <00:01:34.235>you <00:01:34.375>can <00:01:34.515>hear <00:01:34.655>talks <00:01:34.795>from <00:01:34.935>speakers <00:01:35.075>all <00:01:35.215>over <00:01:35.355>the <00:01:35.495>world

36
00:01:37.475 --> 00:01:41.335
<00:01:37.475>and <00:01:37.708>exchange <00:01:37.941>your <00:01:38.175>ideas, <00:01:38.408>problem, <00:01:38.641>thoughts, <00:01:38.875>whatever

37
00:01:41.685 --> 00:01:43.855
<00:01:41.685>regarding <00:01:41.965>Rust <00:01:42.245>in <00:01:42.525>our <00:01:42.805>Discord <00:01:43.085>server.

38
00:01:45.235 --> 00:01:47.535
<00:01:45.235>Now, <00:01:45.468>what <00:01:45.701>is <00:01:45.935>my <00:01:46.168>talk <00:01:46.401>today <00:01:46.635>about?

39
00:01:47.995 --> 00:01:51.295
<00:01:47.995>You <00:01:48.135>See, <00:01:48.275>I <00:01:48.415>think <00:01:48.555>that <00:01:48.695>choosing <00:01:48.835>a <00:01:48.975>programming <00:01:49.115>language <00:01:49.255>is <00:01:49.395>a

40
00:01:51.295 --> 00:01:53.335
<00:01:51.295>little <00:01:51.575>bit <00:01:51.855>like <00:01:52.135>entering <00:01:52.415>a <00:01:52.695>relationship.

41
00:01:54.035 --> 00:01:56.735
<00:01:54.035>If <00:01:54.210>you <00:01:54.384>are <00:01:54.560>a <00:01:54.735>professional <00:01:54.910>programmer <00:01:55.085>like <00:01:55.259>I <00:01:55.435>am,

42
00:01:57.075 --> 00:02:00.335
<00:01:57.075>you <00:01:57.275>spend <00:01:57.475>a <00:01:57.675>lot <00:01:57.875>of <00:01:58.075>time, <00:01:58.275>uh, <00:01:58.475>with,

43
00:02:00.605 --> 00:02:03.535
<00:02:00.605>with <00:02:00.780>the <00:02:00.955>language <00:02:01.130>you <00:02:01.305>spent, <00:02:01.480>uh, <00:02:01.655>this, <00:02:01.830>this <00:02:02.005>language,

44
00:02:03.535 --> 00:02:05.815
<00:02:03.535>this <00:02:03.735>relationship <00:02:03.935>should <00:02:04.134>be <00:02:04.335>a <00:02:04.535>kind <00:02:04.735>of <00:02:04.935>loving

45
00:02:05.955 --> 00:02:07.535
<00:02:05.955>and <00:02:06.655>caring <00:02:07.355>relationship.

46
00:02:08.485 --> 00:02:10.855
<00:02:08.485>It's <00:02:08.612>don't <00:02:08.739>get <00:02:08.866>me <00:02:08.994>wrong, <00:02:09.121>this <00:02:09.248>is <00:02:09.375>not <00:02:09.503>the <00:02:09.630>kind <00:02:09.757>of <00:02:09.885>love

47
00:02:10.855 --> 00:02:12.975
<00:02:10.854>that <00:02:11.030>I <00:02:11.204>feel <00:02:11.380>for <00:02:11.554>my <00:02:11.730>spouse <00:02:11.905>or <00:02:12.079>my <00:02:12.255>godchild,

48
00:02:12.975 --> 00:02:14.735
<00:02:12.975>but <00:02:13.174>still <00:02:13.375>it <00:02:13.575>is <00:02:13.775>a <00:02:13.975>kind <00:02:14.174>of <00:02:14.375>love.

49
00:02:14.895 --> 00:02:16.655
<00:02:14.895>I <00:02:15.128>have <00:02:15.361>to <00:02:15.595>be <00:02:15.828>passionate <00:02:16.061>about <00:02:16.295>the

50
00:02:16.655 --> 00:02:18.295
<00:02:16.655>programming <00:02:16.935>language <00:02:17.215>that <00:02:17.495>I <00:02:17.775>work <00:02:18.055>with.

51
00:02:19.295 --> 00:02:22.535
<00:02:19.295>I <00:02:19.495>personally <00:02:19.695>learned <00:02:19.895>coding <00:02:20.095>in <00:02:20.295>the <00:02:20.495>early <00:02:20.695>nineties

52
00:02:22.605 --> 00:02:27.255
<00:02:22.605>with <00:02:22.732>Pascal, <00:02:22.859>then <00:02:22.986>I <00:02:23.114>switched <00:02:23.241>to <00:02:23.368>c <00:02:23.495>and <00:02:23.623>c <00:02:23.750>plus <00:02:23.877>plus <00:02:24.005>and

53
00:02:27.255 --> 00:02:29.135
<00:02:27.255>after <00:02:27.605>that <00:02:27.954>I <00:02:28.305>switched <00:02:28.655>to.net

54
00:02:29.315 --> 00:02:32.535
<00:02:29.315>and <00:02:29.515>came <00:02:29.715>across <00:02:29.915>languages <00:02:30.115>like <00:02:30.315>TypeScript <00:02:30.515>and <00:02:30.715>go.

55
00:02:33.275 --> 00:02:36.575
<00:02:33.275>And <00:02:33.402>for <00:02:33.529>me, <00:02:33.656>a <00:02:33.784>few <00:02:33.911>months, <00:02:34.038>uh, <00:02:34.165>more <00:02:34.293>than <00:02:34.420>a <00:02:34.547>year <00:02:34.675>ago,

56
00:02:36.575 --> 00:02:37.975
<00:02:36.575>two <00:02:36.995>years <00:02:37.415>approximately <00:02:37.834>ago,

57
00:02:38.415 --> 00:02:41.055
<00:02:38.415>I <00:02:38.614>became <00:02:38.815>curious <00:02:39.015>about <00:02:39.215>this <00:02:39.415>thing <00:02:39.614>called <00:02:39.815>Rust

58
00:02:41.275 --> 00:02:43.735
<00:02:41.275>and <00:02:41.430>I <00:02:41.586>kind <00:02:41.741>of <00:02:41.897>fell <00:02:42.052>in <00:02:42.208>love <00:02:42.363>with <00:02:42.519>the <00:02:42.675>language

59
00:02:44.195 --> 00:02:47.375
<00:02:44.195>and <00:02:44.311>I <00:02:44.428>would <00:02:44.545>like <00:02:44.661>to <00:02:44.778>share <00:02:44.894>in <00:02:45.011>this <00:02:45.128>talk <00:02:45.245>some <00:02:45.361>reasons <00:02:45.478>why <00:02:45.595>I'm

60
00:02:47.375 --> 00:02:50.335
<00:02:47.375>so <00:02:47.530>excited <00:02:47.686>about <00:02:47.841>Rust <00:02:47.997>and <00:02:48.152>what <00:02:48.308>I <00:02:48.463>love <00:02:48.619>about <00:02:48.775>Rust.

61
00:02:52.675 --> 00:02:54.655
<00:02:52.675>The <00:02:52.955>first <00:02:53.235>question <00:02:53.515>that <00:02:53.795>we <00:02:54.075>have

62
00:02:54.655 --> 00:02:58.055
<00:02:54.655>to <00:02:54.830>speak <00:02:55.005>about <00:02:55.180>is <00:02:55.355>why <00:02:55.530>is <00:02:55.705>Rust <00:02:55.880>so <00:02:56.055>attractive

63
00:02:58.315 --> 00:02:59.405
<00:02:58.315>for <00:02:58.805>many <00:02:59.296>developers?

64
00:03:00.175 --> 00:03:02.125
<00:03:00.175>Think <00:03:00.455>about <00:03:00.735>how <00:03:01.015>a <00:03:01.295>relationship <00:03:01.575>starts.

65
00:03:02.385 --> 00:03:04.805
<00:03:02.385>You <00:03:02.618>meet <00:03:02.851>someone <00:03:03.084>and <00:03:03.318>you <00:03:03.551>feel <00:03:03.785>attraction.

66
00:03:04.975 --> 00:03:07.245
<00:03:04.975>Again, <00:03:05.255>it's <00:03:05.535>similar <00:03:05.815>with <00:03:06.095>programming <00:03:06.375>languages.

67
00:03:07.245 --> 00:03:09.525
<00:03:07.245>If <00:03:07.400>you <00:03:07.556>are <00:03:07.711>new <00:03:07.867>to <00:03:08.022>Rust, <00:03:08.178>you <00:03:08.333>might <00:03:08.489>ask <00:03:08.645>yourself,

68
00:03:10.665 --> 00:03:13.925
<00:03:10.665>why <00:03:10.804>should <00:03:10.945>I, <00:03:11.084>why <00:03:11.225>should <00:03:11.364>I, <00:03:11.505>why <00:03:11.644>should <00:03:11.785>I <00:03:11.924>invest <00:03:12.065>time?

69
00:03:13.945 --> 00:03:16.365
<00:03:13.945>Why <00:03:14.120>should <00:03:14.295>I <00:03:14.470>invest <00:03:14.644>money <00:03:14.820>for, <00:03:14.995>for <00:03:15.170>books, <00:03:15.345>maybe

70
00:03:16.365 --> 00:03:18.045
<00:03:16.365>for <00:03:16.645>trainings <00:03:16.925>and <00:03:17.205>things <00:03:17.485>like <00:03:17.765>that?

71
00:03:18.355 --> 00:03:21.405
<00:03:18.355>Does <00:03:18.494>it <00:03:18.635>have <00:03:18.774>a <00:03:18.915>future? <00:03:19.054>Before <00:03:19.195>we <00:03:19.334>go <00:03:19.475>into <00:03:19.614>the <00:03:19.755>technical

72
00:03:21.405 --> 00:03:24.445
<00:03:21.405>details, <00:03:21.580>let's <00:03:21.755>discuss <00:03:21.930>this <00:03:22.105>question <00:03:22.280>for <00:03:22.455>a <00:03:22.630>few <00:03:22.805>minutes.

73
00:03:26.625 --> 00:03:28.925
<00:03:26.625>The <00:03:26.780>first <00:03:26.936>thing <00:03:27.091>that <00:03:27.247>I <00:03:27.402>would <00:03:27.558>like <00:03:27.713>to <00:03:27.869>mention <00:03:28.025>is

74
00:03:29.755 --> 00:03:32.685
<00:03:29.755>Rust <00:03:29.954>is <00:03:30.155>very <00:03:30.355>much <00:03:30.555>appreciated <00:03:30.755>by <00:03:30.954>the <00:03:31.155>community.

75
00:03:33.105 --> 00:03:34.245
<00:03:33.105>You <00:03:33.447>are <00:03:33.789>probably <00:03:34.131>familiar

76
00:03:34.315 --> 00:03:36.965
<00:03:34.315>with <00:03:34.595>the <00:03:34.875>Stack <00:03:35.155>Overflow <00:03:35.435>developer <00:03:35.715>survey,

77
00:03:37.055 --> 00:03:38.685
<00:03:37.055>which <00:03:37.405>comes <00:03:37.755>out <00:03:38.105>every <00:03:38.455>year

78
00:03:39.425 --> 00:03:42.965
<00:03:39.425>and <00:03:39.625>in <00:03:39.825>a <00:03:40.025>row <00:03:40.225>from <00:03:40.425>2016 <00:03:40.625>to <00:03:40.825>2020.

79
00:03:44.235 --> 00:03:47.885
<00:03:44.235>Rust <00:03:44.468>has <00:03:44.701>been <00:03:44.935>the <00:03:45.168>most <00:03:45.401>loved <00:03:45.635>technology

80
00:03:48.425 --> 00:03:50.685
<00:03:48.425>in <00:03:48.658>all <00:03:48.891>the <00:03:49.125>Stack <00:03:49.358>Overflow <00:03:49.591>developer <00:03:49.825>surveys.

81
00:03:51.455 --> 00:03:53.475
<00:03:51.454>If <00:03:51.610>you <00:03:51.766>take <00:03:51.921>a <00:03:52.077>look <00:03:52.232>at <00:03:52.388>web <00:03:52.543>assembly, <00:03:52.699>web <00:03:52.855>assembly

82
00:03:53.495 --> 00:03:57.355
<00:03:53.495>and <00:03:53.650>technology, <00:03:53.806>which <00:03:53.961>really <00:03:54.117>is <00:03:54.272>very <00:03:54.428>exciting <00:03:54.583>in <00:03:54.739>the <00:03:54.895>world

83
00:03:57.355 --> 00:04:00.915
<00:03:57.355>of <00:03:57.554>cloud <00:03:57.755>computing, <00:03:57.954>uh, <00:03:58.155>web <00:03:58.355>development, <00:03:58.554>mobile <00:03:58.755>development,

84
00:04:01.225 --> 00:04:05.475
<00:04:01.225>then <00:04:01.352>Rust <00:04:01.479>is <00:04:01.606>here <00:04:01.734>really <00:04:01.861>leading <00:04:01.988>the <00:04:02.115>pack <00:04:02.243>20 <00:04:02.370>at <00:04:02.497>Rust <00:04:02.625>at

85
00:04:05.475 --> 00:04:08.675
<00:04:05.475>26% <00:04:05.674>is <00:04:05.875>the <00:04:06.075>most <00:04:06.275>frequently <00:04:06.475>used <00:04:06.674>language <00:04:06.875>when

86
00:04:08.675 --> 00:04:09.795
<00:04:08.675>you <00:04:09.011>develop <00:04:09.347>web <00:04:09.683>assembly.

87
00:04:09.795 --> 00:04:12.555
<00:04:09.795>According <00:04:09.970>to <00:04:10.144>the <00:04:10.320>web <00:04:10.494>state <00:04:10.670>of <00:04:10.845>web <00:04:11.019>assembly <00:04:11.195>survey,

88
00:04:12.565 --> 00:04:17.065
<00:04:12.565>which <00:04:12.765>came <00:04:12.965>out <00:04:13.165>recently <00:04:13.365>very <00:04:13.565>interesting <00:04:13.765>is <00:04:13.965>also

89
00:04:17.065 --> 00:04:21.825
<00:04:17.065>that <00:04:17.240>the <00:04:17.415>Linux <00:04:17.589>community <00:04:17.765>is <00:04:17.940>considering <00:04:18.115>to <00:04:18.290>introduce <00:04:18.464>Rust

90
00:04:22.445 --> 00:04:25.825
<00:04:22.445>as <00:04:22.620>a <00:04:22.795>new <00:04:22.969>first <00:04:23.145>class <00:04:23.320>language <00:04:23.495>in <00:04:23.670>the <00:04:23.844>kernel.

91
00:04:26.595 --> 00:04:28.665
<00:04:26.595>Let's <00:04:26.770>dive <00:04:26.945>a <00:04:27.120>little <00:04:27.295>bit <00:04:27.470>deeper <00:04:27.645>into <00:04:27.820>that <00:04:27.995>one.

92
00:04:30.025 --> 00:04:33.605
<00:04:30.025>Why <00:04:30.258>did <00:04:30.491>the <00:04:30.724>community, <00:04:30.958>uh, <00:04:31.191>suggest <00:04:31.424>Rust

93
00:04:33.945 --> 00:04:35.885
<00:04:33.945>as <00:04:34.145>a <00:04:34.344>main <00:04:34.545>language <00:04:34.745>In <00:04:34.945>the <00:04:35.145>Linux <00:04:35.344>kernel,

94
00:04:36.675 --> 00:04:39.885
<00:04:36.675>they <00:04:36.908>emphasize <00:04:37.141>especially <00:04:37.375>things <00:04:37.608>like <00:04:37.841>memory <00:04:38.075>safety

95
00:04:39.985 --> 00:04:41.525
<00:04:39.985>and <00:04:40.331>absence <00:04:40.678>of <00:04:41.024>data <00:04:41.371>races.

96
00:04:42.515 --> 00:04:45.885
<00:04:42.515>They <00:04:42.670>think <00:04:42.826>that <00:04:42.981>Rust <00:04:43.137>offers <00:04:43.292>a <00:04:43.448>very <00:04:43.603>strict <00:04:43.759>type <00:04:43.914>system,

97
00:04:46.135 --> 00:04:48.205
<00:04:46.135>which <00:04:46.601>offers <00:04:47.068>rich <00:04:47.534>abstractions

98
00:04:48.505 --> 00:04:50.605
<00:04:48.505>and <00:04:48.705>lead <00:04:48.905>to <00:04:49.105>a <00:04:49.305>reduction <00:04:49.505>of <00:04:49.705>logic <00:04:49.905>errors.

99
00:04:51.915 --> 00:04:55.525
<00:04:51.915>They <00:04:52.090>find <00:04:52.265>it <00:04:52.440>really <00:04:52.615>good <00:04:52.790>for <00:04:52.965>system <00:04:53.140>level <00:04:53.315>programming

100
00:04:55.525 --> 00:04:57.605
<00:04:55.525>that <00:04:55.758>Rust <00:04:55.991>has <00:04:56.224>such <00:04:56.458>a <00:04:56.691>clear <00:04:56.924>distinction

101
00:04:57.635 --> 00:04:59.405
<00:04:57.635>between <00:04:57.985>save <00:04:58.335>and <00:04:58.685>unsafe <00:04:59.034>code.

102
00:05:00.315 --> 00:05:02.285
<00:05:00.315>Rust <00:05:00.781>cons, <00:05:01.248>uh, <00:05:01.715>according

103
00:05:02.285 --> 00:05:04.405
<00:05:02.285>to <00:05:02.518>them <00:05:02.751>is <00:05:02.985>a <00:05:03.218>very <00:05:03.451>featureful <00:05:03.685>language

104
00:05:04.405 --> 00:05:06.685
<00:05:04.405>and <00:05:04.560>we'll <00:05:04.716>see <00:05:04.871>more <00:05:05.027>about <00:05:05.182>that <00:05:05.338>in <00:05:05.493>the <00:05:05.649>upcoming <00:05:05.804>minutes.

105
00:05:07.715 --> 00:05:11.525
<00:05:07.715>Rush <00:05:07.870>Rust <00:05:08.026>has <00:05:08.181>a <00:05:08.337>powerful <00:05:08.492>standard <00:05:08.648>library <00:05:08.803>which <00:05:08.959>you <00:05:09.114>can

106
00:05:11.585 --> 00:05:12.885
<00:05:11.585>use <00:05:11.974>or <00:05:12.365>not <00:05:12.755>use.

107
00:05:12.905 --> 00:05:14.125
<00:05:12.905>If <00:05:13.124>you <00:05:13.344>are <00:05:13.563>doing, <00:05:13.783>for <00:05:14.003>instance,

108
00:05:14.195 --> 00:05:17.565
<00:05:14.195>very <00:05:14.370>low <00:05:14.545>level <00:05:14.719>system <00:05:14.895>development, <00:05:15.070>the <00:05:15.245>tooling <00:05:15.420>is <00:05:15.594>great.

109
00:05:18.205 --> 00:05:20.005
<00:05:18.205>Consider <00:05:18.484>Wish <00:05:18.765>Studio <00:05:19.044>Code <00:05:19.325>for <00:05:19.604>instance.

110
00:05:20.005 --> 00:05:21.645
<00:05:20.005>There <00:05:20.471>are <00:05:20.938>awesome <00:05:21.405>plugins

111
00:05:21.645 --> 00:05:25.605
<00:05:21.645>for <00:05:21.784>Wish <00:05:21.924>Studio <00:05:22.065>ca <00:05:22.205>code <00:05:22.344>which <00:05:22.484>make <00:05:22.625>programming <00:05:22.765>Rust <00:05:22.905>a <00:05:23.044>a

112
00:05:25.615 --> 00:05:28.685
<00:05:25.615>blast <00:05:25.965>and <00:05:26.315>Overall <00:05:26.665>Rust <00:05:27.015>has,

113
00:05:29.105 --> 00:05:33.245
<00:05:29.105>has <00:05:29.305>leveraged <00:05:29.505>all <00:05:29.705>the <00:05:29.905>experience <00:05:30.105>of <00:05:30.305>systems <00:05:30.505>programming

114
00:05:33.465 --> 00:05:36.805
<00:05:33.465>and <00:05:33.592>makes <00:05:33.719>it <00:05:33.846>even <00:05:33.974>better, <00:05:34.101>better <00:05:34.228>than <00:05:34.355>what <00:05:34.483>you <00:05:34.610>can <00:05:34.737>do <00:05:34.865>today

115
00:05:36.805 --> 00:05:38.045
<00:05:36.805>with <00:05:37.028>c <00:05:37.251>and <00:05:37.474>c <00:05:37.697>plus <00:05:37.921>plus.

116
00:05:39.965 --> 00:05:43.825
<00:05:39.965>Now <00:05:40.120>what <00:05:40.276>about <00:05:40.431>the <00:05:40.587>sponsoring <00:05:40.742>a <00:05:40.898>technology? <00:05:41.053>That <00:05:41.209>is <00:05:41.365>great.

117
00:05:44.805 --> 00:05:46.055
<00:05:44.805>Okay, <00:05:45.180>it <00:05:45.555>will <00:05:45.930>also,

118
00:05:46.195 --> 00:05:49.735
<00:05:46.195>it <00:05:46.311>will <00:05:46.428>only <00:05:46.545>pay <00:05:46.661>off <00:05:46.778>if <00:05:46.895>you <00:05:47.011>invest <00:05:47.128>in <00:05:47.245>a <00:05:47.361>technology <00:05:47.478>if <00:05:47.594>it's

119
00:05:49.735 --> 00:05:52.975
<00:05:49.735>not <00:05:49.875>just <00:05:50.015>great <00:05:50.155>and <00:05:50.295>has <00:05:50.435>a <00:05:50.575>great <00:05:50.715>um, <00:05:50.855>a <00:05:50.995>great <00:05:51.135>community,

120
00:05:53.315 --> 00:05:56.375
<00:05:53.315>but <00:05:53.455>it <00:05:53.594>also <00:05:53.735>has <00:05:53.875>to <00:05:54.015>have <00:05:54.155>sponsoring <00:05:54.295>to <00:05:54.435>answer <00:05:54.575>the <00:05:54.715>question,

121
00:05:56.485 --> 00:05:58.085
<00:05:56.485>will <00:05:56.685>it <00:05:56.885>be <00:05:57.085>there <00:05:57.285>in <00:05:57.485>a <00:05:57.685>few <00:05:57.885>years?

122
00:05:58.195 --> 00:06:01.045
<00:05:58.195>Will <00:05:58.335>it <00:05:58.474>be <00:05:58.615>worth <00:05:58.755>my <00:05:58.895>time <00:05:59.034>to <00:05:59.175>invest <00:05:59.315>some <00:05:59.455>time <00:05:59.594>here?

123
00:06:01.425 --> 00:06:03.325
<00:06:01.425>And <00:06:01.625>this <00:06:01.825>is <00:06:02.025>definitely <00:06:02.225>the <00:06:02.425>case <00:06:02.625>with <00:06:02.825>Rust.

124
00:06:03.785 --> 00:06:05.165
<00:06:03.785>If <00:06:03.992>you <00:06:04.199>take <00:06:04.406>a <00:06:04.613>look <00:06:04.820>at <00:06:05.027>some

125
00:06:05.185 --> 00:06:09.005
<00:06:05.185>of <00:06:05.301>the <00:06:05.418>big <00:06:05.535>ones <00:06:05.651>in <00:06:05.768>current <00:06:05.885>IT <00:06:06.001>industry, <00:06:06.118>then <00:06:06.235>take <00:06:06.351>a <00:06:06.468>look <00:06:06.585>at

126
00:06:09.005 --> 00:06:10.005
<00:06:09.005>what <00:06:09.455>Microsoft <00:06:09.905>says.

127
00:06:10.485 --> 00:06:12.525
<00:06:10.485>Microsoft <00:06:10.718>says <00:06:10.951>that <00:06:11.185>Rust <00:06:11.418>can <00:06:11.651>solve <00:06:11.885>some

128
00:06:12.525 --> 00:06:15.685
<00:06:12.525>of <00:06:12.664>the <00:06:12.804>most <00:06:12.945>waxing <00:06:13.085>issues <00:06:13.224>that <00:06:13.364>plague <00:06:13.505>c <00:06:13.645>plus <00:06:13.784>plus <00:06:13.924>projects.

129
00:06:16.025 --> 00:06:18.725
<00:06:16.025>Or <00:06:16.180>if <00:06:16.336>you <00:06:16.491>take <00:06:16.647>a <00:06:16.802>look <00:06:16.958>at <00:06:17.113>Google <00:06:17.269>Security <00:06:17.424>block,

130
00:06:19.035 --> 00:06:22.285
<00:06:19.035>they <00:06:19.235>are <00:06:19.435>praising <00:06:19.635>rust <00:06:19.835>for <00:06:20.035>its <00:06:20.235>safety <00:06:20.435>guarantees

131
00:06:22.905 --> 00:06:26.165
<00:06:22.905>at <00:06:23.104>the <00:06:23.304>same <00:06:23.505>time <00:06:23.705>while <00:06:23.905>offering <00:06:24.104>equivalent <00:06:24.304>performance

132
00:06:26.165 --> 00:06:27.445
<00:06:26.165>to <00:06:26.395>c <00:06:26.625>and <00:06:26.856>c <00:06:27.086>plus <00:06:27.317>plus.

133
00:06:28.235 --> 00:06:29.725
<00:06:28.235>Take <00:06:28.458>a <00:06:28.682>look <00:06:28.905>at <00:06:29.129>what <00:06:29.352>Facebook <00:06:29.576>says.

134
00:06:29.725 --> 00:06:33.005
<00:06:29.725>For <00:06:29.900>instance, <00:06:30.075>they <00:06:30.250>say <00:06:30.425>that <00:06:30.600>Rust <00:06:30.775>offers <00:06:30.950>the <00:06:31.125>performance

135
00:06:33.385 --> 00:06:36.405
<00:06:33.385>of <00:06:33.560>c <00:06:33.735>plus <00:06:33.909>plus <00:06:34.085>while <00:06:34.260>having <00:06:34.435>a <00:06:34.610>heavy <00:06:34.784>focus

136
00:06:36.495 --> 00:06:37.605
<00:06:36.495>again <00:06:36.828>on <00:06:37.161>code <00:06:37.494>safety.

137
00:06:38.085 --> 00:06:41.165
<00:06:38.085>Hundreds <00:06:38.284>of <00:06:38.484>developers <00:06:38.685>at <00:06:38.885>Facebook <00:06:39.085>are <00:06:39.284>currently <00:06:39.484>writing

138
00:06:41.245 --> 00:06:42.965
<00:06:41.245>millions <00:06:41.595>of <00:06:41.945>lines <00:06:42.295>of <00:06:42.645>rust.

139
00:06:43.545 --> 00:06:46.605
<00:06:43.545>So <00:06:43.720>Rust <00:06:43.895>is <00:06:44.070>definitely <00:06:44.245>in <00:06:44.420>the <00:06:44.595>middle <00:06:44.770>of <00:06:44.945>the

140
00:06:46.665 --> 00:06:48.165
<00:06:46.665>of <00:06:47.002>the <00:06:47.340>core <00:06:47.677>cloud <00:06:48.015>business.

141
00:06:48.305 --> 00:06:49.365
<00:06:48.305>Uh, <00:06:48.543>in <00:06:48.782>the <00:06:49.020>IT <00:06:49.259>world.

142
00:06:51.145 --> 00:06:55.035
<00:06:51.145>Rust <00:06:51.320>has <00:06:51.495>organized <00:06:51.669>itself <00:06:51.844>currently <00:06:52.020>in <00:06:52.195>the <00:06:52.370>Rust <00:06:52.544>Foundation.

143
00:06:55.175 --> 00:06:57.995
<00:06:55.175>The <00:06:55.375>Rust <00:06:55.575>Foundation <00:06:55.775>is <00:06:55.975>an <00:06:56.175>independent <00:06:56.375>nonprofit <00:06:56.575>organization

144
00:06:58.605 --> 00:07:00.235
<00:06:58.605>which <00:06:58.885>leads <00:06:59.165>and <00:06:59.445>skews <00:06:59.725>the <00:07:00.005>Rust

145
00:07:00.235 --> 00:07:01.955
<00:07:00.235>programming <00:07:00.935>language <00:07:01.635>ecosystem.

146
00:07:02.255 --> 00:07:04.435
<00:07:02.255>And <00:07:02.395>if <00:07:02.534>you <00:07:02.675>take <00:07:02.815>a <00:07:02.955>look <00:07:03.094>at <00:07:03.235>the <00:07:03.375>members, <00:07:03.515>you <00:07:03.655>see

147
00:07:04.435 --> 00:07:07.235
<00:07:04.435>that <00:07:04.610>all <00:07:04.785>the <00:07:04.960>big <00:07:05.135>ones <00:07:05.310>are <00:07:05.485>there <00:07:05.660>sponsoring <00:07:05.835>the

148
00:07:07.235 --> 00:07:08.275
<00:07:07.235>further <00:07:07.547>development <00:07:07.859>of <00:07:08.171>Rust.

149
00:07:08.415 --> 00:07:11.795
<00:07:08.415>So <00:07:08.555>the <00:07:08.695>future <00:07:08.835>of <00:07:08.975>Rust <00:07:09.115>is <00:07:09.255>not <00:07:09.395>only <00:07:09.535>bright <00:07:09.675>in <00:07:09.815>terms

150
00:07:11.815 --> 00:07:13.275
<00:07:11.815>of <00:07:12.253>concepts <00:07:12.691>and <00:07:13.128>ideas,

151
00:07:13.695 --> 00:07:15.955
<00:07:13.695>but <00:07:13.928>also <00:07:14.161>in <00:07:14.395>terms <00:07:14.628>of <00:07:14.861>the <00:07:15.094>possibilities

152
00:07:16.215 --> 00:07:17.995
<00:07:16.215>to <00:07:16.448>bring <00:07:16.681>this <00:07:16.914>power <00:07:17.148>to <00:07:17.381>the <00:07:17.614>street.

153
00:07:19.425 --> 00:07:22.885
<00:07:19.425>So <00:07:19.580>from <00:07:19.736>my <00:07:19.891>point <00:07:20.047>of <00:07:20.202>view, <00:07:20.358>rust <00:07:20.513>is <00:07:20.669>definitely <00:07:20.825>attractive

154
00:07:23.345 --> 00:07:25.165
<00:07:23.345>and <00:07:23.545>developers <00:07:23.745>should <00:07:23.945>take <00:07:24.145>a <00:07:24.345>look <00:07:24.545>at <00:07:24.745>it.

155
00:07:25.665 --> 00:07:27.605
<00:07:25.665>The <00:07:25.898>main <00:07:26.131>arguments <00:07:26.365>are, <00:07:26.598>as <00:07:26.831>I <00:07:27.065>mentioned,

156
00:07:27.905 --> 00:07:30.965
<00:07:27.905>safety <00:07:28.104>will <00:07:28.304>take <00:07:28.505>a <00:07:28.705>look <00:07:28.905>at <00:07:29.104>that <00:07:29.304>performance,

157
00:07:31.895 --> 00:07:35.565
<00:07:31.895>great <00:07:32.128>tooling <00:07:32.361>support <00:07:32.594>sponsoring <00:07:32.828>by <00:07:33.061>big <00:07:33.294>companies

158
00:07:35.625 --> 00:07:37.045
<00:07:35.625>and <00:07:36.051>a <00:07:36.477>great <00:07:36.903>community

159
00:07:37.265 --> 00:07:40.045
<00:07:37.265>and <00:07:37.440>a <00:07:37.615>great <00:07:37.789>open <00:07:37.965>source, <00:07:38.140>um, <00:07:38.315>uh, <00:07:38.490>track <00:07:38.664>record.

160
00:07:41.315 --> 00:07:42.975
<00:07:41.315>Now <00:07:41.548>let's <00:07:41.781>go <00:07:42.015>into <00:07:42.248>the <00:07:42.481>next <00:07:42.715>topic

161
00:07:43.235 --> 00:07:45.855
<00:07:43.235>and <00:07:43.410>take <00:07:43.585>a <00:07:43.760>look <00:07:43.935>at <00:07:44.110>the <00:07:44.285>first <00:07:44.460>technical <00:07:44.635>things.

162
00:07:46.855 --> 00:07:50.135
<00:07:46.855>I <00:07:47.010>mentioned <00:07:47.166>it <00:07:47.321>quite <00:07:47.477>a <00:07:47.632>few <00:07:47.788>times <00:07:47.943>that <00:07:48.099>Rust <00:07:48.255>offers

163
00:07:50.805 --> 00:07:52.095
<00:07:50.805>best <00:07:51.192>in <00:07:51.579>class <00:07:51.966>safety

164
00:07:52.115 --> 00:07:55.735
<00:07:52.115>and <00:07:52.315>ability <00:07:52.515>better <00:07:52.715>than <00:07:52.915>even <00:07:53.115>CC <00:07:53.315>plus <00:07:53.515>plus

165
00:07:55.875 --> 00:07:57.335
<00:07:55.875>or <00:07:56.313>some <00:07:56.751>managed <00:07:57.188>languages.

166
00:07:57.385 --> 00:07:58.655
<00:07:57.385>Let's <00:07:57.613>take <00:07:57.842>a <00:07:58.070>look <00:07:58.299>at <00:07:58.527>that

167
00:07:58.675 --> 00:08:01.375
<00:07:58.675>and <00:07:58.830>let's <00:07:58.986>take <00:07:59.141>a <00:07:59.297>look <00:07:59.452>what <00:07:59.608>Rust <00:07:59.763>can <00:07:59.919>offer <00:08:00.075>here

168
00:08:01.395 --> 00:08:03.015
<00:08:01.395>and <00:08:01.674>how <00:08:01.955>Rust <00:08:02.234>will <00:08:02.515>do <00:08:02.794>it.

169
00:08:03.915 --> 00:08:06.295
<00:08:03.915>In <00:08:04.115>this <00:08:04.315>chapter <00:08:04.515>and <00:08:04.715>in <00:08:04.915>the <00:08:05.115>upcoming <00:08:05.315>chapters,

170
00:08:06.595 --> 00:08:08.775
<00:08:06.595>you <00:08:06.795>will <00:08:06.995>see <00:08:07.195>a <00:08:07.395>lot <00:08:07.595>of <00:08:07.795>code <00:08:07.995>samples.

171
00:08:09.475 --> 00:08:12.055
<00:08:09.475>Please <00:08:09.675>don't <00:08:09.875>focus <00:08:10.075>too <00:08:10.275>much <00:08:10.475>on <00:08:10.675>the <00:08:10.875>details.

172
00:08:12.335 --> 00:08:17.255
<00:08:12.335>I <00:08:12.462>only <00:08:12.589>have <00:08:12.716>45 <00:08:12.844>minutes, <00:08:12.971>so <00:08:13.098>try <00:08:13.225>to <00:08:13.353>get <00:08:13.480>the <00:08:13.607>concept, <00:08:13.734>try

173
00:08:17.255 --> 00:08:20.255
<00:08:17.255>to <00:08:17.410>get <00:08:17.566>the <00:08:17.721>big <00:08:17.877>picture <00:08:18.032>out <00:08:18.188>of <00:08:18.343>the <00:08:18.499>uh, <00:08:18.655>out

174
00:08:20.255 --> 00:08:21.295
<00:08:20.255>of <00:08:20.567>the <00:08:20.879>code <00:08:21.191>samples.

175
00:08:21.715 --> 00:08:23.775
<00:08:21.715>If <00:08:21.890>you <00:08:22.065>want <00:08:22.239>to <00:08:22.414>know <00:08:22.590>really <00:08:22.765>more <00:08:22.940>about <00:08:23.114>it,

176
00:08:24.215 --> 00:08:26.295
<00:08:24.215>I <00:08:24.414>share <00:08:24.614>my <00:08:24.815>slide <00:08:25.015>deck <00:08:25.215>with <00:08:25.414>you <00:08:25.614>and

177
00:08:26.295 --> 00:08:30.255
<00:08:26.295>after <00:08:26.411>the <00:08:26.528>talk, <00:08:26.645>if <00:08:26.761>you <00:08:26.878>are <00:08:26.995>as <00:08:27.111>excited <00:08:27.228>about <00:08:27.345>rust <00:08:27.461>as <00:08:27.578>I <00:08:27.695>am,

178
00:08:30.275 --> 00:08:32.015
<00:08:30.275>you <00:08:30.508>can <00:08:30.741>dive <00:08:30.974>into <00:08:31.208>the <00:08:31.441>code <00:08:31.674>snippet

179
00:08:32.115 --> 00:08:33.415
<00:08:32.115>and <00:08:32.309>take <00:08:32.505>a <00:08:32.700>look <00:08:32.895>at <00:08:33.089>the <00:08:33.284>details.

180
00:08:35.895 --> 00:08:38.395
<00:08:35.895>Before <00:08:36.095>we <00:08:36.294>take <00:08:36.495>a <00:08:36.694>look <00:08:36.895>at <00:08:37.095>Rusts <00:08:37.294>solution

181
00:08:38.495 --> 00:08:39.515
<00:08:38.495>to <00:08:38.801>the <00:08:39.107>safety <00:08:39.413>problem,

182
00:08:39.605 --> 00:08:41.355
<00:08:39.605>let's <00:08:39.805>take <00:08:40.005>a <00:08:40.205>look <00:08:40.405>at <00:08:40.605>the <00:08:40.805>basic <00:08:41.005>problem.

183
00:08:42.795 --> 00:08:44.275
<00:08:42.794>Consider <00:08:43.238>this <00:08:43.683>code <00:08:44.126>sample.

184
00:08:44.975 --> 00:08:49.755
<00:08:44.975>It <00:08:45.102>is <00:08:45.229>in <00:08:45.356>C <00:08:45.484>you <00:08:45.611>have <00:08:45.738>a <00:08:45.865>main <00:08:45.993>method <00:08:46.120>which <00:08:46.247>calls <00:08:46.375>the

185
00:08:49.815 --> 00:08:51.995
<00:08:49.815>get <00:08:50.165>and <00:08:50.515>process <00:08:50.865>data <00:08:51.215>method,

186
00:08:52.605 --> 00:08:54.795
<00:08:52.605>which <00:08:52.805>in <00:08:53.005>turn <00:08:53.205>calls <00:08:53.405>the <00:08:53.605>get <00:08:53.805>data <00:08:54.005>method.

187
00:08:55.025 --> 00:08:56.605
<00:08:55.025>And <00:08:55.258>there <00:08:55.491>we <00:08:55.725>have <00:08:55.958>a <00:08:56.191>big <00:08:56.425>problem

188
00:08:56.995 --> 00:09:00.765
<00:08:56.995>because <00:08:57.195>inside <00:08:57.395>the <00:08:57.595>GETT <00:08:57.795>data <00:08:57.995>method, <00:08:58.195>a <00:08:58.395>memory

189
00:09:01.325 --> 00:09:04.325
<00:09:01.325>allocation <00:09:01.500>takes <00:09:01.675>place <00:09:01.850>and <00:09:02.025>if <00:09:02.200>you <00:09:02.375>take <00:09:02.550>a <00:09:02.725>look,

190
00:09:04.825 --> 00:09:06.885
<00:09:04.825>the <00:09:05.058>memory <00:09:05.291>is <00:09:05.525>returned <00:09:05.758>from <00:09:05.991>get <00:09:06.225>data

191
00:09:06.985 --> 00:09:09.685
<00:09:06.985>and <00:09:07.160>is <00:09:07.335>never <00:09:07.510>freed <00:09:07.685>inside <00:09:07.860>of <00:09:08.035>GAAN <00:09:08.210>process <00:09:08.385>data.

192
00:09:09.825 --> 00:09:12.285
<00:09:09.825>So <00:09:09.965>we <00:09:10.105>have <00:09:10.245>the <00:09:10.385>problem <00:09:10.525>that <00:09:10.665>we <00:09:10.805>have <00:09:10.945>a <00:09:11.085>memory <00:09:11.225>leak.

193
00:09:12.285 --> 00:09:15.245
<00:09:12.285>It's <00:09:12.564>not <00:09:12.844>clear <00:09:13.125>who <00:09:13.405>is <00:09:13.685>responsible

194
00:09:15.425 --> 00:09:17.125
<00:09:15.425>for <00:09:15.775>freeing <00:09:16.125>the <00:09:16.474>allocated <00:09:16.824>memory.

195
00:09:18.035 --> 00:09:20.365
<00:09:18.035>This <00:09:18.385>is <00:09:18.735>a <00:09:19.084>well-known <00:09:19.435>vulnerability

196
00:09:20.785 --> 00:09:23.645
<00:09:20.785>and <00:09:20.940>I <00:09:21.096>have <00:09:21.251>copied <00:09:21.407>this <00:09:21.562>code <00:09:21.718>into <00:09:21.873>a <00:09:22.029>public <00:09:22.185>rapport

197
00:09:23.785 --> 00:09:25.445
<00:09:23.785>so <00:09:23.985>you <00:09:24.185>can <00:09:24.385>try <00:09:24.584>it <00:09:24.785>on <00:09:24.985>your <00:09:25.185>own.

198
00:09:26.345 --> 00:09:29.445
<00:09:26.345>Of <00:09:26.500>course, <00:09:26.656>I <00:09:26.811>know <00:09:26.967>that <00:09:27.122>modern <00:09:27.278>c <00:09:27.433>plus <00:09:27.589>plus <00:09:27.745>would

199
00:09:29.535 --> 00:09:30.685
<00:09:29.535>never <00:09:29.880>work <00:09:30.224>like <00:09:30.569>that.

200
00:09:30.695 --> 00:09:33.045
<00:09:30.695>There <00:09:30.928>are <00:09:31.161>a <00:09:31.395>lot <00:09:31.628>of <00:09:31.861>a <00:09:32.095>lot

201
00:09:33.045 --> 00:09:37.405
<00:09:33.045>of <00:09:33.185>mechanisms <00:09:33.324>in <00:09:33.464>modern <00:09:33.604>c <00:09:33.745>plus <00:09:33.885>plus <00:09:34.025>which <00:09:34.165>would <00:09:34.305>make <00:09:34.444>memory,

202
00:09:37.825 --> 00:09:40.085
<00:09:37.825>uh, <00:09:38.058>memory <00:09:38.291>handling <00:09:38.525>a <00:09:38.758>lot <00:09:38.991>more <00:09:39.225>safe.

203
00:09:40.345 --> 00:09:44.365
<00:09:40.345>But <00:09:40.500>for <00:09:40.656>the <00:09:40.811>sake <00:09:40.967>of <00:09:41.122>this <00:09:41.278>demo, <00:09:41.433>I <00:09:41.589>guarantee <00:09:41.745>you

204
00:09:44.595 --> 00:09:47.085
<00:09:44.595>that <00:09:44.795>code <00:09:44.995>like <00:09:45.195>that <00:09:45.395>still <00:09:45.595>exists <00:09:45.795>out <00:09:45.995>there.

205
00:09:47.105 --> 00:09:49.165
<00:09:47.105>And <00:09:47.280>if <00:09:47.455>you <00:09:47.630>take <00:09:47.805>a <00:09:47.980>look <00:09:48.155>at <00:09:48.330>public <00:09:48.505>studies

206
00:09:49.545 --> 00:09:53.765
<00:09:49.545>for <00:09:49.719>instance <00:09:49.895>from <00:09:50.069>Microsoft, <00:09:50.245>they <00:09:50.420>show <00:09:50.594>that <00:09:50.770>for <00:09:50.944>years

207
00:09:53.865 --> 00:09:55.525
<00:09:53.865>and <00:09:54.145>years <00:09:54.425>and <00:09:54.705>years <00:09:54.985>a <00:09:55.265>lot

208
00:09:55.525 --> 00:09:58.925
<00:09:55.525>of <00:09:55.699>the <00:09:55.875>vulnerabilities <00:09:56.050>have <00:09:56.225>their <00:09:56.400>roots <00:09:56.574>in <00:09:56.750>memory <00:09:56.925>problems

209
00:09:59.195 --> 00:10:00.285
<00:09:59.195>exactly <00:09:59.685>like <00:10:00.175>that.

210
00:10:01.495 --> 00:10:03.115
<00:10:01.495>So <00:10:01.775>this <00:10:02.055>is <00:10:02.335>definitely <00:10:02.615>a <00:10:02.895>problem.

211
00:10:03.745 --> 00:10:06.515
<00:10:03.745>Another <00:10:03.920>problem <00:10:04.095>is <00:10:04.270>the <00:10:04.445>use <00:10:04.620>of <00:10:04.795>the <00:10:04.970>free <00:10:05.145>problem.

212
00:10:06.645 --> 00:10:10.355
<00:10:06.645>Again, <00:10:06.800>you <00:10:06.956>see <00:10:07.111>a <00:10:07.267>small <00:10:07.422>code <00:10:07.578>sample <00:10:07.733>here <00:10:07.889>in <00:10:08.045>C

213
00:10:10.815 --> 00:10:13.355
<00:10:10.815>and <00:10:10.955>in <00:10:11.095>this <00:10:11.235>example <00:10:11.375>we <00:10:11.515>have <00:10:11.655>the <00:10:11.795>problem <00:10:11.935>that <00:10:12.075>in <00:10:12.215>case

214
00:10:13.355 --> 00:10:17.475
<00:10:13.355>of <00:10:13.555>an <00:10:13.755>error <00:10:13.955>memory <00:10:14.155>is <00:10:14.355>deallocated, <00:10:14.555>it's <00:10:14.755>freed,

215
00:10:17.895 --> 00:10:20.275
<00:10:17.895>but <00:10:18.095>unfortunately <00:10:18.295>also <00:10:18.495>in <00:10:18.694>case <00:10:18.895>of <00:10:19.095>an <00:10:19.295>error,

216
00:10:20.735 --> 00:10:23.555
<00:10:20.735>the <00:10:20.910>memory <00:10:21.085>is <00:10:21.260>used <00:10:21.435>after <00:10:21.610>it <00:10:21.785>has <00:10:21.960>been <00:10:22.135>freed.

217
00:10:23.825 --> 00:10:26.355
<00:10:23.825>That <00:10:24.025>is <00:10:24.225>also <00:10:24.425>a <00:10:24.625>very <00:10:24.825>well <00:10:25.025>known <00:10:25.225>vulnerability

218
00:10:26.735 --> 00:10:29.275
<00:10:26.735>and <00:10:27.015>it <00:10:27.295>commonly <00:10:27.575>presents <00:10:27.855>a <00:10:28.135>problem

219
00:10:29.535 --> 00:10:31.595
<00:10:29.535>to <00:10:29.768>older <00:10:30.001>source <00:10:30.235>co <00:10:30.468>source <00:10:30.701>code <00:10:30.935>bases.

220
00:10:33.835 --> 00:10:37.655
<00:10:33.835>If <00:10:33.990>you <00:10:34.146>think <00:10:34.301>that <00:10:34.457>those <00:10:34.612>problems <00:10:34.768>like <00:10:34.923>use <00:10:35.079>after <00:10:35.235>free

221
00:10:37.715 --> 00:10:41.335
<00:10:37.715>and <00:10:37.870>things <00:10:38.026>like <00:10:38.181>that <00:10:38.337>are <00:10:38.492>just <00:10:38.648>present <00:10:38.803>in <00:10:38.959>unmanaged <00:10:39.115>languages

222
00:10:41.335 --> 00:10:44.535
<00:10:41.335>like <00:10:41.490>CNC <00:10:41.646>plus <00:10:41.801>plus, <00:10:41.957>then <00:10:42.112>you <00:10:42.268>are <00:10:42.423>not <00:10:42.579>completely <00:10:42.735>right.

223
00:10:45.045 --> 00:10:48.895
<00:10:45.045>This <00:10:45.200>example <00:10:45.356>is <00:10:45.511>a <00:10:45.667>managed <00:10:45.822>language <00:10:45.978>with <00:10:46.133>a <00:10:46.289>garbage <00:10:46.444>collector.

224
00:10:48.895 --> 00:10:50.095
<00:10:48.895>It's <00:10:49.165>written <00:10:49.435>in <00:10:49.705>C <00:10:49.975>sharp

225
00:10:50.595 --> 00:10:54.335
<00:10:50.595>and <00:10:50.735>in <00:10:50.875>C <00:10:51.015>sharp <00:10:51.155>you <00:10:51.295>have <00:10:51.435>the <00:10:51.575>concept <00:10:51.715>of <00:10:51.855>disposing <00:10:51.995>objects

226
00:10:54.335 --> 00:10:55.695
<00:10:54.335>that <00:10:54.641>you <00:10:54.947>no <00:10:55.253>longer <00:10:55.559>need.

227
00:10:55.965 --> 00:10:59.015
<00:10:55.965>That <00:10:56.245>means <00:10:56.525>you <00:10:56.805>explicitly <00:10:57.085>free <00:10:57.365>memory

228
00:10:59.555 --> 00:11:01.815
<00:10:59.555>or <00:10:59.905>free <00:11:00.255>dependencies <00:11:00.604>to <00:11:00.954>memory

229
00:11:02.195 --> 00:11:04.775
<00:11:02.195>and <00:11:02.395>you <00:11:02.595>can <00:11:02.795>write <00:11:02.995>very <00:11:03.195>similar <00:11:03.395>codes <00:11:03.595>to

230
00:11:04.775 --> 00:11:06.735
<00:11:04.775>what <00:11:05.008>we <00:11:05.241>have <00:11:05.475>seen <00:11:05.708>in <00:11:05.941>C <00:11:06.175>before.

231
00:11:07.155 --> 00:11:09.895
<00:11:07.155>So <00:11:07.329>I <00:11:07.505>can <00:11:07.680>dispose <00:11:07.855>an <00:11:08.030>object <00:11:08.204>in <00:11:08.380>this <00:11:08.555>case

232
00:11:10.035 --> 00:11:11.855
<00:11:10.035>for <00:11:10.268>instance <00:11:10.501>a <00:11:10.735>connection <00:11:10.968>to <00:11:11.201>a <00:11:11.435>database

233
00:11:12.115 --> 00:11:13.335
<00:11:12.115>and <00:11:12.481>use <00:11:12.847>it <00:11:13.213>afterwards.

234
00:11:13.725 --> 00:11:16.455
<00:11:13.725>This <00:11:13.925>will <00:11:14.125>not <00:11:14.325>lead <00:11:14.525>to <00:11:14.725>a <00:11:14.925>security <00:11:15.125>vulnerability,

235
00:11:16.555 --> 00:11:19.175
<00:11:16.555>but <00:11:16.710>it <00:11:16.866>will <00:11:17.021>lead <00:11:17.177>to <00:11:17.332>a, <00:11:17.488>to <00:11:17.643>a <00:11:17.799>runtime <00:11:17.954>error

236
00:11:19.395 --> 00:11:23.055
<00:11:19.395>to <00:11:19.595>your <00:11:19.795>software <00:11:19.995>crashing <00:11:20.194>to <00:11:20.395>your <00:11:20.595>customer's <00:11:20.795>complaining

237
00:11:23.155 --> 00:11:25.495
<00:11:23.155>and <00:11:23.435>that's <00:11:23.714>also <00:11:23.995>a <00:11:24.275>problem <00:11:24.555>definitely.

238
00:11:28.105 --> 00:11:29.925
<00:11:28.105>Now <00:11:28.280>let's <00:11:28.455>take <00:11:28.630>a <00:11:28.805>look <00:11:28.980>at <00:11:29.155>the <00:11:29.330>last <00:11:29.505>example

239
00:11:30.745 --> 00:11:33.205
<00:11:30.745>before <00:11:30.900>we <00:11:31.056>take <00:11:31.211>a <00:11:31.367>look <00:11:31.522>at <00:11:31.678>the <00:11:31.833>rules <00:11:31.989>of <00:11:32.145>rust

240
00:11:33.305 --> 00:11:35.685
<00:11:33.305>and <00:11:33.584>how <00:11:33.864>Rust <00:11:34.145>solves <00:11:34.425>this <00:11:34.704>problem.

241
00:11:36.725 --> 00:11:38.055
<00:11:36.725>Take <00:11:36.924>a <00:11:37.124>look <00:11:37.323>at <00:11:37.523>this <00:11:37.722>source <00:11:37.921>code.

242
00:11:38.195 --> 00:11:40.295
<00:11:38.195>In <00:11:38.395>this <00:11:38.595>case <00:11:38.795>we <00:11:38.995>have <00:11:39.195>the <00:11:39.395>following <00:11:39.595>situation.

243
00:11:40.295 --> 00:11:41.495
<00:11:40.295>We <00:11:40.564>have <00:11:40.835>a <00:11:41.105>main <00:11:41.375>method.

244
00:11:41.765 --> 00:11:45.415
<00:11:41.765>This <00:11:41.939>main <00:11:42.115>method <00:11:42.290>calls <00:11:42.465>into <00:11:42.640>a <00:11:42.814>print <00:11:42.990>value <00:11:43.165>function

245
00:11:45.635 --> 00:11:48.575
<00:11:45.635>and <00:11:45.835>this <00:11:46.035>print <00:11:46.235>value <00:11:46.435>function <00:11:46.635>receives <00:11:46.835>some <00:11:47.035>memory

246
00:11:48.755 --> 00:11:52.295
<00:11:48.755>and <00:11:48.871>it <00:11:48.988>thinks <00:11:49.105>that <00:11:49.221>it <00:11:49.338>is <00:11:49.455>the <00:11:49.571>job <00:11:49.688>of <00:11:49.805>the <00:11:49.921>print <00:11:50.038>value <00:11:50.155>method

247
00:11:52.795 --> 00:11:53.885
<00:11:52.795>to <00:11:53.122>free <00:11:53.449>this <00:11:53.776>memory.

248
00:11:53.885 --> 00:11:55.765
<00:11:53.885>Unfortunately, <00:11:54.585>the <00:11:55.285>author

249
00:11:55.785 --> 00:11:58.045
<00:11:55.785>of <00:11:55.985>the <00:11:56.185>main <00:11:56.385>method <00:11:56.584>has <00:11:56.785>the <00:11:56.985>same <00:11:57.185>idea

250
00:11:58.465 --> 00:12:00.845
<00:11:58.465>and <00:11:58.698>she's <00:11:58.931>also <00:11:59.165>cleaning <00:11:59.398>up <00:11:59.631>the <00:11:59.865>memory

251
00:12:00.905 --> 00:12:01.925
<00:12:00.905>inside <00:12:01.211>the <00:12:01.516>main <00:12:01.823>method.

252
00:12:02.225 --> 00:12:05.925
<00:12:02.225>So <00:12:02.365>this <00:12:02.505>is <00:12:02.645>a <00:12:02.785>classical <00:12:02.925>double <00:12:03.065>free <00:12:03.205>problem <00:12:03.345>which <00:12:03.485>can <00:12:03.625>lead

253
00:12:05.925 --> 00:12:08.045
<00:12:05.925>to <00:12:06.275>memory, <00:12:06.625>corruption, <00:12:06.974>crashing <00:12:07.324>software

254
00:12:08.305 --> 00:12:10.885
<00:12:08.305>and <00:12:08.538>many <00:12:08.771>other <00:12:09.005>things, <00:12:09.238>a <00:12:09.471>well-known <00:12:09.704>problem

255
00:12:11.755 --> 00:12:14.765
<00:12:11.755>well <00:12:11.955>documented <00:12:12.155>in <00:12:12.355>uh, <00:12:12.555>in <00:12:12.755>in, <00:12:12.955>in, <00:12:13.155>in,

256
00:12:14.945 --> 00:12:16.845
<00:12:14.945>in <00:12:15.178>projects <00:12:15.411>like <00:12:15.645>a <00:12:15.878>WASP <00:12:16.111>for <00:12:16.345>instance.

257
00:12:18.805 --> 00:12:22.115
<00:12:18.805>Again, <00:12:18.979>the <00:12:19.155>double <00:12:19.329>free <00:12:19.505>problem <00:12:19.680>is <00:12:19.854>not <00:12:20.030>just <00:12:20.204>about

258
00:12:22.305 --> 00:12:23.435
<00:12:22.305>unmanaged <00:12:23.321>languages.

259
00:12:23.785 --> 00:12:25.155
<00:12:23.785>Here <00:12:24.093>you <00:12:24.401>see <00:12:24.709>an <00:12:25.018>example

260
00:12:25.265 --> 00:12:28.875
<00:12:25.265>that <00:12:25.381>you <00:12:25.498>might <00:12:25.615>come <00:12:25.731>across <00:12:25.848>when <00:12:25.965>you <00:12:26.081>write <00:12:26.198>code <00:12:26.314>in <00:12:26.431>C <00:12:26.548>sharp <00:12:26.665>in

261
00:12:28.955 --> 00:12:31.635
<00:12:28.955>a <00:12:29.188>managed <00:12:29.421>language <00:12:29.655>with <00:12:29.888>the <00:12:30.121>garbage <00:12:30.355>collector

262
00:12:32.455 --> 00:12:33.515
<00:12:32.455>for <00:12:32.932>performance <00:12:33.409>reason.

263
00:12:33.715 --> 00:12:37.355
<00:12:33.715>A <00:12:33.890>language <00:12:34.065>like <00:12:34.240>C <00:12:34.415>sharp <00:12:34.590>offers <00:12:34.765>so-called <00:12:34.940>memory <00:12:35.115>pools

264
00:12:37.375 --> 00:12:40.435
<00:12:37.375>or <00:12:37.575>array <00:12:37.775>pools <00:12:37.975>where <00:12:38.175>you <00:12:38.375>can <00:12:38.575>get <00:12:38.775>memory

265
00:12:40.575 --> 00:12:42.275
<00:12:40.575>for <00:12:40.808>a <00:12:41.041>large <00:12:41.275>arrays <00:12:41.508>out <00:12:41.741>of <00:12:41.975>it

266
00:12:42.495 --> 00:12:46.515
<00:12:42.495>and <00:12:42.635>you <00:12:42.775>can <00:12:42.915>return <00:12:43.055>those <00:12:43.195>memory <00:12:43.335>uh <00:12:43.475>areas <00:12:43.615>later <00:12:43.755>on <00:12:43.895>if

267
00:12:46.515 --> 00:12:47.555
<00:12:46.515>you <00:12:46.702>don't <00:12:46.889>no <00:12:47.076>longer <00:12:47.263>need <00:12:47.450>it.

268
00:12:48.095 --> 00:12:51.235
<00:12:48.095>Having <00:12:48.328>such <00:12:48.561>a <00:12:48.795>pool <00:12:49.028>should <00:12:49.261>enhance <00:12:49.495>performance

269
00:12:51.235 --> 00:12:54.195
<00:12:51.235>because <00:12:51.410>it <00:12:51.585>reduce <00:12:51.760>the <00:12:51.935>amount <00:12:52.110>of <00:12:52.285>memory <00:12:52.460>allocations <00:12:52.635>and

270
00:12:54.195 --> 00:12:56.595
<00:12:54.195>therefore <00:12:54.370>the <00:12:54.545>amount <00:12:54.720>of <00:12:54.895>pressure <00:12:55.070>on <00:12:55.245>the <00:12:55.420>garbage <00:12:55.595>collector

271
00:12:56.975 --> 00:12:59.195
<00:12:56.975>and <00:12:57.130>see <00:12:57.286>what <00:12:57.441>can <00:12:57.597>happen <00:12:57.752>here, <00:12:57.908>what <00:12:58.063>can <00:12:58.219>happen <00:12:58.375>here.

272
00:13:00.075 --> 00:13:03.675
<00:13:00.075>I <00:13:00.202>can <00:13:00.329>if <00:13:00.456>I <00:13:00.584>have <00:13:00.711>two <00:13:00.838>developers <00:13:00.965>working <00:13:01.093>on <00:13:01.220>some <00:13:01.347>code <00:13:01.475>areas

273
00:13:04.055 --> 00:13:08.835
<00:13:04.055>who <00:13:04.210>are <00:13:04.366>not <00:13:04.521>extremely <00:13:04.677>careful <00:13:04.832>about <00:13:04.988>who <00:13:05.143>owns <00:13:05.299>which <00:13:05.454>memory,

274
00:13:09.225 --> 00:13:13.995
<00:13:09.225>both <00:13:09.425>could <00:13:09.625>return <00:13:09.825>some <00:13:10.025>rented <00:13:10.225>memory, <00:13:10.425>some <00:13:10.625>bites.

275
00:13:13.995 --> 00:13:18.635
<00:13:13.995>In <00:13:14.122>this <00:13:14.249>case <00:13:14.376>simply <00:13:14.504>an <00:13:14.631>array <00:13:14.758>of <00:13:14.885>intes <00:13:15.013>both <00:13:15.140>can <00:13:15.267>free <00:13:15.395>them

276
00:13:18.655 --> 00:13:20.795
<00:13:18.655>or <00:13:18.855>return <00:13:19.055>them <00:13:19.255>to <00:13:19.454>to <00:13:19.655>the <00:13:19.855>air <00:13:20.055>pool.

277
00:13:20.795 --> 00:13:22.835
<00:13:20.795>And <00:13:20.995>again, <00:13:21.194>we <00:13:21.395>have <00:13:21.594>a <00:13:21.795>double <00:13:21.995>free <00:13:22.194>problem

278
00:13:23.275 --> 00:13:25.595
<00:13:23.275>although <00:13:23.475>we <00:13:23.675>are <00:13:23.875>using <00:13:24.074>a <00:13:24.275>managed <00:13:24.475>language <00:13:24.675>in

279
00:13:25.595 --> 00:13:27.035
<00:13:25.595>with <00:13:26.027>a <00:13:26.459>garbage <00:13:26.891>collector.

280
00:13:27.575 --> 00:13:31.075
<00:13:27.575>So <00:13:27.750>such <00:13:27.925>memory <00:13:28.100>problems <00:13:28.275>are <00:13:28.450>really, <00:13:28.625>really <00:13:28.800>a <00:13:28.975>problem

281
00:13:31.455 --> 00:13:33.155
<00:13:31.455>and <00:13:31.735>endless <00:13:32.015>studies, <00:13:32.295>I <00:13:32.575>mentioned <00:13:32.855>it

282
00:13:33.155 --> 00:13:36.195
<00:13:33.155>before, <00:13:33.329>have <00:13:33.505>shown <00:13:33.680>that <00:13:33.855>they <00:13:34.030>lead <00:13:34.204>to <00:13:34.380>code <00:13:34.555>vulnerabilities

283
00:13:36.855 --> 00:13:39.915
<00:13:36.855>and <00:13:36.982>to <00:13:37.109>software <00:13:37.236>that <00:13:37.364>is <00:13:37.491>not <00:13:37.618>as <00:13:37.745>stable <00:13:37.873>as <00:13:38.000>it <00:13:38.127>should <00:13:38.255>be.

284
00:13:41.435 --> 00:13:44.215
<00:13:41.435>So <00:13:41.668>how <00:13:41.901>does <00:13:42.135>Rust <00:13:42.368>solve <00:13:42.601>exactly <00:13:42.834>that?

285
00:13:45.285 --> 00:13:48.935
<00:13:45.285>Rust <00:13:45.485>solves <00:13:45.685>it <00:13:45.885>by <00:13:46.084>specifying <00:13:46.285>a <00:13:46.485>few <00:13:46.685>simple

286
00:13:49.075 --> 00:13:51.695
<00:13:49.075>but <00:13:49.355>powerful <00:13:49.635>rules <00:13:49.915>for <00:13:50.195>memory <00:13:50.475>management.

287
00:13:52.305 --> 00:13:57.015
<00:13:52.305>First <00:13:52.505>in <00:13:52.704>rust, <00:13:52.905>each <00:13:53.104>piece <00:13:53.305>of <00:13:53.505>memory, <00:13:53.704>each

288
00:13:57.575 --> 00:14:00.975
<00:13:57.575>variable <00:13:57.750>like <00:13:57.925>a <00:13:58.100>list, <00:13:58.275>a <00:13:58.450>vector <00:13:58.625>or <00:13:58.800>a <00:13:58.975>string

289
00:14:01.115 --> 00:14:05.965
<00:14:01.115>or <00:14:01.315>whatever <00:14:01.515>has <00:14:01.715>an <00:14:01.915>owner, <00:14:02.115>it <00:14:02.315>is <00:14:02.515>assigned

290
00:14:06.025 --> 00:14:07.325
<00:14:06.025>to <00:14:06.415>a <00:14:06.805>certain <00:14:07.195>owner.

291
00:14:08.255 --> 00:14:11.245
<00:14:08.255>There <00:14:08.430>can <00:14:08.605>only <00:14:08.780>be <00:14:08.955>one <00:14:09.130>owner <00:14:09.305>at <00:14:09.480>a <00:14:09.655>time

292
00:14:11.905 --> 00:14:13.965
<00:14:11.905>and <00:14:12.185>if <00:14:12.464>I <00:14:12.745>allocate <00:14:13.025>some <00:14:13.305>memory

293
00:14:14.305 --> 00:14:17.205
<00:14:14.305>and <00:14:14.460>if <00:14:14.616>I <00:14:14.771>hand <00:14:14.927>this <00:14:15.082>memory <00:14:15.238>over <00:14:15.393>to <00:14:15.549>somebody <00:14:15.704>else,

294
00:14:17.845 --> 00:14:19.885
<00:14:17.845>I <00:14:18.125>can <00:14:18.405>give <00:14:18.685>away <00:14:18.965>the <00:14:19.245>ownership.

295
00:14:20.255 --> 00:14:22.885
<00:14:20.255>There <00:14:20.535>is <00:14:20.814>always <00:14:21.095>exactly <00:14:21.375>one <00:14:21.655>owner

296
00:14:23.105 --> 00:14:25.645
<00:14:23.105>of <00:14:23.305>memory <00:14:23.505>at <00:14:23.705>one <00:14:23.905>particular <00:14:24.105>point <00:14:24.305>in <00:14:24.505>time.

297
00:14:26.395 --> 00:14:28.175
<00:14:26.395>You <00:14:26.628>can <00:14:26.861>call <00:14:27.095>it <00:14:27.328>the <00:14:27.561>Highlander <00:14:27.795>Effect.

298
00:14:28.175 --> 00:14:30.135
<00:14:28.175>If <00:14:28.375>you're <00:14:28.574>old <00:14:28.775>enough <00:14:28.974>old <00:14:29.175>love <00:14:29.375>like <00:14:29.574>me,

299
00:14:30.535 --> 00:14:33.535
<00:14:30.535>I <00:14:30.675>I <00:14:30.814>know <00:14:30.954>the <00:14:31.094>movie <00:14:31.235>Highlander, <00:14:31.375>there <00:14:31.515>can <00:14:31.655>only <00:14:31.795>be <00:14:31.935>one

300
00:14:33.535 --> 00:14:36.655
<00:14:33.535>and <00:14:33.675>exactly <00:14:33.814>exactly <00:14:33.954>like <00:14:34.094>that <00:14:34.235>it <00:14:34.375>is <00:14:34.515>in <00:14:34.655>rust <00:14:34.795>with <00:14:34.935>ownership.

301
00:14:38.525 --> 00:14:41.215
<00:14:38.525>When <00:14:38.699>the <00:14:38.875>owner, <00:14:39.050>the <00:14:39.225>current <00:14:39.400>owner <00:14:39.574>of <00:14:39.750>a <00:14:39.925>piece

302
00:14:41.255 --> 00:14:45.015
<00:14:41.255>of <00:14:41.395>memory <00:14:41.535>goes <00:14:41.675>out <00:14:41.814>of <00:14:41.955>scope, <00:14:42.095>the <00:14:42.235>value <00:14:42.375>will <00:14:42.515>be <00:14:42.655>dropped.

303
00:14:46.215 --> 00:14:49.665
<00:14:46.215>That <00:14:46.370>is <00:14:46.526>important <00:14:46.681>and <00:14:46.837>now <00:14:46.992>comes <00:14:47.148>the <00:14:47.303>most <00:14:47.459>important <00:14:47.615>statement

304
00:14:49.665 --> 00:14:50.745
<00:14:49.665>of <00:14:49.989>the <00:14:50.313>entire <00:14:50.637>slide.

305
00:14:51.815 --> 00:14:55.285
<00:14:51.815>These <00:14:52.015>ownerships <00:14:52.215>are <00:14:52.415>not <00:14:52.615>just <00:14:52.815>insured <00:14:53.015>during <00:14:53.215>runtime

306
00:14:55.865 --> 00:14:57.925
<00:14:55.865>but <00:14:56.098>they <00:14:56.331>are <00:14:56.565>enforced <00:14:56.798>by <00:14:57.031>the <00:14:57.265>compiler.

307
00:14:58.555 --> 00:15:03.405
<00:14:58.555>That <00:14:58.682>means <00:14:58.809>in <00:14:58.936>rust <00:14:59.064>if <00:14:59.191>you <00:14:59.318>write <00:14:59.445>some <00:14:59.573>code <00:14:59.700>and <00:14:59.827>you <00:14:59.954>uh,

308
00:15:03.425 --> 00:15:05.605
<00:15:03.425>and <00:15:03.580>you <00:15:03.736>write <00:15:03.891>code <00:15:04.047>that <00:15:04.202>does <00:15:04.358>not <00:15:04.513>follow <00:15:04.669>the <00:15:04.824>rules

309
00:15:05.605 --> 00:15:08.925
<00:15:05.605>that <00:15:05.805>I <00:15:06.005>stated <00:15:06.205>here, <00:15:06.405>that <00:15:06.605>compiler <00:15:06.805>will <00:15:07.005>complain,

310
00:15:09.105 --> 00:15:10.885
<00:15:09.105>you <00:15:09.338>will <00:15:09.571>not <00:15:09.805>get <00:15:10.038>a <00:15:10.271>runtime <00:15:10.505>error

311
00:15:11.105 --> 00:15:14.045
<00:15:11.105>and <00:15:11.338>that <00:15:11.571>is <00:15:11.805>pretty <00:15:12.038>powerful <00:15:12.271>for <00:15:12.505>beginners.

312
00:15:14.395 --> 00:15:18.045
<00:15:14.395>It's <00:15:14.595>sometimes <00:15:14.795>hard <00:15:14.995>to <00:15:15.194>work <00:15:15.395>with <00:15:15.595>these <00:15:15.795>rules

313
00:15:18.075 --> 00:15:20.445
<00:15:18.075>because <00:15:18.308>you <00:15:18.541>get <00:15:18.775>so <00:15:19.008>many <00:15:19.241>compiler <00:15:19.475>errors.

314
00:15:20.445 --> 00:15:23.525
<00:15:20.445>On <00:15:20.600>the <00:15:20.756>other <00:15:20.911>hand, <00:15:21.067>if <00:15:21.222>the <00:15:21.378>compiler <00:15:21.533>says <00:15:21.689>thumbs <00:15:21.845>up,

315
00:15:23.585 --> 00:15:25.245
<00:15:23.585>that's <00:15:23.818>exactly <00:15:24.051>what <00:15:24.285>I <00:15:24.518>want <00:15:24.751>to <00:15:24.985>see,

316
00:15:25.675 --> 00:15:28.005
<00:15:25.675>then <00:15:25.849>the <00:15:26.025>code <00:15:26.199>is <00:15:26.375>very <00:15:26.550>likely <00:15:26.724>to <00:15:26.900>really <00:15:27.074>work.

317
00:15:28.705 --> 00:15:32.045
<00:15:28.705>Now <00:15:28.845>let's <00:15:28.985>take <00:15:29.125>a <00:15:29.265>look <00:15:29.405>at <00:15:29.545>practical <00:15:29.685>examples <00:15:29.825>in <00:15:29.965>rust <00:15:30.105>code

318
00:15:32.045 --> 00:15:34.605
<00:15:32.045>to <00:15:32.278>understand <00:15:32.511>in <00:15:32.745>details <00:15:32.978>what <00:15:33.211>that <00:15:33.444>means.

319
00:15:35.715 --> 00:15:37.485
<00:15:35.715>Here <00:15:35.948>I <00:15:36.181>have <00:15:36.415>a <00:15:36.648>very <00:15:36.881>simple <00:15:37.115>example.

320
00:15:38.105 --> 00:15:40.885
<00:15:38.105>If <00:15:38.245>you're <00:15:38.385>not <00:15:38.525>familiar <00:15:38.665>to <00:15:38.805>rust, <00:15:38.945>let <00:15:39.085>me <00:15:39.225>quickly <00:15:39.365>lead <00:15:39.505>you

321
00:15:40.885 --> 00:15:42.685
<00:15:40.885>through <00:15:41.165>this <00:15:41.444>code <00:15:41.725>in <00:15:42.005>line <00:15:42.285>two

322
00:15:43.065 --> 00:15:46.565
<00:15:43.065>and <00:15:43.298>you <00:15:43.531>vector <00:15:43.765>a <00:15:43.998>kind <00:15:44.231>of <00:15:44.465>list

323
00:15:46.785 --> 00:15:48.525
<00:15:46.785>of <00:15:47.251>numbers <00:15:47.718>is <00:15:48.185>allocated.

324
00:15:50.165 --> 00:15:52.495
<00:15:50.165>This <00:15:50.339>vector <00:15:50.515>is <00:15:50.689>stored <00:15:50.865>in <00:15:51.040>a <00:15:51.214>variable <00:15:51.390>called <00:15:51.564>numbers.

325
00:15:53.275 --> 00:15:56.575
<00:15:53.275>In <00:15:53.449>line <00:15:53.625>six <00:15:53.800>we <00:15:53.975>assign <00:15:54.150>numbers <00:15:54.324>to <00:15:54.500>other <00:15:54.675>numbers

326
00:15:56.875 --> 00:15:59.535
<00:15:56.875>and <00:15:57.075>in <00:15:57.275>line <00:15:57.475>10 <00:15:57.675>we <00:15:57.875>print <00:15:58.075>the <00:15:58.275>content

327
00:15:59.835 --> 00:16:01.215
<00:15:59.835>of <00:16:00.083>the <00:16:00.331>vector <00:16:00.580>on <00:16:00.828>the <00:16:01.077>screen.

328
00:16:01.675 --> 00:16:04.575
<00:16:01.675>The <00:16:01.849>colon <00:16:02.025>question <00:16:02.199>mark <00:16:02.375>inside <00:16:02.550>the <00:16:02.724>curly <00:16:02.900>braces <00:16:03.074>mean

329
00:16:04.575 --> 00:16:06.295
<00:16:04.575>that <00:16:04.808>I <00:16:05.041>want <00:16:05.275>to <00:16:05.508>have <00:16:05.741>debug <00:16:05.975>output.

330
00:16:06.995 --> 00:16:09.175
<00:16:06.995>Now <00:16:07.150>let's <00:16:07.306>take <00:16:07.461>a <00:16:07.617>look <00:16:07.772>what's <00:16:07.928>happening <00:16:08.083>with <00:16:08.239>the <00:16:08.395>ownership.

331
00:16:09.585 --> 00:16:12.895
<00:16:09.585>First, <00:16:09.818>the <00:16:10.051>variable <00:16:10.285>numbers <00:16:10.518>owns <00:16:10.751>the <00:16:10.985>vector

332
00:16:13.115 --> 00:16:16.335
<00:16:13.115>so <00:16:13.255>the <00:16:13.395>ownership <00:16:13.535>is <00:16:13.675>clear <00:16:13.815>and <00:16:13.955>now <00:16:14.095>comes <00:16:14.235>the <00:16:14.375>important <00:16:14.515>one.

333
00:16:16.515 --> 00:16:18.655
<00:16:16.515>The <00:16:16.795>ownership <00:16:17.074>changes <00:16:17.355>in <00:16:17.635>line <00:16:17.915>six.

334
00:16:19.315 --> 00:16:21.455
<00:16:19.315>In <00:16:19.515>line <00:16:19.715>six, <00:16:19.915>the <00:16:20.115>ownership <00:16:20.315>goes <00:16:20.515>from <00:16:20.715>numbers

335
00:16:21.675 --> 00:16:22.935
<00:16:21.675>to <00:16:22.242>other <00:16:22.809>numbers.

336
00:16:24.355 --> 00:16:29.215
<00:16:24.355>The <00:16:24.495>vector <00:16:24.635>is <00:16:24.775>freed <00:16:24.915>when <00:16:25.055>other <00:16:25.195>numbers <00:16:25.335>goes <00:16:25.475>out <00:16:25.615>of <00:16:25.755>scope

337
00:16:29.235 --> 00:16:30.775
<00:16:29.235>and <00:16:29.512>that <00:16:29.789>happens <00:16:30.066>in <00:16:30.343>line <00:16:30.621>12.

338
00:16:32.385 --> 00:16:36.405
<00:16:32.385>So <00:16:32.525>if <00:16:32.665>you <00:16:32.805>would <00:16:32.944>try <00:16:33.085>to <00:16:33.225>access <00:16:33.365>numbers <00:16:33.505>in <00:16:33.645>line <00:16:33.785>11

339
00:16:36.545 --> 00:16:39.325
<00:16:36.545>as <00:16:36.719>shown <00:16:36.895>here, <00:16:37.069>this <00:16:37.245>will <00:16:37.420>lead <00:16:37.594>to <00:16:37.770>an <00:16:37.944>error

340
00:16:39.545 --> 00:16:41.365
<00:16:39.545>but <00:16:39.778>not <00:16:40.011>just <00:16:40.245>to <00:16:40.478>a <00:16:40.711>runtime <00:16:40.944>error.

341
00:16:41.385 --> 00:16:43.605
<00:16:41.385>But <00:16:41.560>this <00:16:41.735>will <00:16:41.910>lead <00:16:42.085>to <00:16:42.260>a <00:16:42.435>compile <00:16:42.610>time <00:16:42.785>error.

342
00:16:43.995 --> 00:16:45.725
<00:16:43.995>It's <00:16:44.461>simply <00:16:44.928>not <00:16:45.395>allowed.

343
00:16:46.115 --> 00:16:49.805
<00:16:46.115>Ownership <00:16:46.270>has <00:16:46.426>changed <00:16:46.581>numbers <00:16:46.737>does <00:16:46.892>no <00:16:47.048>longer <00:16:47.203>own <00:16:47.359>the <00:16:47.515>memory,

344
00:16:49.995 --> 00:16:53.245
<00:16:49.995>therefore <00:16:50.195>you <00:16:50.395>cannot <00:16:50.595>access <00:16:50.795>the <00:16:50.995>vector <00:16:51.195>through <00:16:51.395>numbers.

345
00:16:53.865 --> 00:16:56.725
<00:16:53.865>If <00:16:54.020>that <00:16:54.176>wouldn't <00:16:54.331>be <00:16:54.487>the <00:16:54.642>case, <00:16:54.798>then <00:16:54.953>rust <00:16:55.109>would <00:16:55.265>try

346
00:16:56.785 --> 00:16:59.885
<00:16:56.785>to <00:16:57.018>free <00:16:57.251>both <00:16:57.485>numbers <00:16:57.718>and <00:16:57.951>other <00:16:58.185>numbers,

347
00:17:00.025 --> 00:17:03.205
<00:17:00.025>but <00:17:00.180>both <00:17:00.336>variables <00:17:00.491>point <00:17:00.647>to <00:17:00.802>the <00:17:00.958>same <00:17:01.113>area <00:17:01.269>in <00:17:01.425>memory

348
00:17:03.265 --> 00:17:05.085
<00:17:03.265>and <00:17:03.465>we <00:17:03.665>would <00:17:03.865>have <00:17:04.065>a <00:17:04.264>double <00:17:04.464>free <00:17:04.665>problem

349
00:17:05.745 --> 00:17:08.645
<00:17:05.744>and <00:17:05.944>that <00:17:06.145>is <00:17:06.344>prevented <00:17:06.544>by <00:17:06.744>Russ's <00:17:06.944>ownership <00:17:07.145>rules

350
00:17:08.705 --> 00:17:11.205
<00:17:08.704>and <00:17:09.054>the <00:17:09.405>compiler <00:17:09.754>of <00:17:10.105>course,

351
00:17:11.625 --> 00:17:14.085
<00:17:11.625>if <00:17:11.780>you <00:17:11.936>take <00:17:12.091>a <00:17:12.247>look <00:17:12.402>at <00:17:12.558>this <00:17:12.713>little <00:17:12.869>bit <00:17:13.025>extended

352
00:17:14.265 --> 00:17:16.005
<00:17:14.265>and <00:17:14.498>changed <00:17:14.731>example <00:17:14.965>of <00:17:15.198>what <00:17:15.431>we <00:17:15.665>saw

353
00:17:16.005 --> 00:17:17.645
<00:17:16.005>before, <00:17:16.471>it <00:17:16.938>is <00:17:17.405>possible

354
00:17:17.645 --> 00:17:22.485
<00:17:17.645>to <00:17:17.785>clone <00:17:17.925>memory <00:17:18.065>In <00:17:18.204>this <00:17:18.345>case <00:17:18.484>we <00:17:18.625>clone <00:17:18.764>the <00:17:18.905>other <00:17:19.045>numbers

355
00:17:22.835 --> 00:17:23.845
<00:17:22.835>into <00:17:23.289>clone <00:17:23.744>numbers.

356
00:17:24.315 --> 00:17:26.085
<00:17:24.315>Then <00:17:24.595>we <00:17:24.875>have <00:17:25.155>two <00:17:25.435>different <00:17:25.715>owners

357
00:17:26.385 --> 00:17:28.965
<00:17:26.385>but <00:17:26.560>we <00:17:26.734>also <00:17:26.910>have <00:17:27.085>two <00:17:27.260>different <00:17:27.435>areas <00:17:27.609>in <00:17:27.785>memory.

358
00:17:29.185 --> 00:17:32.485
<00:17:29.185>So <00:17:29.312>it <00:17:29.439>isn't <00:17:29.566>a <00:17:29.694>problem <00:17:29.821>that <00:17:29.948>we <00:17:30.075>now <00:17:30.203>have <00:17:30.330>two <00:17:30.457>owners <00:17:30.585>and

359
00:17:32.485 --> 00:17:33.765
<00:17:32.485>therefore <00:17:32.869>it's <00:17:33.253>perfectly <00:17:33.637>fine.

360
00:17:33.955 --> 00:17:35.125
<00:17:33.955>Take <00:17:34.165>a <00:17:34.376>look <00:17:34.586>at <00:17:34.797>nine <00:17:35.008>16

361
00:17:35.515 --> 00:17:38.725
<00:17:35.515>that <00:17:35.715>we <00:17:35.915>access <00:17:36.115>clone <00:17:36.315>numbers <00:17:36.515>and <00:17:36.715>other <00:17:36.915>numbers.

362
00:17:39.265 --> 00:17:41.525
<00:17:39.265>So <00:17:39.615>cloning <00:17:39.965>is <00:17:40.315>perfectly <00:17:40.665>okay.

363
00:17:44.055 --> 00:17:45.965
<00:17:44.055>Let's <00:17:44.288>take <00:17:44.521>a <00:17:44.755>look <00:17:44.988>at <00:17:45.221>another <00:17:45.455>sample

364
00:17:46.465 --> 00:17:49.085
<00:17:46.465>and <00:17:46.665>this <00:17:46.865>sample <00:17:47.064>is <00:17:47.264>about <00:17:47.465>ownership <00:17:47.665>and <00:17:47.865>functions.

365
00:17:49.585 --> 00:17:51.645
<00:17:49.585>That's <00:17:49.818>again <00:17:50.051>start <00:17:50.285>at <00:17:50.518>the <00:17:50.751>very <00:17:50.985>top.

366
00:17:52.395 --> 00:17:53.925
<00:17:52.395>Take <00:17:52.624>a <00:17:52.854>look <00:17:53.083>at <00:17:53.312>line <00:17:53.542>two <00:17:53.772>again.

367
00:17:53.985 --> 00:17:55.045
<00:17:53.985>We <00:17:54.303>allocate <00:17:54.621>a <00:17:54.939>vector

368
00:17:55.545 --> 00:17:58.005
<00:17:55.545>and <00:17:55.745>store <00:17:55.945>it <00:17:56.145>in <00:17:56.345>a <00:17:56.545>variable <00:17:56.745>called <00:17:56.945>numbers

369
00:17:58.945 --> 00:18:01.085
<00:17:58.945>but <00:17:59.120>then <00:17:59.294>recognize <00:17:59.470>what <00:17:59.645>we <00:17:59.820>do <00:17:59.995>in <00:18:00.169>line <00:18:00.345>three.

370
00:18:01.425 --> 00:18:05.885
<00:18:01.425>In <00:18:01.580>line <00:18:01.736>three <00:18:01.891>we <00:18:02.047>give <00:18:02.202>the <00:18:02.358>vector <00:18:02.513>owned <00:18:02.669>by <00:18:02.825>numbers

371
00:18:06.185 --> 00:18:08.605
<00:18:06.185>to <00:18:06.418>a <00:18:06.651>method <00:18:06.885>which <00:18:07.118>is <00:18:07.351>called <00:18:07.585>consume.

372
00:18:08.705 --> 00:18:10.125
<00:18:08.705>So <00:18:09.130>the <00:18:09.557>ownership <00:18:09.983>changes,

373
00:18:10.625 --> 00:18:14.765
<00:18:10.625>the <00:18:10.780>ownership <00:18:10.936>goes <00:18:11.091>into <00:18:11.247>the <00:18:11.402>method <00:18:11.558>consume <00:18:11.713>and <00:18:11.869>now <00:18:12.025>numbers.

374
00:18:15.675 --> 00:18:19.245
<00:18:15.675>Numbers <00:18:15.955>belong <00:18:16.235>to <00:18:16.514>the <00:18:16.794>function <00:18:17.075>consume.

375
00:18:20.115 --> 00:18:23.205
<00:18:20.115>When <00:18:20.290>the <00:18:20.465>local <00:18:20.640>variable <00:18:20.815>numbers <00:18:20.990>goes <00:18:21.165>out <00:18:21.340>of <00:18:21.515>scope,

376
00:18:23.585 --> 00:18:27.485
<00:18:23.585>the <00:18:23.785>vector <00:18:23.985>is <00:18:24.185>freed, <00:18:24.385>it <00:18:24.585>is <00:18:24.785>not <00:18:24.985>possible

377
00:18:27.505 --> 00:18:30.005
<00:18:27.505>to <00:18:27.738>access <00:18:27.971>numbers <00:18:28.205>in <00:18:28.438>the <00:18:28.671>main <00:18:28.905>method

378
00:18:30.135 --> 00:18:32.045
<00:18:30.135>after <00:18:30.485>the <00:18:30.835>call <00:18:31.185>to <00:18:31.535>consume.

379
00:18:33.425 --> 00:18:36.725
<00:18:33.425>So <00:18:33.600>we <00:18:33.774>have <00:18:33.950>a <00:18:34.125>a <00:18:34.300>transfer <00:18:34.475>of <00:18:34.649>the <00:18:34.825>ownership

380
00:18:36.875 --> 00:18:39.965
<00:18:36.875>between <00:18:37.075>the <00:18:37.275>main <00:18:37.475>method <00:18:37.675>and <00:18:37.875>the <00:18:38.075>consume <00:18:38.275>method

381
00:18:40.225 --> 00:18:42.525
<00:18:40.225>and <00:18:40.458>again <00:18:40.691>we <00:18:40.925>have <00:18:41.158>the <00:18:41.391>rule <00:18:41.625>valid.

382
00:18:42.825 --> 00:18:46.845
<00:18:42.825>We <00:18:42.952>only <00:18:43.079>can <00:18:43.206>have <00:18:43.334>one <00:18:43.461>owner <00:18:43.588>at <00:18:43.715>one <00:18:43.843>exactly <00:18:43.970>point <00:18:44.097>in <00:18:44.225>time.

383
00:18:48.465 --> 00:18:51.005
<00:18:48.465>Now <00:18:48.605>let's <00:18:48.745>take <00:18:48.885>it <00:18:49.024>take <00:18:49.165>a <00:18:49.304>look <00:18:49.445>at <00:18:49.584>the <00:18:49.725>other <00:18:49.865>side.

384
00:18:51.555 --> 00:18:54.365
<00:18:51.555>Here <00:18:51.730>we <00:18:51.905>have <00:18:52.080>a <00:18:52.255>function <00:18:52.430>which <00:18:52.605>is <00:18:52.780>called <00:18:52.955>produce.

385
00:18:54.465 --> 00:18:56.085
<00:18:54.465>And <00:18:54.665>as <00:18:54.865>you <00:18:55.064>can <00:18:55.264>see <00:18:55.465>in <00:18:55.665>line <00:18:55.865>16

386
00:18:56.595 --> 00:18:58.845
<00:18:56.595>this <00:18:56.945>function <00:18:57.295>produces <00:18:57.645>a <00:18:57.995>vector.

387
00:18:59.225 --> 00:19:02.805
<00:18:59.225>So <00:18:59.425>it <00:18:59.625>allocates <00:18:59.824>a <00:19:00.024>vector <00:19:00.225>in <00:19:00.425>line <00:19:00.625>17

388
00:19:03.425 --> 00:19:08.085
<00:19:03.425>pushes <00:19:03.580>some <00:19:03.736>numbers <00:19:03.891>into <00:19:04.047>this <00:19:04.202>vector <00:19:04.358>and <00:19:04.513>returns <00:19:04.669>the <00:19:04.825>number.

389
00:19:08.705 --> 00:19:12.205
<00:19:08.705>For <00:19:08.832>those <00:19:08.959>of <00:19:09.086>you <00:19:09.214>who <00:19:09.341>are <00:19:09.468>not <00:19:09.595>that <00:19:09.723>familiar <00:19:09.850>with <00:19:09.977>rust <00:19:10.105>line

390
00:19:12.725 --> 00:19:15.565
<00:19:12.725>19 <00:19:12.925>does <00:19:13.125>not <00:19:13.324>contain <00:19:13.524>a <00:19:13.725>return <00:19:13.925>statement <00:19:14.125>but,

391
00:19:15.625 --> 00:19:18.925
<00:19:15.625>but <00:19:15.752>please <00:19:15.879>note <00:19:16.006>that <00:19:16.134>the <00:19:16.261>line <00:19:16.388>19 <00:19:16.515>does <00:19:16.643>not <00:19:16.770>have <00:19:16.897>a <00:19:17.025>semicolon

392
00:19:18.925 --> 00:19:20.325
<00:19:18.925>at <00:19:19.177>the <00:19:19.429>end <00:19:19.681>of <00:19:19.933>the <00:19:20.185>line.

393
00:19:20.635 --> 00:19:24.125
<00:19:20.635>That <00:19:20.790>means <00:19:20.946>it <00:19:21.101>is <00:19:21.257>the <00:19:21.412>returned <00:19:21.568>value <00:19:21.723>from <00:19:21.879>the <00:19:22.035>function.

394
00:19:24.125 --> 00:19:25.405
<00:19:24.125>This <00:19:24.355>is <00:19:24.585>the <00:19:24.816>syntax <00:19:25.046>of <00:19:25.277>rust.

395
00:19:26.145 --> 00:19:27.685
<00:19:26.145>So <00:19:26.607>by <00:19:27.069>returning <00:19:27.531>numbers

396
00:19:27.905 --> 00:19:31.445
<00:19:27.905>and <00:19:28.060>the <00:19:28.216>vector, <00:19:28.371>the <00:19:28.527>ownership <00:19:28.682>moves <00:19:28.838>to <00:19:28.993>the <00:19:29.149>main <00:19:29.305>method.

397
00:19:32.145 --> 00:19:34.645
<00:19:32.145>Now <00:19:32.378>the <00:19:32.611>main <00:19:32.845>method <00:19:33.078>has <00:19:33.311>the <00:19:33.545>ownership

398
00:19:34.705 --> 00:19:38.365
<00:19:34.705>and <00:19:34.905>stores <00:19:35.105>the <00:19:35.304>the <00:19:35.504>vector <00:19:35.705>in <00:19:35.905>produced <00:19:36.105>numbers

399
00:19:39.065 --> 00:19:41.165
<00:19:39.065>and <00:19:39.298>then <00:19:39.531>we <00:19:39.765>can <00:19:39.998>print <00:19:40.231>produced <00:19:40.465>numbers

400
00:19:41.265 --> 00:19:43.485
<00:19:41.265>and <00:19:41.498>when <00:19:41.731>produced <00:19:41.965>numbers <00:19:42.198>goes <00:19:42.431>out <00:19:42.665>scope

401
00:19:43.825 --> 00:19:44.925
<00:19:43.825>the <00:19:44.155>memory <00:19:44.485>is <00:19:44.815>freed.

402
00:19:44.985 --> 00:19:48.565
<00:19:44.985>We <00:19:45.140>have <00:19:45.296>one <00:19:45.451>owner <00:19:45.607>at <00:19:45.762>one <00:19:45.918>particular <00:19:46.073>point <00:19:46.229>in <00:19:46.385>time.

403
00:19:54.605 --> 00:19:56.015
<00:19:54.605>What <00:19:55.239>about <00:19:55.874>borrowing?

404
00:19:56.125 --> 00:20:00.175
<00:19:56.125>Borrowing <00:19:56.325>means <00:19:56.525>that <00:19:56.725>a <00:19:56.925>method <00:19:57.125>allocates <00:19:57.325>some <00:19:57.525>memory

405
00:20:00.595 --> 00:20:03.255
<00:20:00.595>and <00:20:00.735>it <00:20:00.875>would <00:20:01.015>like <00:20:01.155>to <00:20:01.295>hand <00:20:01.435>over <00:20:01.575>control <00:20:01.715>over <00:20:01.855>this <00:20:01.995>memory

406
00:20:03.355 --> 00:20:06.055
<00:20:03.355>for <00:20:03.530>a <00:20:03.705>limited <00:20:03.880>amount <00:20:04.055>of <00:20:04.230>time <00:20:04.405>to <00:20:04.580>another <00:20:04.755>function

407
00:20:06.635 --> 00:20:08.855
<00:20:06.635>and <00:20:06.810>that <00:20:06.985>is <00:20:07.160>the <00:20:07.335>case <00:20:07.510>in <00:20:07.685>our <00:20:07.860>consume <00:20:08.035>function.

408
00:20:08.855 --> 00:20:13.095
<00:20:08.855>Because <00:20:09.010>our <00:20:09.166>consume <00:20:09.321>function <00:20:09.477>is <00:20:09.632>only <00:20:09.788>reading <00:20:09.943>memory <00:20:10.099>from <00:20:10.255>the

409
00:20:13.095 --> 00:20:16.575
<00:20:13.095>vector, <00:20:13.235>it <00:20:13.375>doesn't <00:20:13.515>need <00:20:13.655>ownership, <00:20:13.795>it <00:20:13.935>just <00:20:14.075>needs <00:20:14.215>to <00:20:14.355>be <00:20:14.495>able

410
00:20:16.575 --> 00:20:18.135
<00:20:16.575>to <00:20:16.925>read <00:20:17.275>from <00:20:17.625>the <00:20:17.975>vector.

411
00:20:18.315 --> 00:20:22.815
<00:20:18.315>And <00:20:18.442>the <00:20:18.569>good <00:20:18.696>news <00:20:18.824>is <00:20:18.951>that <00:20:19.078>you <00:20:19.205>can <00:20:19.333>borrow <00:20:19.460>read <00:20:19.587>only, <00:20:19.715>borrow

412
00:20:23.455 --> 00:20:25.815
<00:20:23.455>a <00:20:23.655>single <00:20:23.855>piece <00:20:24.054>of <00:20:24.254>memory <00:20:24.455>to <00:20:24.655>multiple <00:20:24.855>functions.

413
00:20:25.815 --> 00:20:27.615
<00:20:25.815>Take <00:20:26.048>a <00:20:26.281>look <00:20:26.515>at <00:20:26.748>this <00:20:26.981>function <00:20:27.215>here.

414
00:20:28.315 --> 00:20:29.335
<00:20:28.315>The <00:20:28.621>big <00:20:28.927>difference <00:20:29.233>is

415
00:20:29.335 --> 00:20:32.575
<00:20:29.335>that <00:20:29.490>this <00:20:29.646>function <00:20:29.801>now <00:20:29.957>gets <00:20:30.112>a <00:20:30.268>reference <00:20:30.423>to <00:20:30.579>the <00:20:30.735>vector

416
00:20:32.915 --> 00:20:34.815
<00:20:32.915>and <00:20:33.264>that <00:20:33.615>is <00:20:33.965>called <00:20:34.315>borrowing.

417
00:20:35.515 --> 00:20:39.455
<00:20:35.515>So <00:20:35.622>numbers <00:20:35.730>is <00:20:35.838>read <00:20:35.945>only <00:20:36.053>we <00:20:36.161>can <00:20:36.268>read <00:20:36.376>it <00:20:36.484>in <00:20:36.591>this <00:20:36.699>case <00:20:36.807>we <00:20:36.915>are

418
00:20:39.455 --> 00:20:40.655
<00:20:39.455>using <00:20:39.995>an <00:20:40.534>iterator

419
00:20:40.915 --> 00:20:43.655
<00:20:40.915>and <00:20:41.115>an <00:20:41.315>aggregation <00:20:41.514>function <00:20:41.715>to <00:20:41.915>calculate <00:20:42.115>the <00:20:42.315>sum

420
00:20:43.715 --> 00:20:46.455
<00:20:43.715>of <00:20:43.870>the <00:20:44.026>values <00:20:44.181>that <00:20:44.337>are <00:20:44.492>stored <00:20:44.648>inside <00:20:44.803>of <00:20:44.959>the <00:20:45.115>vector.

421
00:20:47.505 --> 00:20:50.885
<00:20:47.505>It <00:20:47.645>is <00:20:47.785>read <00:20:47.925>only <00:20:48.065>because <00:20:48.205>it's <00:20:48.345>only <00:20:48.485>a <00:20:48.625>reference <00:20:48.765>to <00:20:48.905>vector.

422
00:20:51.075 --> 00:20:55.365
<00:20:51.075>It's <00:20:51.250>not <00:20:51.425>explicitly <00:20:51.600>marked <00:20:51.775>as <00:20:51.950>being <00:20:52.125>muta <00:20:52.300>mutable <00:20:52.475>and

423
00:20:55.365 --> 00:20:58.045
<00:20:55.365>therefore <00:20:55.645>line <00:20:55.925>14 <00:20:56.205>is <00:20:56.485>not <00:20:56.765>possible.

424
00:20:58.875 --> 00:21:00.925
<00:20:58.875>What <00:20:59.108>I <00:20:59.341>want <00:20:59.575>to <00:20:59.808>emphasize <00:21:00.041>here <00:21:00.275>is

425
00:21:00.925 --> 00:21:03.405
<00:21:00.925>that <00:21:01.100>the <00:21:01.274>consume <00:21:01.450>function <00:21:01.625>now <00:21:01.800>just <00:21:01.975>borrows <00:21:02.149>the <00:21:02.325>vector

426
00:21:03.505 --> 00:21:07.525
<00:21:03.505>and <00:21:03.660>you <00:21:03.816>can <00:21:03.971>have <00:21:04.127>multiple <00:21:04.282>other <00:21:04.438>functions <00:21:04.593>have <00:21:04.749>a <00:21:04.905>borrowed,

427
00:21:07.885 --> 00:21:09.605
<00:21:07.885>a <00:21:08.235>borrowed <00:21:08.585>on <00:21:08.935>the <00:21:09.285>vector.

428
00:21:09.745 --> 00:21:14.145
<00:21:09.745>That's <00:21:09.885>important. <00:21:10.024>Now <00:21:10.165>if <00:21:10.304>we <00:21:10.445>take <00:21:10.584>a <00:21:10.725>look <00:21:10.864>at <00:21:11.004>the <00:21:11.145>second

429
00:21:14.505 --> 00:21:18.065
<00:21:14.505>function <00:21:14.680>ads <00:21:14.855>and <00:21:15.030>consume, <00:21:15.205>it <00:21:15.380>is <00:21:15.555>important <00:21:15.730>to <00:21:15.905>see

430
00:21:18.065 --> 00:21:21.585
<00:21:18.065>that <00:21:18.240>this <00:21:18.415>time <00:21:18.590>the <00:21:18.765>function <00:21:18.940>also <00:21:19.115>gets <00:21:19.290>a <00:21:19.465>reference

431
00:21:21.585 --> 00:21:25.385
<00:21:21.585>to <00:21:21.712>the <00:21:21.839>vector <00:21:21.966>but <00:21:22.094>it <00:21:22.221>gets <00:21:22.348>a <00:21:22.475>mutable <00:21:22.603>reference <00:21:22.730>to <00:21:22.857>the <00:21:22.985>vector

432
00:21:25.845 --> 00:21:28.385
<00:21:25.845>and <00:21:26.195>therefore <00:21:26.545>the <00:21:26.895>borrow <00:21:27.245>mutable.

433
00:21:28.395 --> 00:21:31.825
<00:21:28.395>There <00:21:28.595>can <00:21:28.795>also <00:21:28.995>be <00:21:29.195>just <00:21:29.395>one <00:21:29.595>mutable <00:21:29.795>borrow

434
00:21:31.965 --> 00:21:34.105
<00:21:31.965>but <00:21:32.245>still <00:21:32.524>it <00:21:32.804>is <00:21:33.084>a <00:21:33.365>borrow.

435
00:21:34.525 --> 00:21:38.505
<00:21:34.525>So <00:21:34.665>the <00:21:34.805>main <00:21:34.945>method <00:21:35.085>still <00:21:35.225>has <00:21:35.365>the <00:21:35.505>ownership <00:21:35.645>of <00:21:35.785>the <00:21:35.925>numbers

436
00:21:38.845 --> 00:21:42.305
<00:21:38.845>but <00:21:38.972>for <00:21:39.099>a <00:21:39.226>limited <00:21:39.354>amount <00:21:39.481>of <00:21:39.608>time, <00:21:39.735>add <00:21:39.863>and <00:21:39.990>consume <00:21:40.117>can <00:21:40.245>read

437
00:21:42.685 --> 00:21:44.185
<00:21:42.685>and <00:21:42.955>write <00:21:43.225>to <00:21:43.495>the <00:21:43.764>vector <00:21:44.034>door.

438
00:21:44.245 --> 00:21:48.225
<00:21:44.245>As <00:21:44.361>you <00:21:44.478>can <00:21:44.594>see <00:21:44.711>in <00:21:44.828>line <00:21:44.945>20 <00:21:45.061>where <00:21:45.178>I <00:21:45.294>push <00:21:45.411>the <00:21:45.528>value <00:21:45.645>42

439
00:21:48.775 --> 00:21:53.755
<00:21:48.775>into <00:21:48.915>the <00:21:49.055>vector, <00:21:49.195>as <00:21:49.335>I <00:21:49.475>said <00:21:49.615>the <00:21:49.755>main <00:21:49.895>method <00:21:50.035>is <00:21:50.175>still

440
00:21:53.775 --> 00:21:57.555
<00:21:53.775>the <00:21:53.902>owner <00:21:54.029>so <00:21:54.156>we <00:21:54.284>can <00:21:54.411>at <00:21:54.538>the <00:21:54.665>end <00:21:54.793>print <00:21:54.920>the <00:21:55.047>resulting <00:21:55.175>uh

441
00:21:57.555 --> 00:22:00.035
<00:21:57.555>content <00:21:57.788>of <00:21:58.021>the <00:21:58.255>vector <00:21:58.488>and <00:21:58.721>rust <00:21:58.955>will

442
00:22:00.035 --> 00:22:01.435
<00:22:00.035>automatically <00:22:00.455>free <00:22:00.875>the <00:22:01.295>vector.

443
00:22:01.815 --> 00:22:03.315
<00:22:01.815>It <00:22:02.265>is <00:22:02.715>absolutely <00:22:03.165>clear

444
00:22:03.385 --> 00:22:06.315
<00:22:03.385>that <00:22:03.501>it <00:22:03.618>can <00:22:03.735>free <00:22:03.851>the <00:22:03.968>vector <00:22:04.085>at <00:22:04.201>the <00:22:04.318>end <00:22:04.435>of <00:22:04.551>the <00:22:04.668>main <00:22:04.785>method

445
00:22:06.985 --> 00:22:08.475
<00:22:06.985>because <00:22:07.431>the <00:22:07.879>main <00:22:08.326>method

446
00:22:08.695 --> 00:22:11.075
<00:22:08.695>and <00:22:08.928>the <00:22:09.161>variable <00:22:09.395>numbers <00:22:09.628>owns <00:22:09.861>the <00:22:10.095>vector.

447
00:22:14.575 --> 00:22:18.005
<00:22:14.575>Let's <00:22:14.715>take <00:22:14.855>a <00:22:14.995>look <00:22:15.135>at <00:22:15.275>another <00:22:15.415>example <00:22:15.555>which <00:22:15.695>is <00:22:15.835>pretty <00:22:15.975>common

448
00:22:18.035 --> 00:22:19.125
<00:22:18.035>when <00:22:18.362>you <00:22:18.689>write <00:22:19.016>code.

449
00:22:19.785 --> 00:22:21.725
<00:22:19.785>Let <00:22:19.985>me <00:22:20.185>quickly <00:22:20.385>lead <00:22:20.585>you <00:22:20.785>through <00:22:20.985>this <00:22:21.185>example.

450
00:22:22.075 --> 00:22:25.765
<00:22:22.075>This <00:22:22.215>time <00:22:22.355>we <00:22:22.495>are <00:22:22.635>taking <00:22:22.775>a <00:22:22.915>look <00:22:23.055>at <00:22:23.195>an <00:22:23.335>async <00:22:23.475>function.

451
00:22:26.185 --> 00:22:30.365
<00:22:26.185>Please <00:22:26.312>take <00:22:26.439>a <00:22:26.566>look <00:22:26.694>at <00:22:26.821>line <00:22:26.948>nine <00:22:27.075>which <00:22:27.203>is <00:22:27.330>an <00:22:27.457>async <00:22:27.585>main

452
00:22:30.425 --> 00:22:34.205
<00:22:30.425>method <00:22:30.600>and <00:22:30.774>please <00:22:30.950>take <00:22:31.125>a <00:22:31.300>look <00:22:31.475>at <00:22:31.649>line <00:22:31.825>20,

453
00:22:34.865 --> 00:22:35.925
<00:22:34.865>the <00:22:35.342>sum <00:22:35.819>method.

454
00:22:36.925 --> 00:22:40.305
<00:22:36.925>As <00:22:37.052>you <00:22:37.179>can <00:22:37.306>see <00:22:37.434>the <00:22:37.561>async <00:22:37.688>main <00:22:37.815>method <00:22:37.943>in <00:22:38.070>line <00:22:38.197>10 <00:22:38.325>allocates

455
00:22:40.305 --> 00:22:44.185
<00:22:40.305>again <00:22:40.480>a <00:22:40.655>vector <00:22:40.830>and <00:22:41.005>then <00:22:41.180>calls <00:22:41.355>the <00:22:41.530>sum <00:22:41.705>method,

456
00:22:44.925 --> 00:22:48.825
<00:22:44.925>but <00:22:45.080>the <00:22:45.236>sum <00:22:45.391>method <00:22:45.547>has <00:22:45.702>some <00:22:45.858>weight <00:22:46.013>statements <00:22:46.169>in <00:22:46.325>it.

457
00:22:48.845 --> 00:22:50.545
<00:22:48.845>If <00:22:49.045>you <00:22:49.245>take <00:22:49.445>a <00:22:49.645>look <00:22:49.845>at <00:22:50.045>line <00:22:50.245>22,

458
00:22:50.565 --> 00:22:52.385
<00:22:50.565>you <00:22:50.845>will <00:22:51.125>see <00:22:51.405>a <00:22:51.685>delay <00:22:51.965>statement

459
00:22:52.385 --> 00:22:54.465
<00:22:52.385>with <00:22:52.735>the <00:22:53.085>EA <00:22:53.435>weight <00:22:53.785>functionality.

460
00:22:54.975 --> 00:22:58.745
<00:22:54.975>That <00:22:55.130>means <00:22:55.286>we <00:22:55.441>are <00:22:55.597>simulating <00:22:55.752>some <00:22:55.908>harder <00:22:56.063>work <00:22:56.219>which <00:22:56.375>takes

461
00:22:58.925 --> 00:23:02.865
<00:22:58.925>two <00:22:59.158>seconds <00:22:59.391>to <00:22:59.625>calculate <00:22:59.858>some <00:23:00.091>difficult <00:23:00.325>mathematical

462
00:23:02.865 --> 00:23:03.985
<00:23:02.865>formula <00:23:03.201>on <00:23:03.537>the <00:23:03.872>numbers.

463
00:23:04.085 --> 00:23:06.665
<00:23:04.085>In <00:23:04.240>this <00:23:04.396>case, <00:23:04.551>I'm <00:23:04.707>just <00:23:04.862>simulating <00:23:05.018>some <00:23:05.173>work <00:23:05.329>by <00:23:05.485>waiting

464
00:23:07.005 --> 00:23:08.345
<00:23:07.005>for <00:23:07.206>two <00:23:07.407>seconds <00:23:07.608>and <00:23:07.809>at <00:23:08.010>the <00:23:08.211>end

465
00:23:08.345 --> 00:23:10.785
<00:23:08.345>of <00:23:08.500>the <00:23:08.656>day <00:23:08.811>I'm <00:23:08.967>returning <00:23:09.122>the <00:23:09.278>sum <00:23:09.433>over <00:23:09.589>the <00:23:09.745>numbers

466
00:23:11.525 --> 00:23:15.225
<00:23:11.525>but <00:23:11.652>the <00:23:11.779>method <00:23:11.906>sum <00:23:12.034>will <00:23:12.161>be <00:23:12.288>active <00:23:12.415>for <00:23:12.543>at <00:23:12.670>least <00:23:12.797>two <00:23:12.925>seconds

467
00:23:16.365 --> 00:23:19.025
<00:23:16.365>and <00:23:16.540>if <00:23:16.715>you <00:23:16.890>take <00:23:17.065>a <00:23:17.240>look <00:23:17.415>in <00:23:17.590>line <00:23:17.765>12

468
00:23:20.035 --> 00:23:24.865
<00:23:20.035>while <00:23:20.175>the <00:23:20.315>sum <00:23:20.455>method <00:23:20.595>runs, <00:23:20.735>we <00:23:20.875>add <00:23:21.015>something <00:23:21.155>to <00:23:21.295>the <00:23:21.435>numbers

469
00:23:25.285 --> 00:23:28.665
<00:23:25.285>and <00:23:25.425>that <00:23:25.565>is <00:23:25.705>not <00:23:25.845>possible <00:23:25.985>rust, <00:23:26.125>it <00:23:26.265>would <00:23:26.405>break <00:23:26.545>the <00:23:26.685>iterator

470
00:23:29.005 --> 00:23:31.105
<00:23:29.005>and <00:23:29.238>it <00:23:29.471>would <00:23:29.705>break <00:23:29.938>our <00:23:30.171>ownership <00:23:30.405>rules.

471
00:23:31.845 --> 00:23:33.505
<00:23:31.845>We <00:23:32.195>cannot <00:23:32.545>borrow <00:23:32.895>the <00:23:33.245>vector

472
00:23:33.965 --> 00:23:36.585
<00:23:33.965>and <00:23:34.139>on <00:23:34.314>the <00:23:34.490>other <00:23:34.665>hand <00:23:34.840>borrow <00:23:35.014>the <00:23:35.189>mutable <00:23:35.365>vector

473
00:23:36.645 --> 00:23:40.425
<00:23:36.645>to <00:23:36.761>the <00:23:36.878>A <00:23:36.995>method <00:23:37.111>at <00:23:37.228>the <00:23:37.345>same <00:23:37.461>point <00:23:37.578>in <00:23:37.695>time <00:23:37.811>it's <00:23:37.928>not <00:23:38.045>possible.

474
00:23:40.565 --> 00:23:44.225
<00:23:40.565>The <00:23:40.692>big <00:23:40.819>thing <00:23:40.946>here <00:23:41.074>is <00:23:41.201>rust <00:23:41.328>will <00:23:41.455>give <00:23:41.583>you <00:23:41.710>a <00:23:41.837>compiled <00:23:41.965>time

475
00:23:44.225 --> 00:23:46.205
<00:23:44.225>error <00:23:44.458>if <00:23:44.691>you <00:23:44.925>do <00:23:45.158>something <00:23:45.391>like <00:23:45.625>that.

476
00:23:47.845 --> 00:23:51.145
<00:23:47.845>The <00:23:48.000>same <00:23:48.156>code <00:23:48.311>in <00:23:48.467>C <00:23:48.622>sharp <00:23:48.778>in <00:23:48.933>a <00:23:49.089>managed <00:23:49.245>language

477
00:23:51.415 --> 00:23:53.865
<00:23:51.415>with <00:23:51.615>the <00:23:51.815>garbage <00:23:52.014>collector <00:23:52.215>would <00:23:52.415>look <00:23:52.615>like <00:23:52.815>that.

478
00:23:54.095 --> 00:23:55.345
<00:23:54.095>I'll <00:23:54.320>not <00:23:54.545>go <00:23:54.770>into <00:23:54.995>the <00:23:55.220>details

479
00:23:55.345 --> 00:23:57.465
<00:23:55.345>because <00:23:55.520>even <00:23:55.695>if <00:23:55.870>you <00:23:56.045>have <00:23:56.220>not <00:23:56.395>written <00:23:56.570>C <00:23:56.745>sharp

480
00:23:57.465 --> 00:23:59.785
<00:23:57.465>before, <00:23:57.665>you <00:23:57.865>will <00:23:58.064>probably <00:23:58.264>be <00:23:58.465>able <00:23:58.665>to <00:23:58.865>read

481
00:23:59.785 --> 00:24:02.945
<00:23:59.785>and <00:23:59.960>understand <00:24:00.135>the, <00:24:00.310>the, <00:24:00.485>the <00:24:00.660>code <00:24:00.835>from <00:24:01.010>the <00:24:01.185>context.

482
00:24:03.645 --> 00:24:06.865
<00:24:03.645>But <00:24:03.772>the <00:24:03.899>point <00:24:04.026>here <00:24:04.154>is <00:24:04.281>that <00:24:04.408>in <00:24:04.535>line <00:24:04.663>10 <00:24:04.790>I <00:24:04.917>do <00:24:05.045>exactly

483
00:24:07.055 --> 00:24:08.865
<00:24:07.055>what <00:24:07.335>this <00:24:07.615>example <00:24:07.895>shows <00:24:08.175>in <00:24:08.455>rust.

484
00:24:09.745 --> 00:24:13.905
<00:24:09.745>I <00:24:09.885>add <00:24:10.024>a <00:24:10.165>number <00:24:10.304>13 <00:24:10.445>in <00:24:10.584>this <00:24:10.725>case <00:24:10.864>to <00:24:11.004>this <00:24:11.145>list

485
00:24:13.905 --> 00:24:18.745
<00:24:13.905>of <00:24:14.045>intes <00:24:14.185>while <00:24:14.325>in <00:24:14.465>line <00:24:14.605>14 <00:24:14.745>the <00:24:14.885>method <00:24:15.024>some <00:24:15.165>async <00:24:15.305>is

486
00:24:18.755 --> 00:24:21.745
<00:24:18.755>still <00:24:18.910>running <00:24:19.066>and <00:24:19.221>that <00:24:19.377>will <00:24:19.532>again <00:24:19.688>result <00:24:19.843>in <00:24:19.999>an <00:24:20.155>error

487
00:24:21.805 --> 00:24:24.945
<00:24:21.805>but <00:24:21.932>not <00:24:22.059>in <00:24:22.186>a <00:24:22.314>compile <00:24:22.441>time <00:24:22.568>error <00:24:22.695>but <00:24:22.823>in <00:24:22.950>a <00:24:23.077>runtime <00:24:23.205>era.

488
00:24:25.245 --> 00:24:27.065
<00:24:25.245>And <00:24:25.478>that's <00:24:25.711>the <00:24:25.945>big <00:24:26.178>thing <00:24:26.411>in <00:24:26.645>rust.

489
00:24:27.445 --> 00:24:30.425
<00:24:27.445>So <00:24:27.585>rust <00:24:27.725>can <00:24:27.865>really <00:24:28.004>solve <00:24:28.145>a <00:24:28.284>lot <00:24:28.425>of <00:24:28.564>the <00:24:28.705>problems <00:24:28.845>here.

490
00:24:31.865 --> 00:24:33.855
<00:24:31.865>Let's <00:24:32.020>take <00:24:32.176>a <00:24:32.331>a <00:24:32.487>look <00:24:32.642>in <00:24:32.798>at <00:24:32.953>at <00:24:33.109>the <00:24:33.265>last

491
00:24:34.045 --> 00:24:35.255
<00:24:34.045>more <00:24:34.589>complicated <00:24:35.134>example.

492
00:24:35.765 --> 00:24:36.855
<00:24:35.765>This <00:24:36.255>example <00:24:36.746>works

493
00:24:36.855 --> 00:24:39.935
<00:24:36.855>with <00:24:37.055>so-called <00:24:37.255>channels <00:24:37.455>take <00:24:37.655>a <00:24:37.855>at <00:24:38.055>line <00:24:38.255>six

494
00:24:40.795 --> 00:24:43.255
<00:24:40.795>I'm <00:24:41.028>creating <00:24:41.261>a <00:24:41.495>channel <00:24:41.728>of <00:24:41.961>intes <00:24:42.195>here

495
00:24:43.475 --> 00:24:46.855
<00:24:43.475>and <00:24:43.630>I <00:24:43.786>would <00:24:43.941>like <00:24:44.097>to <00:24:44.252>solve <00:24:44.408>a <00:24:44.563>producer <00:24:44.719>consumer <00:24:44.875>problem.

496
00:24:47.715 --> 00:24:51.775
<00:24:47.715>So <00:24:47.889>I'm <00:24:48.064>spawning <00:24:48.240>in <00:24:48.415>line <00:24:48.590>eight <00:24:48.764>a <00:24:48.939>producer <00:24:49.115>thread

497
00:24:52.515 --> 00:24:56.255
<00:24:52.515>and <00:24:52.655>this <00:24:52.795>thread <00:24:52.935>pumps <00:24:53.075>some <00:24:53.215>values <00:24:53.355>in <00:24:53.495>this <00:24:53.635>case <00:24:53.775>just <00:24:53.915>some

498
00:24:56.255 --> 00:24:58.255
<00:24:56.255>integer <00:24:56.605>values <00:24:56.955>into <00:24:57.305>this <00:24:57.655>channel.

499
00:24:58.515 --> 00:25:01.015
<00:24:58.515>And <00:24:58.795>between <00:24:59.075>each <00:24:59.355>channel <00:24:59.635>it <00:24:59.915>we

500
00:25:01.015 --> 00:25:05.495
<00:25:01.015>between <00:25:01.170>each <00:25:01.326>uh <00:25:01.481>send <00:25:01.637>operation <00:25:01.792>we <00:25:01.948>wait <00:25:02.103>for <00:25:02.259>500 <00:25:02.415>milliseconds.

501
00:25:05.515 --> 00:25:09.295
<00:25:05.515>That's <00:25:05.670>the <00:25:05.826>producer <00:25:05.981>and <00:25:06.137>please <00:25:06.292>take <00:25:06.448>a <00:25:06.603>look <00:25:06.759>at <00:25:06.915>the

502
00:25:09.565 --> 00:25:10.975
<00:25:09.565>move <00:25:10.199>keyword <00:25:10.833>here.

503
00:25:11.715 --> 00:25:15.015
<00:25:11.715>The <00:25:11.915>move <00:25:12.115>keyword <00:25:12.314>means <00:25:12.514>that <00:25:12.715>the <00:25:12.915>captured <00:25:13.115>variable,

504
00:25:15.015 --> 00:25:18.535
<00:25:15.015>in <00:25:15.155>this <00:25:15.295>case <00:25:15.435>the <00:25:15.575>sender <00:25:15.715>variable <00:25:15.855>which <00:25:15.995>we <00:25:16.135>get <00:25:16.275>from <00:25:16.415>the

505
00:25:18.535 --> 00:25:21.055
<00:25:18.535>channel <00:25:18.815>in <00:25:19.095>line <00:25:19.375>six <00:25:19.655>is <00:25:19.935>move.

506
00:25:21.115 --> 00:25:23.735
<00:25:21.115>The <00:25:21.348>ownership <00:25:21.581>is <00:25:21.815>moved <00:25:22.048>into <00:25:22.281>the <00:25:22.515>lambda

507
00:25:24.015 --> 00:25:25.375
<00:25:24.015>function <00:25:24.423>of <00:25:24.831>the <00:25:25.239>thread.

508
00:25:26.035 --> 00:25:28.695
<00:25:26.035>So <00:25:26.235>there <00:25:26.435>can <00:25:26.635>only <00:25:26.835>be <00:25:27.035>just <00:25:27.235>one <00:25:27.435>sender

509
00:25:28.995 --> 00:25:30.575
<00:25:28.995>inside <00:25:29.461>the <00:25:29.928>producer <00:25:30.395>thread,

510
00:25:31.315 --> 00:25:33.215
<00:25:31.315>but <00:25:31.490>if <00:25:31.665>you <00:25:31.840>take <00:25:32.015>a <00:25:32.190>look <00:25:32.365>at <00:25:32.540>the <00:25:32.715>bottom,

511
00:25:34.085 --> 00:25:36.255
<00:25:34.085>this <00:25:34.285>is <00:25:34.485>the <00:25:34.685>receiver <00:25:34.885>part <00:25:35.085>of <00:25:35.285>the <00:25:35.485>channel,

512
00:25:36.795 --> 00:25:39.335
<00:25:36.795>you <00:25:37.028>see <00:25:37.261>the <00:25:37.495>receiver <00:25:37.728>part <00:25:37.961>was <00:25:38.195>generated

513
00:25:39.435 --> 00:25:41.375
<00:25:39.435>by <00:25:39.668>producing <00:25:39.901>the <00:25:40.135>channel <00:25:40.368>in <00:25:40.601>line <00:25:40.835>six.

514
00:25:42.115 --> 00:25:45.255
<00:25:42.115>Now <00:25:42.348>we <00:25:42.581>can <00:25:42.815>safely <00:25:43.048>call <00:25:43.281>receiver <00:25:43.515>receive

515
00:25:45.955 --> 00:25:47.495
<00:25:45.955>and <00:25:46.301>match <00:25:46.648>over <00:25:46.994>the <00:25:47.341>result

516
00:25:48.235 --> 00:25:50.335
<00:25:48.235>and <00:25:48.435>print <00:25:48.635>the <00:25:48.834>result <00:25:49.034>once <00:25:49.235>we <00:25:49.435>got <00:25:49.635>something.

517
00:25:51.275 --> 00:25:52.455
<00:25:51.275>If <00:25:51.487>you <00:25:51.699>are <00:25:51.912>new <00:25:52.124>to <00:25:52.337>rust

518
00:25:52.595 --> 00:25:54.855
<00:25:52.595>and <00:25:52.770>you <00:25:52.945>wonder, <00:25:53.120>hey <00:25:53.295>what's <00:25:53.470>this <00:25:53.645>match <00:25:53.820>all <00:25:53.995>about

519
00:25:54.955 --> 00:25:56.255
<00:25:54.955>and <00:25:55.345>what's <00:25:55.735>this <00:25:56.125>okay

520
00:25:56.315 --> 00:25:59.175
<00:25:56.315>and <00:25:56.490>error, <00:25:56.665>please <00:25:56.840>be <00:25:57.015>patient <00:25:57.190>for <00:25:57.365>another <00:25:57.540>few <00:25:57.715>minutes,

521
00:25:59.555 --> 00:26:00.775
<00:25:59.555>you <00:25:59.774>will <00:25:59.994>learn <00:26:00.213>more <00:26:00.433>about <00:26:00.653>it.

522
00:26:00.795 --> 00:26:04.335
<00:26:00.795>So <00:26:00.950>as <00:26:01.106>you <00:26:01.261>can <00:26:01.417>see <00:26:01.572>the <00:26:01.728>borrowing <00:26:01.883>rules <00:26:02.039>also <00:26:02.195>apply

523
00:26:04.555 --> 00:26:07.695
<00:26:04.555>to <00:26:04.835>more <00:26:05.115>complicated <00:26:05.395>multi-threaded <00:26:05.675>programming <00:26:05.955>scenarios

524
00:26:07.825 --> 00:26:08.895
<00:26:07.825>where <00:26:08.146>you <00:26:08.467>have <00:26:08.788>center

525
00:26:08.955 --> 00:26:10.895
<00:26:08.955>and <00:26:09.235>receiver <00:26:09.514>running <00:26:09.794>in <00:26:10.074>different <00:26:10.355>thread.

526
00:26:13.185 --> 00:26:15.485
<00:26:13.185>So <00:26:13.385>what <00:26:13.585>can <00:26:13.784>we, <00:26:13.985>what <00:26:14.185>can <00:26:14.385>we <00:26:14.585>summarize?

527
00:26:16.355 --> 00:26:18.285
<00:26:16.355>Rust <00:26:16.635>is <00:26:16.915>really <00:26:17.195>stable <00:26:17.475>and <00:26:17.755>safe.

528
00:26:18.785 --> 00:26:20.325
<00:26:18.785>It <00:26:19.131>has <00:26:19.478>clear <00:26:19.824>ownership <00:26:20.171>rules

529
00:26:20.465 --> 00:26:21.765
<00:26:20.465>and <00:26:20.855>the <00:26:21.245>important <00:26:21.635>thing

530
00:26:21.915 --> 00:26:25.045
<00:26:21.915>that <00:26:22.070>you <00:26:22.226>should <00:26:22.381>remember <00:26:22.537>from <00:26:22.692>this <00:26:22.848>talk <00:26:23.003>is <00:26:23.159>those <00:26:23.315>ownership

531
00:26:25.045 --> 00:26:27.405
<00:26:25.045>rules <00:26:25.325>are <00:26:25.605>enforced <00:26:25.885>by <00:26:26.165>the <00:26:26.445>compiler.

532
00:26:27.985 --> 00:26:30.405
<00:26:27.985>Of <00:26:28.185>course <00:26:28.385>sometimes <00:26:28.584>things <00:26:28.784>are <00:26:28.985>not <00:26:29.185>that <00:26:29.385>simple.

533
00:26:30.705 --> 00:26:34.245
<00:26:30.705>If <00:26:30.905>you <00:26:31.105>explicitly <00:26:31.304>want <00:26:31.504>to <00:26:31.705>have <00:26:31.905>shared <00:26:32.105>memory

534
00:26:34.675 --> 00:26:37.685
<00:26:34.675>with <00:26:34.908>multiple <00:26:35.141>pieces <00:26:35.375>of <00:26:35.608>code <00:26:35.841>accessing, <00:26:36.075>reading

535
00:26:37.745 --> 00:26:39.885
<00:26:37.745>and <00:26:37.978>writing <00:26:38.211>a <00:26:38.445>certain <00:26:38.678>element <00:26:38.911>of <00:26:39.145>memory,

536
00:26:40.185 --> 00:26:42.325
<00:26:40.185>of <00:26:40.360>course <00:26:40.534>this <00:26:40.710>is <00:26:40.885>possible <00:26:41.060>in <00:26:41.235>rust <00:26:41.409>of <00:26:41.585>course,

537
00:26:43.065 --> 00:26:44.685
<00:26:43.065>but <00:26:43.345>this <00:26:43.625>should <00:26:43.905>be <00:26:44.185>the <00:26:44.465>exception

538
00:26:44.685 --> 00:26:47.925
<00:26:44.685>and <00:26:44.860>not <00:26:45.034>the <00:26:45.210>rule <00:26:45.385>for <00:26:45.560>the <00:26:45.735>typical <00:26:45.909>everyday <00:26:46.085>programming.

539
00:26:48.235 --> 00:26:52.565
<00:26:48.235>Rust <00:26:48.375>is <00:26:48.514>this <00:26:48.655>iron <00:26:48.794>safety <00:26:48.935>net <00:26:49.074>underneath <00:26:49.215>you <00:26:49.354>that <00:26:49.495>makes <00:26:49.635>sure

540
00:26:52.875 --> 00:26:56.125
<00:26:52.875>that <00:26:53.030>you <00:26:53.186>don't <00:26:53.341>screw <00:26:53.497>anything <00:26:53.652>up <00:26:53.808>like <00:26:53.963>it <00:26:54.119>could <00:26:54.275>happen

541
00:26:56.185 --> 00:26:57.405
<00:26:56.185>in <00:26:56.368>in <00:26:56.551>C <00:26:56.734>or <00:26:56.917>c <00:26:57.100>plus <00:26:57.283>plus.

542
00:26:57.405 --> 00:27:00.685
<00:26:57.405>That <00:26:57.580>leads <00:26:57.754>to <00:26:57.930>less <00:26:58.105>runtime <00:26:58.280>errors. <00:26:58.455>Very <00:26:58.629>important <00:26:58.805>thing.

543
00:27:01.065 --> 00:27:03.805
<00:27:01.065>But <00:27:01.240>even <00:27:01.415>more <00:27:01.590>important <00:27:01.765>if <00:27:01.940>you <00:27:02.115>think <00:27:02.290>about <00:27:02.465>systems

544
00:27:03.875 --> 00:27:06.165
<00:27:03.875>programming <00:27:04.341>about <00:27:04.808>long <00:27:05.275>running,

545
00:27:06.465 --> 00:27:08.925
<00:27:06.465>for <00:27:06.698>instance <00:27:06.931>microservices <00:27:07.165>running <00:27:07.398>in <00:27:07.631>the <00:27:07.865>cloud,

546
00:27:09.395 --> 00:27:10.605
<00:27:09.395>less <00:27:10.484>vulnerabilities.

547
00:27:11.855 --> 00:27:15.205
<00:27:11.855>There <00:27:11.982>is <00:27:12.109>a <00:27:12.236>second <00:27:12.364>aspect <00:27:12.491>here <00:27:12.618>in <00:27:12.745>this <00:27:12.873>enforcing <00:27:13.000>of <00:27:13.127>the <00:27:13.255>rules

548
00:27:15.265 --> 00:27:18.165
<00:27:15.265>by <00:27:15.498>the <00:27:15.731>compiler <00:27:15.965>and <00:27:16.198>that's <00:27:16.431>about <00:27:16.665>performance

549
00:27:18.475 --> 00:27:20.205
<00:27:18.475>because <00:27:19.175>the <00:27:19.875>compiler

550
00:27:20.465 --> 00:27:25.205
<00:27:20.465>and <00:27:20.605>forces <00:27:20.745>so <00:27:20.885>many <00:27:21.024>strict <00:27:21.165>rules, <00:27:21.304>it <00:27:21.445>can <00:27:21.584>optimize <00:27:21.725>the <00:27:21.865>codes

551
00:27:25.205 --> 00:27:27.565
<00:27:25.205>to <00:27:25.438>a <00:27:25.671>very <00:27:25.905>large <00:27:26.138>extent <00:27:26.371>without <00:27:26.605>being

552
00:27:27.565 --> 00:27:28.845
<00:27:27.565>afraid <00:27:27.949>to <00:27:28.333>break <00:27:28.717>something.

553
00:27:29.185 --> 00:27:31.005
<00:27:29.185>So <00:27:29.465>the <00:27:29.745>performance <00:27:30.024>is <00:27:30.304>simply <00:27:30.585>awesome

554
00:27:31.785 --> 00:27:33.325
<00:27:31.785>and <00:27:32.131>managed <00:27:32.478>language <00:27:32.824>that <00:27:33.171>has

555
00:27:33.325 --> 00:27:37.605
<00:27:33.325>to <00:27:33.465>do <00:27:33.605>all <00:27:33.745>these <00:27:33.885>checks <00:27:34.025>at <00:27:34.165>runtime <00:27:34.305>obviously <00:27:34.445>needs <00:27:34.585>CPU <00:27:34.725>cycles

556
00:27:37.605 --> 00:27:39.365
<00:27:37.605>for <00:27:37.955>doing <00:27:38.305>the <00:27:38.655>checks <00:27:39.005>here.

557
00:27:39.745 --> 00:27:44.455
<00:27:39.745>The <00:27:39.885>checks <00:27:40.024>are <00:27:40.165>at <00:27:40.304>compile <00:27:40.445>time <00:27:40.584>and <00:27:40.725>not <00:27:40.864>at <00:27:41.004>runtime <00:27:41.145>good.

558
00:27:44.915 --> 00:27:47.775
<00:27:44.915>As <00:27:45.115>you <00:27:45.315>can <00:27:45.514>see, <00:27:45.715>my <00:27:45.915>relationship, <00:27:46.115>my <00:27:46.315>love

559
00:27:47.775 --> 00:27:50.615
<00:27:47.775>to <00:27:47.950>rust <00:27:48.125>is <00:27:48.300>based <00:27:48.475>on <00:27:48.650>a <00:27:48.825>feeling <00:27:49.000>of <00:27:49.175>security

560
00:27:51.075 --> 00:27:53.695
<00:27:51.075>and <00:27:51.308>safety <00:27:51.541>that's <00:27:51.775>great <00:27:52.008>for <00:27:52.241>a <00:27:52.475>loving

561
00:27:53.715 --> 00:27:54.895
<00:27:53.715>and <00:27:54.245>caring <00:27:54.777>relationship.

562
00:27:56.105 --> 00:27:58.125
<00:27:56.105>The <00:27:56.385>next <00:27:56.665>topic <00:27:56.945>is <00:27:57.225>about <00:27:57.505>deepness.

563
00:27:58.885 --> 00:28:00.445
<00:27:58.885>A <00:27:59.085>relationship <00:27:59.285>that <00:27:59.485>I <00:27:59.685>would <00:27:59.885>like <00:28:00.085>to <00:28:00.285>have

564
00:28:00.555 --> 00:28:02.845
<00:28:00.555>with <00:28:00.788>a <00:28:01.021>programming <00:28:01.255>language <00:28:01.488>should <00:28:01.721>be <00:28:01.955>deep.

565
00:28:03.205 --> 00:28:05.365
<00:28:03.205>I <00:28:03.379>want <00:28:03.554>to <00:28:03.730>have <00:28:03.905>a <00:28:04.080>deep <00:28:04.254>type <00:28:04.429>type <00:28:04.605>system.

566
00:28:05.605 --> 00:28:09.205
<00:28:05.605>I <00:28:05.732>would <00:28:05.859>like <00:28:05.986>to <00:28:06.114>have <00:28:06.241>the <00:28:06.368>the, <00:28:06.495>the <00:28:06.623>language <00:28:06.750>to <00:28:06.877>support <00:28:07.005>myself

567
00:28:09.505 --> 00:28:11.445
<00:28:09.505>to <00:28:09.705>make <00:28:09.905>the <00:28:10.105>best <00:28:10.305>out <00:28:10.505>of <00:28:10.705>my <00:28:10.905>ideas,

568
00:28:11.625 --> 00:28:14.205
<00:28:11.625>to <00:28:11.800>offer <00:28:11.975>me <00:28:12.150>great <00:28:12.325>abstractions <00:28:12.500>and <00:28:12.675>things <00:28:12.850>like <00:28:13.025>that.

569
00:28:14.545 --> 00:28:17.085
<00:28:14.545>So <00:28:14.672>for <00:28:14.799>the <00:28:14.926>next <00:28:15.054>few <00:28:15.181>minutes <00:28:15.308>I <00:28:15.435>would <00:28:15.563>like <00:28:15.690>to <00:28:15.817>walk <00:28:15.945>you

570
00:28:17.085 --> 00:28:20.925
<00:28:17.085>through <00:28:17.318>some <00:28:17.551>examples, <00:28:17.785>some <00:28:18.018>small <00:28:18.251>examples, <00:28:18.485>uh,

571
00:28:21.015 --> 00:28:23.965
<00:28:21.015>about <00:28:21.170>the <00:28:21.326>type <00:28:21.481>system <00:28:21.637>in <00:28:21.792>rust <00:28:21.948>so <00:28:22.103>you <00:28:22.259>understand <00:28:22.415>better

572
00:28:24.345 --> 00:28:28.325
<00:28:24.345>how <00:28:24.578>you <00:28:24.811>create <00:28:25.045>abstractions, <00:28:25.278>doing <00:28:25.511>structured <00:28:25.745>programming

573
00:28:28.325 --> 00:28:32.685
<00:28:28.325>and <00:28:28.465>things <00:28:28.605>like <00:28:28.745>that <00:28:28.885>with <00:28:29.025>rust <00:28:29.165>first, <00:28:29.305>rust <00:28:29.445>has <00:28:29.585>no <00:28:29.725>classes

574
00:28:33.265 --> 00:28:35.405
<00:28:33.265>so <00:28:33.440>if <00:28:33.615>you <00:28:33.790>come <00:28:33.965>from <00:28:34.140>programming <00:28:34.315>languages <00:28:34.490>like <00:28:34.665>Java,

575
00:28:35.565 --> 00:28:38.405
<00:28:35.565>C <00:28:35.740>sharp, <00:28:35.915>TypeScript <00:28:36.090>and <00:28:36.265>so <00:28:36.440>on, <00:28:36.615>you <00:28:36.790>obviously <00:28:36.965>think

576
00:28:38.405 --> 00:28:40.645
<00:28:38.405>that <00:28:38.638>rust <00:28:38.871>will <00:28:39.105>have <00:28:39.338>something <00:28:39.571>like <00:28:39.805>classes,

577
00:28:40.955 --> 00:28:43.245
<00:28:40.955>inheritance <00:28:41.235>polymorphism <00:28:41.514>and <00:28:41.794>things <00:28:42.074>like <00:28:42.355>that.

578
00:28:43.625 --> 00:28:46.365
<00:28:43.625>I'm <00:28:43.905>afraid <00:28:44.185>not. <00:28:44.465>Rust <00:28:44.745>has <00:28:45.025>structures.

579
00:28:47.085 --> 00:28:51.205
<00:28:47.085>SRUs <00:28:47.240>is <00:28:47.396>the <00:28:47.551>basic, <00:28:47.707>the <00:28:47.862>basic <00:28:48.018>building <00:28:48.173>block <00:28:48.329>of <00:28:48.485>creating

580
00:28:51.715 --> 00:28:53.285
<00:28:51.715>data <00:28:52.181>structures <00:28:52.648>in <00:28:53.115>rust

581
00:28:53.465 --> 00:28:57.565
<00:28:53.465>and <00:28:53.639>here <00:28:53.814>you <00:28:53.990>have <00:28:54.165>three <00:28:54.340>examples, <00:28:54.514>four <00:28:54.689>structures <00:28:54.865>structures

582
00:28:57.565 --> 00:29:00.165
<00:28:57.565>with <00:28:57.798>basic <00:28:58.031>data <00:28:58.265>types <00:28:58.498>like <00:28:58.731>Float <00:28:58.965>32

583
00:29:00.545 --> 00:29:03.765
<00:29:00.545>and <00:29:00.778>also <00:29:01.011>um, <00:29:01.245>composed <00:29:01.478>structures <00:29:01.711>like <00:29:01.945>rectangle

584
00:29:03.945 --> 00:29:07.665
<00:29:03.945>and <00:29:04.100>circle <00:29:04.256>if <00:29:04.411>you <00:29:04.567>want <00:29:04.722>to <00:29:04.878>work <00:29:05.033>with <00:29:05.189>these <00:29:05.345>structures.

585
00:29:07.775 --> 00:29:10.905
<00:29:07.775>It's <00:29:07.975>obviously <00:29:08.175>clear <00:29:08.375>that <00:29:08.575>you <00:29:08.775>can <00:29:08.975>create <00:29:09.175>instances

586
00:29:11.045 --> 00:29:13.145
<00:29:11.045>of <00:29:11.200>these <00:29:11.356>structures <00:29:11.511>as <00:29:11.667>you <00:29:11.822>can <00:29:11.978>see <00:29:12.133>in <00:29:12.289>line <00:29:12.445>three,

587
00:29:14.085 --> 00:29:16.905
<00:29:14.085>but <00:29:14.318>it's <00:29:14.551>also <00:29:14.785>possible <00:29:15.018>to <00:29:15.251>create <00:29:15.485>duplicates

588
00:29:17.525 --> 00:29:20.945
<00:29:17.525>and <00:29:17.680>copy <00:29:17.836>parts <00:29:17.991>of <00:29:18.147>another <00:29:18.302>struct <00:29:18.458>into <00:29:18.613>a <00:29:18.769>new <00:29:18.925>instance

589
00:29:21.005 --> 00:29:23.545
<00:29:21.005>of <00:29:21.238>the <00:29:21.471>struct <00:29:21.705>with <00:29:21.938>a <00:29:22.171>dot <00:29:22.405>ctx,

590
00:29:23.565 --> 00:29:25.305
<00:29:23.565>as <00:29:23.765>you <00:29:23.965>can <00:29:24.165>see <00:29:24.365>here <00:29:24.565>in <00:29:24.765>line <00:29:24.965>six.

591
00:29:25.635 --> 00:29:29.385
<00:29:25.635>Isn't <00:29:25.790>that <00:29:25.946>beautiful <00:29:26.101>Ctx, <00:29:26.257>I <00:29:26.412>love <00:29:26.568>this <00:29:26.723>ctx, <00:29:26.879>eh, <00:29:27.035>I'm,

592
00:29:29.405 --> 00:29:31.505
<00:29:29.405>I'm <00:29:29.532>also <00:29:29.659>doing <00:29:29.786>a <00:29:29.914>lot <00:29:30.041>of <00:29:30.168>work <00:29:30.295>in <00:29:30.423>the <00:29:30.550>C <00:29:30.677>sharp <00:29:30.805>area

593
00:29:32.005 --> 00:29:33.985
<00:29:32.005>and <00:29:32.238>there <00:29:32.471>you <00:29:32.705>have <00:29:32.938>this <00:29:33.171>width <00:29:33.405>claws.

594
00:29:34.245 --> 00:29:36.185
<00:29:34.245>It <00:29:34.524>only <00:29:34.804>came <00:29:35.084>recently <00:29:35.364>to <00:29:35.645>C,

595
00:29:36.725 --> 00:29:39.145
<00:29:36.725>but <00:29:36.865>dressed <00:29:37.004>has <00:29:37.145>it <00:29:37.284>built <00:29:37.425>in <00:29:37.564>for <00:29:37.705>qto <00:29:37.844>quite <00:29:37.985>a <00:29:38.125>while.

596
00:29:40.115 --> 00:29:44.045
<00:29:40.115>Another <00:29:40.290>example <00:29:40.465>that <00:29:40.640>is <00:29:40.815>worth <00:29:40.990>mentioning <00:29:41.165>is <00:29:41.340>this <00:29:41.515>one

597
00:29:44.545 --> 00:29:47.685
<00:29:44.545>by <00:29:44.778>default <00:29:45.011>variables <00:29:45.245>in <00:29:45.478>rust <00:29:45.711>are <00:29:45.945>immutable.

598
00:29:48.425 --> 00:29:52.445
<00:29:48.425>So <00:29:48.600>line <00:29:48.774>three <00:29:48.950>and <00:29:49.125>line <00:29:49.300>six <00:29:49.475>create <00:29:49.649>immutable <00:29:49.825>points.

599
00:29:52.985 --> 00:29:55.925
<00:29:52.985>If <00:29:53.140>you <00:29:53.296>want <00:29:53.451>to <00:29:53.607>be <00:29:53.762>able <00:29:53.918>to <00:29:54.073>mutate <00:29:54.229>a <00:29:54.385>variable

600
00:29:55.925 --> 00:29:58.165
<00:29:55.925>or <00:29:56.100>its <00:29:56.274>content, <00:29:56.450>you <00:29:56.625>have <00:29:56.800>to <00:29:56.975>de <00:29:57.149>declare <00:29:57.325>it

601
00:29:58.165 --> 00:30:01.845
<00:29:58.165>as <00:29:58.305>being <00:29:58.445>mutable <00:29:58.585>like <00:29:58.725>you <00:29:58.865>can <00:29:59.004>see <00:29:59.145>in <00:29:59.284>line <00:29:59.425>10 <00:29:59.565>then

602
00:30:01.845 --> 00:30:06.085
<00:30:01.845>and <00:30:01.985>only <00:30:02.125>then <00:30:02.265>I <00:30:02.405>can <00:30:02.545>change <00:30:02.685>the <00:30:02.825>content <00:30:02.965>of <00:30:03.105>the <00:30:03.245>rectangle

603
00:30:06.195 --> 00:30:07.845
<00:30:06.195>that <00:30:06.475>I <00:30:06.754>create <00:30:07.034>in <00:30:07.314>line <00:30:07.595>10.

604
00:30:10.515 --> 00:30:12.975
<00:30:10.515>All <00:30:10.795>the <00:30:11.075>examples <00:30:11.355>above <00:30:11.635>created <00:30:11.915>instances

605
00:30:13.115 --> 00:30:14.455
<00:30:13.115>of <00:30:13.356>the <00:30:13.597>struts <00:30:13.838>on <00:30:14.079>the <00:30:14.321>stack,

606
00:30:14.835 --> 00:30:18.295
<00:30:14.835>but <00:30:14.990>obviously <00:30:15.146>you <00:30:15.301>can <00:30:15.457>create <00:30:15.612>instances <00:30:15.768>on <00:30:15.923>the <00:30:16.079>heap <00:30:16.235>two

607
00:30:18.475 --> 00:30:22.055
<00:30:18.475>and <00:30:18.602>for <00:30:18.729>that <00:30:18.856>rust <00:30:18.984>offers <00:30:19.111>a <00:30:19.238>lot <00:30:19.365>of <00:30:19.493>different <00:30:19.620>data <00:30:19.747>types <00:30:19.875>like

608
00:30:22.075 --> 00:30:26.335
<00:30:22.075>for <00:30:22.230>instance <00:30:22.386>box <00:30:22.541>in <00:30:22.697>this <00:30:22.852>case <00:30:23.008>box <00:30:23.163>new <00:30:23.319>would <00:30:23.475>uh,

609
00:30:26.335 --> 00:30:28.775
<00:30:26.335>would <00:30:26.490>create <00:30:26.646>an <00:30:26.801>instance <00:30:26.957>of, <00:30:27.112>in <00:30:27.268>this <00:30:27.423>case <00:30:27.579>the <00:30:27.735>circle,

610
00:30:29.355 --> 00:30:31.055
<00:30:29.355>create <00:30:29.635>the <00:30:29.915>circle <00:30:30.195>on <00:30:30.475>the <00:30:30.755>heap

611
00:30:31.315 --> 00:30:34.535
<00:30:31.315>and <00:30:31.455>return <00:30:31.595>a <00:30:31.735>reference <00:30:31.875>to <00:30:32.015>the <00:30:32.155>heap <00:30:32.295>into <00:30:32.435>your <00:30:32.575>variable <00:30:32.715>C,

612
00:30:34.585 --> 00:30:36.895
<00:30:34.585>which <00:30:34.818>again <00:30:35.051>is <00:30:35.285>marked <00:30:35.518>as <00:30:35.751>being <00:30:35.985>mutable.

613
00:30:37.045 --> 00:30:40.615
<00:30:37.045>Therefore <00:30:37.172>in <00:30:37.299>nine <00:30:37.426>17 <00:30:37.554>we <00:30:37.681>can <00:30:37.808>change <00:30:37.935>the <00:30:38.063>radius <00:30:38.190>of <00:30:38.317>the <00:30:38.445>circle.

614
00:30:41.585 --> 00:30:46.455
<00:30:41.585>So <00:30:41.725>that <00:30:41.865>is <00:30:42.005>S <00:30:42.145>structs. <00:30:42.285>Let's <00:30:42.425>take <00:30:42.565>a <00:30:42.705>look <00:30:42.845>at <00:30:42.985>functions.

615
00:30:47.115 --> 00:30:49.495
<00:30:47.115>You've <00:30:47.348>only <00:30:47.581>already <00:30:47.815>seen <00:30:48.048>that <00:30:48.281>in <00:30:48.515>rust.

616
00:30:49.595 --> 00:30:52.895
<00:30:49.595>You <00:30:49.828>can <00:30:50.061>simply <00:30:50.295>create <00:30:50.528>standalone <00:30:50.761>functions, <00:30:50.995>functions

617
00:30:52.895 --> 00:30:55.735
<00:30:52.895>that <00:30:53.050>have <00:30:53.206>no <00:30:53.361>relation <00:30:53.517>to <00:30:53.672>any <00:30:53.828>kind <00:30:53.983>of <00:30:54.139>data <00:30:54.295>structure,

618
00:30:56.435 --> 00:31:00.335
<00:30:56.435>but <00:30:56.635>you <00:30:56.835>can <00:30:57.034>also <00:30:57.235>add <00:30:57.435>implementations <00:30:57.635>to <00:30:57.835>structs

619
00:31:00.355 --> 00:31:02.495
<00:31:00.355>by <00:31:00.635>adding <00:31:00.915>functions <00:31:01.195>to <00:31:01.475>a <00:31:01.755>struct.

620
00:31:03.195 --> 00:31:04.975
<00:31:03.195>Please <00:31:03.428>take <00:31:03.661>a <00:31:03.895>look <00:31:04.128>at <00:31:04.361>line <00:31:04.595>one.

621
00:31:04.975 --> 00:31:08.095
<00:31:04.975>You <00:31:05.130>see <00:31:05.286>we <00:31:05.441>have <00:31:05.597>the <00:31:05.752>implementation <00:31:05.908>of <00:31:06.063>the <00:31:06.219>rectangle <00:31:06.375>struct

622
00:31:08.095 --> 00:31:12.695
<00:31:08.095>that <00:31:08.222>you <00:31:08.349>saw <00:31:08.476>before <00:31:08.604>and <00:31:08.731>line <00:31:08.858>15 <00:31:08.985>shows <00:31:09.113>you <00:31:09.240>that <00:31:09.367>there <00:31:09.495>is

623
00:31:12.795 --> 00:31:16.775
<00:31:12.795>or <00:31:12.935>there <00:31:13.075>can <00:31:13.215>be <00:31:13.355>a <00:31:13.495>function <00:31:13.635>area <00:31:13.775>which <00:31:13.915>gets <00:31:14.055>a <00:31:14.195>borrow,

624
00:31:17.135 --> 00:31:20.535
<00:31:17.135>a <00:31:17.310>borrowed <00:31:17.485>reference <00:31:17.660>to <00:31:17.835>self <00:31:18.010>meaning <00:31:18.185>the <00:31:18.360>rectangle <00:31:18.535>and

625
00:31:20.535 --> 00:31:24.535
<00:31:20.535>therefore <00:31:20.690>you <00:31:20.846>can <00:31:21.001>read <00:31:21.157>from <00:31:21.312>self <00:31:21.468>by <00:31:21.623>calculating <00:31:21.779>the <00:31:21.935>area,

626
00:31:24.915 --> 00:31:26.935
<00:31:24.915>by <00:31:25.264>multiplying <00:31:25.615>with, <00:31:25.965>with <00:31:26.315>height.

627
00:31:28.305 --> 00:31:31.365
<00:31:28.305>And <00:31:28.480>large <00:31:28.655>is <00:31:28.830>another <00:31:29.005>example <00:31:29.180>of <00:31:29.355>a <00:31:29.530>bound <00:31:29.705>function,

628
00:31:31.485 --> 00:31:33.725
<00:31:31.485>a <00:31:31.718>function <00:31:31.951>bound <00:31:32.185>to <00:31:32.418>the <00:31:32.651>structure <00:31:32.885>rectangle.

629
00:31:33.835 --> 00:31:37.525
<00:31:33.835>This <00:31:33.990>case <00:31:34.146>it <00:31:34.301>gets <00:31:34.457>a <00:31:34.612>mutable <00:31:34.768>borrow <00:31:34.923>of <00:31:35.079>itself <00:31:35.235>and

630
00:31:37.525 --> 00:31:39.845
<00:31:37.525>therefore <00:31:37.805>we <00:31:38.085>can <00:31:38.365>change <00:31:38.645>the <00:31:38.925>content

631
00:31:40.185 --> 00:31:41.725
<00:31:40.185>of <00:31:40.531>the <00:31:40.878>rectangle <00:31:41.224>in <00:31:41.571>place.

632
00:31:42.105 --> 00:31:45.725
<00:31:42.105>So <00:31:42.245>we <00:31:42.385>can <00:31:42.525>in <00:31:42.665>line <00:31:42.805>11 <00:31:42.945>and <00:31:43.085>12 <00:31:43.225>change <00:31:43.365>the <00:31:43.505>X

633
00:31:45.745 --> 00:31:47.885
<00:31:45.745>and <00:31:46.094>y <00:31:46.445>coordinates <00:31:46.794>by <00:31:47.145>multiplying,

634
00:31:47.885 --> 00:31:49.605
<00:31:47.885>doing <00:31:48.165>some <00:31:48.445>multiplication, <00:31:48.725>some <00:31:49.004>basic <00:31:49.285>math.

635
00:31:49.645 --> 00:31:52.645
<00:31:49.645>I <00:31:49.761>think <00:31:49.878>you <00:31:49.995>get <00:31:50.111>the <00:31:50.228>point <00:31:50.345>here <00:31:50.461>on <00:31:50.578>the <00:31:50.695>right <00:31:50.811>hand <00:31:50.928>side <00:31:51.045>you

636
00:31:52.645 --> 00:31:56.485
<00:31:52.645>see <00:31:52.785>that <00:31:52.925>you <00:31:53.065>need <00:31:53.205>to <00:31:53.345>allocate <00:31:53.485>a <00:31:53.625>mutable <00:31:53.764>rectangle <00:31:53.905>in <00:31:54.045>order

637
00:31:56.485 --> 00:31:58.445
<00:31:56.485>to <00:31:56.718>be <00:31:56.951>able <00:31:57.185>to <00:31:57.418>call <00:31:57.651>enlarge <00:31:57.885>because

638
00:31:58.445 --> 00:32:01.845
<00:31:58.445>otherwise <00:31:58.678>you <00:31:58.911>couldn't <00:31:59.145>borrow <00:31:59.378>a <00:31:59.611>mutable <00:31:59.845>reference

639
00:32:01.905 --> 00:32:03.245
<00:32:01.905>to <00:32:02.307>the <00:32:02.708>enlarged <00:32:03.110>function.

640
00:32:05.045 --> 00:32:06.545
<00:32:05.045>The <00:32:05.315>second <00:32:05.585>example <00:32:05.855>here <00:32:06.125>is <00:32:06.395>circle

641
00:32:07.125 --> 00:32:10.625
<00:32:07.125>and <00:32:07.265>circle <00:32:07.405>contains, <00:32:07.545>as <00:32:07.685>you <00:32:07.825>can <00:32:07.965>see <00:32:08.105>it <00:32:08.245>here, <00:32:08.385>a <00:32:08.525>kind

642
00:32:10.625 --> 00:32:13.665
<00:32:10.625>of <00:32:10.800>constructive <00:32:10.975>function <00:32:11.150>unit <00:32:11.325>circle <00:32:11.500>gives <00:32:11.675>you <00:32:11.850>a <00:32:12.025>new

643
00:32:14.145 --> 00:32:16.465
<00:32:14.145>instance <00:32:14.425>of <00:32:14.705>circle <00:32:14.985>by <00:32:15.264>creating <00:32:15.545>it.

644
00:32:16.695 --> 00:32:18.025
<00:32:16.695>That <00:32:17.094>is <00:32:17.493>the <00:32:17.892>analogy

645
00:32:18.245 --> 00:32:21.465
<00:32:18.245>to <00:32:18.400>a <00:32:18.556>constructor <00:32:18.711>In <00:32:18.867>other <00:32:19.022>languages <00:32:19.178>there <00:32:19.333>isn't <00:32:19.489>a <00:32:19.645>notion

646
00:32:21.465 --> 00:32:23.145
<00:32:21.465>like <00:32:21.931>a <00:32:22.398>constructor <00:32:22.865>instructs.

647
00:32:23.365 --> 00:32:25.345
<00:32:23.365>You <00:32:23.715>create <00:32:24.065>such <00:32:24.415>constructor <00:32:24.765>functions

648
00:32:25.445 --> 00:32:29.705
<00:32:25.445>and <00:32:25.572>you <00:32:25.699>can <00:32:25.826>use <00:32:25.954>them <00:32:26.081>to <00:32:26.208>instantiate <00:32:26.335>in <00:32:26.463>this <00:32:26.590>case <00:32:26.717>a <00:32:26.845>circle.

649
00:32:29.845 --> 00:32:32.665
<00:32:29.845>So <00:32:29.985>an <00:32:30.125>instance <00:32:30.265>of <00:32:30.405>the <00:32:30.545>struct <00:32:30.685>on <00:32:30.825>the <00:32:30.965>right <00:32:31.105>hand <00:32:31.245>side.

650
00:32:32.845 --> 00:32:35.625
<00:32:32.845>In <00:32:33.000>line <00:32:33.156>one <00:32:33.311>you <00:32:33.467>see <00:32:33.622>how <00:32:33.778>unit <00:32:33.933>circle <00:32:34.089>is <00:32:34.245>used

651
00:32:38.415 --> 00:32:40.195
<00:32:38.415>once <00:32:38.881>you <00:32:39.348>discovered <00:32:39.815>structs.

652
00:32:40.215 --> 00:32:42.035
<00:32:40.215>The <00:32:40.415>next <00:32:40.615>thing <00:32:40.814>that <00:32:41.014>you <00:32:41.215>have <00:32:41.415>to <00:32:41.615>understand

653
00:32:42.385 --> 00:32:43.835
<00:32:42.385>with <00:32:42.820>rust <00:32:43.255>is <00:32:43.690>traits.

654
00:32:44.535 --> 00:32:47.875
<00:32:44.535>If <00:32:44.768>you <00:32:45.001>know <00:32:45.235>interfaces <00:32:45.468>from <00:32:45.701>other <00:32:45.935>languages,

655
00:32:48.255 --> 00:32:51.875
<00:32:48.255>you <00:32:48.410>have <00:32:48.566>a <00:32:48.721>rough <00:32:48.877>idea <00:32:49.032>about <00:32:49.188>what <00:32:49.343>traits <00:32:49.499>can <00:32:49.655>be.

656
00:32:52.735 --> 00:32:56.315
<00:32:52.735>Traits <00:32:52.935>like <00:32:53.135>in <00:32:53.334>line <00:32:53.534>one <00:32:53.735>are <00:32:53.935>kind <00:32:54.135>of

657
00:32:57.065 --> 00:33:00.395
<00:32:57.065>collections <00:32:57.265>of <00:32:57.465>functions <00:32:57.665>that <00:32:57.865>have <00:32:58.065>to <00:32:58.265>be <00:32:58.465>implemented

658
00:33:00.535 --> 00:33:03.035
<00:33:00.535>by <00:33:00.768>obstructing <00:33:01.001>order <00:33:01.235>to <00:33:01.468>implement <00:33:01.701>the <00:33:01.935>trait.

659
00:33:03.775 --> 00:33:07.715
<00:33:03.775>In <00:33:03.915>this <00:33:04.055>example <00:33:04.195>I <00:33:04.335>created <00:33:04.475>the <00:33:04.615>area <00:33:04.755>trait <00:33:04.895>which <00:33:05.035>requires <00:33:05.175>the

660
00:33:07.715 --> 00:33:11.235
<00:33:07.715>existence <00:33:07.889>of <00:33:08.064>an <00:33:08.240>area <00:33:08.415>function <00:33:08.590>which <00:33:08.764>borrows <00:33:08.939>an <00:33:09.115>instance

661
00:33:11.335 --> 00:33:14.355
<00:33:11.335>of <00:33:11.535>the <00:33:11.735>object <00:33:11.935>and <00:33:12.135>returns <00:33:12.335>the <00:33:12.535>calculated <00:33:12.735>area

662
00:33:14.495 --> 00:33:16.115
<00:33:14.495>as <00:33:14.844>a <00:33:15.195>float <00:33:15.544>32 <00:33:15.895>bit.

663
00:33:16.935 --> 00:33:20.875
<00:33:16.935>And <00:33:17.051>then <00:33:17.168>in <00:33:17.284>line <00:33:17.401>five <00:33:17.518>you <00:33:17.635>see <00:33:17.751>how <00:33:17.868>I <00:33:17.985>implement <00:33:18.101>the <00:33:18.218>area <00:33:18.335>trait

664
00:33:21.015 --> 00:33:25.155
<00:33:21.015>for <00:33:21.190>the <00:33:21.365>rectangle <00:33:21.540>by <00:33:21.715>saying <00:33:21.890>implement <00:33:22.065>area <00:33:22.240>for <00:33:22.415>rec.

665
00:33:25.695 --> 00:33:28.235
<00:33:25.695>Of <00:33:25.870>course <00:33:26.044>I <00:33:26.220>can <00:33:26.395>also <00:33:26.570>implement <00:33:26.745>area <00:33:26.919>for <00:33:27.095>circle

666
00:33:28.575 --> 00:33:30.755
<00:33:28.575>as <00:33:28.715>you <00:33:28.855>can <00:33:28.995>see <00:33:29.135>it <00:33:29.275>for <00:33:29.415>in <00:33:29.555>line <00:33:29.695>11 <00:33:29.835>and <00:33:29.975>further.

667
00:33:32.175 --> 00:33:35.195
<00:33:32.175>Now <00:33:32.315>let's <00:33:32.455>take <00:33:32.595>a <00:33:32.735>look <00:33:32.875>at <00:33:33.014>how <00:33:33.155>we <00:33:33.294>can <00:33:33.435>use <00:33:33.575>traits.

668
00:33:36.335 --> 00:33:39.755
<00:33:36.335>On <00:33:36.462>the <00:33:36.589>right <00:33:36.716>hand <00:33:36.844>side <00:33:36.971>you <00:33:37.098>see <00:33:37.225>that <00:33:37.353>I <00:33:37.480>create <00:33:37.607>a <00:33:37.735>shape

669
00:33:39.905 --> 00:33:43.795
<00:33:39.905>with <00:33:40.045>area <00:33:40.185>and <00:33:40.325>assign <00:33:40.465>it <00:33:40.605>to <00:33:40.745>a <00:33:40.885>reference <00:33:41.024>of <00:33:41.165>a <00:33:41.305>rectangle.

670
00:33:43.895 --> 00:33:46.035
<00:33:43.895>And <00:33:44.128>the <00:33:44.361>important <00:33:44.595>thing <00:33:44.828>is <00:33:45.061>the <00:33:45.295>dynamic

671
00:33:46.675 --> 00:33:47.755
<00:33:46.675>reference <00:33:46.999>in <00:33:47.323>line <00:33:47.647>five.

672
00:33:47.895 --> 00:33:49.635
<00:33:47.895>You <00:33:48.095>see <00:33:48.295>it <00:33:48.495>here <00:33:48.695>in <00:33:48.895>the <00:33:49.095>yellow <00:33:49.295>rectangle.

673
00:33:49.665 --> 00:33:51.355
<00:33:49.665>That <00:33:50.014>means <00:33:50.365>that <00:33:50.715>the <00:33:51.065>resolution

674
00:33:51.375 --> 00:33:54.475
<00:33:51.375>of <00:33:51.550>the <00:33:51.725>functions <00:33:51.900>is <00:33:52.075>done <00:33:52.250>dynamically <00:33:52.425>based <00:33:52.600>on <00:33:52.775>the

675
00:33:54.645 --> 00:33:55.675
<00:33:54.645>underlying <00:33:55.572>type.

676
00:33:56.295 --> 00:33:59.875
<00:33:56.295>So <00:33:56.450>area <00:33:56.606>from <00:33:56.761>rectangle <00:33:56.917>is <00:33:57.072>called <00:33:57.228>if <00:33:57.383>shaped <00:33:57.539>with <00:33:57.695>area

677
00:33:59.935 --> 00:34:01.635
<00:33:59.935>as <00:34:00.401>a <00:34:00.868>rectangle <00:34:01.335>circle.

678
00:34:01.665 --> 00:34:04.275
<00:34:01.665>That <00:34:01.840>area <00:34:02.014>is <00:34:02.190>called <00:34:02.365>if <00:34:02.540>it <00:34:02.715>is <00:34:02.889>a <00:34:03.065>circle.

679
00:34:05.425 --> 00:34:07.685
<00:34:05.425>Of <00:34:05.600>course <00:34:05.774>you <00:34:05.950>can <00:34:06.125>also <00:34:06.300>use <00:34:06.475>it <00:34:06.649>with <00:34:06.825>vectors.

680
00:34:07.685 --> 00:34:10.685
<00:34:07.685>For <00:34:07.840>instance, <00:34:07.996>in <00:34:08.151>this <00:34:08.307>case <00:34:08.462>I <00:34:08.618>am <00:34:08.773>allocating <00:34:08.929>a <00:34:09.085>vector

681
00:34:11.145 --> 00:34:12.765
<00:34:11.145>of <00:34:11.844>area <00:34:12.545>objects

682
00:34:12.945 --> 00:34:15.765
<00:34:12.945>and <00:34:13.120>then <00:34:13.295>I'm <00:34:13.470>pushing <00:34:13.645>a <00:34:13.820>reference <00:34:13.995>to <00:34:14.170>a <00:34:14.345>rectangle

683
00:34:16.345 --> 00:34:18.205
<00:34:16.344>and <00:34:16.544>the <00:34:16.745>reference <00:34:16.944>to <00:34:17.145>the <00:34:17.344>circle <00:34:17.544>on <00:34:17.745>the

684
00:34:18.275 --> 00:34:19.925
<00:34:18.275>heap <00:34:18.625>directly <00:34:18.975>in <00:34:19.325>the <00:34:19.675>vector.

685
00:34:20.785 --> 00:34:22.805
<00:34:20.784>That's <00:34:21.065>interesting <00:34:21.344>because <00:34:21.625>you <00:34:21.904>see <00:34:22.185>here

686
00:34:22.835 --> 00:34:24.685
<00:34:22.835>that <00:34:23.115>I <00:34:23.395>can <00:34:23.675>push <00:34:23.955>a <00:34:24.235>reference

687
00:34:24.685 --> 00:34:25.925
<00:34:24.685>to <00:34:24.908>something <00:34:25.131>leaning <00:34:25.354>on <00:34:25.577>the <00:34:25.801>stack

688
00:34:26.385 --> 00:34:28.845
<00:34:26.385>and <00:34:26.560>something <00:34:26.735>leaning <00:34:26.910>on <00:34:27.085>the <00:34:27.260>heap <00:34:27.435>into <00:34:27.610>a <00:34:27.785>vector

689
00:34:29.265 --> 00:34:31.285
<00:34:29.264>and <00:34:29.464>then <00:34:29.665>consume <00:34:29.864>it <00:34:30.065>in <00:34:30.264>a <00:34:30.464>four <00:34:30.665>loop

690
00:34:31.305 --> 00:34:32.565
<00:34:31.304>as <00:34:31.493>you <00:34:31.683>can <00:34:31.871>see <00:34:32.061>in <00:34:32.250>line <00:34:32.438>12.

691
00:34:33.625 --> 00:34:35.925
<00:34:33.625>So <00:34:33.800>this <00:34:33.975>is <00:34:34.150>what <00:34:34.324>basic <00:34:34.500>traits <00:34:34.675>are <00:34:34.850>all <00:34:35.025>about,

692
00:34:36.305 --> 00:34:40.325
<00:34:36.304>but <00:34:36.460>traits <00:34:36.616>in <00:34:36.771>rust <00:34:36.927>are <00:34:37.082>used <00:34:37.238>all <00:34:37.393>over <00:34:37.549>the <00:34:37.705>place.

693
00:34:41.105 --> 00:34:44.965
<00:34:41.105>And <00:34:41.245>here <00:34:41.385>you <00:34:41.525>see <00:34:41.665>two <00:34:41.804>important <00:34:41.945>system <00:34:42.085>traits <00:34:42.225>that <00:34:42.365>you <00:34:42.505>have

694
00:34:44.965 --> 00:34:48.165
<00:34:44.965>that <00:34:45.105>that <00:34:45.245>are <00:34:45.385>great <00:34:45.525>to <00:34:45.665>describe <00:34:45.805>the <00:34:45.945>con <00:34:46.085>the <00:34:46.225>the <00:34:46.365>concept

695
00:34:48.185 --> 00:34:51.485
<00:34:48.185>of <00:34:48.301>traits <00:34:48.418>and <00:34:48.534>how <00:34:48.651>it <00:34:48.768>is <00:34:48.884>used <00:34:49.001>in <00:34:49.118>the <00:34:49.235>base <00:34:49.351>library <00:34:49.468>in <00:34:49.585>the

696
00:34:51.605 --> 00:34:52.645
<00:34:51.605>standard <00:34:51.917>library <00:34:52.228>of <00:34:52.541>rust.

697
00:34:53.315 --> 00:34:55.005
<00:34:53.315>Take <00:34:53.548>a <00:34:53.781>look <00:34:54.014>at <00:34:54.248>the <00:34:54.481>display <00:34:54.715>trait.

698
00:34:55.425 --> 00:34:57.765
<00:34:55.425>The <00:34:55.625>display <00:34:55.825>trait <00:34:56.025>was <00:34:56.225>not <00:34:56.425>defined <00:34:56.625>by <00:34:56.825>me,

699
00:34:58.065 --> 00:35:00.725
<00:34:58.065>but <00:34:58.240>it <00:34:58.415>is <00:34:58.590>defined <00:34:58.765>by <00:34:58.940>the <00:34:59.115>rest <00:34:59.290>standard <00:34:59.465>library.

700
00:35:01.725 --> 00:35:04.485
<00:35:01.725>I <00:35:01.880>can <00:35:02.036>implement <00:35:02.191>it <00:35:02.347>for <00:35:02.502>a <00:35:02.658>data <00:35:02.813>structure <00:35:02.969>like <00:35:03.125>point.

701
00:35:05.065 --> 00:35:08.645
<00:35:05.065>To <00:35:05.220>make <00:35:05.376>a <00:35:05.531>long <00:35:05.687>story <00:35:05.842>short <00:35:05.998>in <00:35:06.153>display <00:35:06.309>I <00:35:06.465>have

702
00:35:08.645 --> 00:35:12.005
<00:35:08.645>to <00:35:08.820>provide <00:35:08.995>a <00:35:09.170>text <00:35:09.345>representation <00:35:09.520>for <00:35:09.695>my <00:35:09.870>data <00:35:10.045>structure.

703
00:35:12.345 --> 00:35:14.245
<00:35:12.345>Please <00:35:12.578>take <00:35:12.811>a <00:35:13.044>look <00:35:13.278>in <00:35:13.511>line <00:35:13.745>13

704
00:35:14.755 --> 00:35:17.445
<00:35:14.755>here <00:35:14.988>I'm <00:35:15.221>just <00:35:15.455>building <00:35:15.688>a <00:35:15.921>text <00:35:16.155>representation

705
00:35:17.795 --> 00:35:20.645
<00:35:17.795>with <00:35:18.075>some <00:35:18.355>JSO <00:35:18.635>like <00:35:18.915>data <00:35:19.195>structures

706
00:35:21.645 --> 00:35:23.665
<00:35:21.645>and <00:35:21.845>implement <00:35:22.045>the <00:35:22.245>display <00:35:22.445>trait <00:35:22.645>with <00:35:22.845>that <00:35:23.045>and

707
00:35:23.665 --> 00:35:27.065
<00:35:23.665>therefore <00:35:23.792>I <00:35:23.919>can <00:35:24.046>take <00:35:24.174>a <00:35:24.301>look <00:35:24.428>at <00:35:24.555>the <00:35:24.683>bottom <00:35:24.810>in <00:35:24.937>line <00:35:25.065>two,

708
00:35:27.405 --> 00:35:28.785
<00:35:27.405>use <00:35:27.715>the <00:35:28.026>print <00:35:28.336>line <00:35:28.647>macro.

709
00:35:28.965 --> 00:35:32.385
<00:35:28.965>You <00:35:29.105>will <00:35:29.245>see <00:35:29.385>macros <00:35:29.525>in <00:35:29.665>a <00:35:29.805>second <00:35:29.945>to <00:35:30.085>display <00:35:30.225>the <00:35:30.365>origin,

710
00:35:32.395 --> 00:35:33.745
<00:35:32.395>which <00:35:32.638>is, <00:35:32.881>which <00:35:33.124>is <00:35:33.366>a <00:35:33.609>point.

711
00:35:34.505 --> 00:35:37.445
<00:35:34.505>And <00:35:34.660>the <00:35:34.816>print <00:35:34.971>line <00:35:35.127>macro <00:35:35.282>will <00:35:35.438>use <00:35:35.593>the <00:35:35.749>display <00:35:35.905>trait

712
00:35:37.625 --> 00:35:39.765
<00:35:37.625>to <00:35:37.858>turn <00:35:38.091>my <00:35:38.325>struct <00:35:38.558>into <00:35:38.791>a <00:35:39.025>strain.

713
00:35:40.895 --> 00:35:43.665
<00:35:40.895>Another <00:35:41.175>example <00:35:41.455>is <00:35:41.735>the <00:35:42.015>add <00:35:42.295>trait.

714
00:35:43.805 --> 00:35:46.305
<00:35:43.805>It <00:35:44.004>is <00:35:44.205>a <00:35:44.404>generic <00:35:44.605>trait, <00:35:44.805>it <00:35:45.004>allows <00:35:45.205>me

715
00:35:46.305 --> 00:35:50.065
<00:35:46.305>to <00:35:46.460>define <00:35:46.616>the <00:35:46.771>behavior <00:35:46.927>which <00:35:47.082>should <00:35:47.238>be <00:35:47.393>executed <00:35:47.549>when <00:35:47.705>I

716
00:35:50.245 --> 00:35:51.385
<00:35:50.245>add <00:35:50.758>to <00:35:51.271>points.

717
00:35:51.685 --> 00:35:55.545
<00:35:51.685>You <00:35:51.860>see <00:35:52.035>the <00:35:52.210>business <00:35:52.384>logic <00:35:52.560>in <00:35:52.735>line <00:35:52.910>six <00:35:53.085>down

718
00:35:55.555 --> 00:35:56.825
<00:35:55.555>below <00:35:55.935>in <00:35:56.317>line <00:35:56.698>three.

719
00:35:57.405 --> 00:35:59.385
<00:35:57.405>You <00:35:57.638>see <00:35:57.871>what, <00:35:58.105>what <00:35:58.338>is <00:35:58.571>the <00:35:58.805>result

720
00:35:59.385 --> 00:36:01.625
<00:35:59.385>of <00:35:59.665>implementing <00:35:59.945>the <00:36:00.225>system <00:36:00.505>add <00:36:00.785>trait.

721
00:36:02.485 --> 00:36:05.065
<00:36:02.485>The <00:36:02.640>result <00:36:02.796>is <00:36:02.951>that <00:36:03.107>I <00:36:03.262>can <00:36:03.418>use <00:36:03.573>the <00:36:03.729>operator <00:36:03.885>plus

722
00:36:05.285 --> 00:36:06.505
<00:36:05.285>to <00:36:05.651>add <00:36:06.017>two <00:36:06.383>points.

723
00:36:07.165 --> 00:36:10.305
<00:36:07.165>So <00:36:07.320>you <00:36:07.476>can <00:36:07.631>see <00:36:07.787>that <00:36:07.942>traits <00:36:08.098>are <00:36:08.253>really <00:36:08.409>a <00:36:08.565>basic,

724
00:36:10.505 --> 00:36:13.945
<00:36:10.505>a <00:36:10.660>foundational <00:36:10.816>building <00:36:10.971>block <00:36:11.127>of <00:36:11.282>the <00:36:11.438>type <00:36:11.593>system <00:36:11.749>of <00:36:11.905>rust.

725
00:36:16.325 --> 00:36:20.145
<00:36:16.325>Now <00:36:16.480>you <00:36:16.636>have <00:36:16.791>seen <00:36:16.947>multiple <00:36:17.102>times <00:36:17.258>these <00:36:17.413>exclamation <00:36:17.569>marks <00:36:17.725>at

726
00:36:20.145 --> 00:36:23.745
<00:36:20.145>the <00:36:20.320>end <00:36:20.495>of <00:36:20.670>some <00:36:20.845>words <00:36:21.020>like <00:36:21.195>ve <00:36:21.370>exclamation <00:36:21.545>mark

727
00:36:23.765 --> 00:36:27.945
<00:36:23.765>or <00:36:23.940>print <00:36:24.115>line <00:36:24.290>exclamation <00:36:24.464>mark <00:36:24.640>macros <00:36:24.815>are <00:36:24.990>behind <00:36:25.165>that.

728
00:36:28.605 --> 00:36:32.065
<00:36:28.605>Macros <00:36:28.745>can <00:36:28.885>exist <00:36:29.025>as, <00:36:29.165>as <00:36:29.305>you <00:36:29.445>can <00:36:29.585>see <00:36:29.725>here <00:36:29.865>on <00:36:30.005>top

729
00:36:32.065 --> 00:36:33.945
<00:36:32.065>of <00:36:32.415>the <00:36:32.765>struck <00:36:33.115>point <00:36:33.465>here.

730
00:36:34.525 --> 00:36:36.545
<00:36:34.525>And <00:36:34.805>this <00:36:35.085>macro <00:36:35.365>is <00:36:35.645>an <00:36:35.925>example

731
00:36:37.685 --> 00:36:40.145
<00:36:37.685>to <00:36:38.035>auto <00:36:38.384>generate <00:36:38.735>an <00:36:39.085>implementation

732
00:36:40.285 --> 00:36:42.585
<00:36:40.285>of <00:36:40.565>a <00:36:40.845>trait <00:36:41.125>for <00:36:41.404>the <00:36:41.685>structure.

733
00:36:43.035 --> 00:36:45.625
<00:36:43.035>Don't <00:36:43.210>get <00:36:43.384>me <00:36:43.560>wrong, <00:36:43.734>you <00:36:43.910>cannot <00:36:44.085>just <00:36:44.259>use <00:36:44.435>macros

734
00:36:45.625 --> 00:36:46.625
<00:36:45.625>for <00:36:46.075>implementing <00:36:46.525>traits.

735
00:36:46.625 --> 00:36:50.225
<00:36:46.625>You <00:36:46.780>can <00:36:46.936>uh, <00:36:47.091>you <00:36:47.247>can <00:36:47.402>use <00:36:47.558>macros <00:36:47.713>to <00:36:47.869>generate <00:36:48.025>code

736
00:36:51.015 --> 00:36:53.225
<00:36:51.015>that <00:36:51.214>does <00:36:51.415>anything <00:36:51.615>that <00:36:51.815>comes <00:36:52.015>to <00:36:52.214>your <00:36:52.415>mind.

737
00:36:53.245 --> 00:36:56.905
<00:36:53.245>In <00:36:53.384>this <00:36:53.525>case, <00:36:53.665>I'm <00:36:53.805>using <00:36:53.944>the <00:36:54.085>system <00:36:54.225>derive <00:36:54.365>macro <00:36:54.505>telling <00:36:54.645>the

738
00:36:56.905 --> 00:36:59.345
<00:36:56.905>system <00:36:57.138>to <00:36:57.371>autogenerate <00:36:57.605>the <00:36:57.838>so-called <00:36:58.071>debug <00:36:58.305>trait.

739
00:36:59.725 --> 00:37:01.585
<00:36:59.725>And <00:36:59.958>the <00:37:00.191>debug <00:37:00.424>trait <00:37:00.658>will <00:37:00.891>make <00:37:01.125>sure

740
00:37:01.775 --> 00:37:04.785
<00:37:01.775>that <00:37:01.950>I <00:37:02.125>can <00:37:02.300>use <00:37:02.475>debug <00:37:02.650>output <00:37:02.825>for <00:37:03.000>my <00:37:03.175>structure

741
00:37:05.405 --> 00:37:08.505
<00:37:05.405>and <00:37:05.545>in <00:37:05.685>this <00:37:05.825>case <00:37:05.965>it <00:37:06.105>will <00:37:06.245>just <00:37:06.385>take <00:37:06.525>this, <00:37:06.665>the <00:37:06.805>elements

742
00:37:08.505 --> 00:37:11.705
<00:37:08.505>of <00:37:08.645>my <00:37:08.785>point, <00:37:08.925>which <00:37:09.065>are <00:37:09.205>two <00:37:09.345>basic <00:37:09.485>data <00:37:09.625>types <00:37:09.765>like <00:37:09.905>floats.

743
00:37:12.005 --> 00:37:14.865
<00:37:12.005>So <00:37:12.160>just <00:37:12.316>data <00:37:12.471>types <00:37:12.627>which <00:37:12.782>also <00:37:12.938>implement <00:37:13.093>the <00:37:13.249>debug <00:37:13.405>trait

744
00:37:15.125 --> 00:37:18.745
<00:37:15.125>to <00:37:15.325>generate <00:37:15.525>another <00:37:15.725>higher <00:37:15.925>abstraction <00:37:16.125>level <00:37:16.325>debug <00:37:16.525>trait

745
00:37:18.805 --> 00:37:21.705
<00:37:18.805>for <00:37:18.960>me <00:37:19.116>automatically <00:37:19.271>I <00:37:19.427>do <00:37:19.582>not <00:37:19.738>need <00:37:19.893>to <00:37:20.049>write <00:37:20.205>code.

746
00:37:21.855 --> 00:37:24.225
<00:37:21.855>This <00:37:22.030>is <00:37:22.205>done <00:37:22.380>during <00:37:22.555>compiled <00:37:22.730>time, <00:37:22.905>not <00:37:23.080>during <00:37:23.255>runtime.

747
00:37:24.225 --> 00:37:27.065
<00:37:24.225>The <00:37:24.380>code <00:37:24.536>generation <00:37:24.691>here. <00:37:24.847>So <00:37:25.002>this <00:37:25.158>is <00:37:25.313>an <00:37:25.469>alternative <00:37:25.625>to

748
00:37:27.065 --> 00:37:28.425
<00:37:27.065>what <00:37:27.473>in <00:37:27.881>many <00:37:28.289>uh,

749
00:37:28.425 --> 00:37:30.665
<00:37:28.425>managed <00:37:28.705>languages <00:37:28.985>is <00:37:29.265>done <00:37:29.545>through <00:37:29.825>reflection.

750
00:37:30.685 --> 00:37:34.495
<00:37:30.685>For <00:37:30.825>instance, <00:37:30.965>or <00:37:31.105>this <00:37:31.245>example <00:37:31.384>here, <00:37:31.525>this <00:37:31.665>you <00:37:31.805>have <00:37:31.945>seen <00:37:32.085>this

751
00:37:34.495 --> 00:37:37.015
<00:37:34.495>before, <00:37:34.694>this <00:37:34.895>WAC <00:37:35.095>estimation <00:37:35.295>mark <00:37:35.495>is <00:37:35.694>a <00:37:35.895>macro

752
00:37:37.325 --> 00:37:41.455
<00:37:37.325>that <00:37:37.464>makes <00:37:37.605>it <00:37:37.745>easier <00:37:37.884>to <00:37:38.024>create <00:37:38.165>a <00:37:38.305>vector <00:37:38.444>of <00:37:38.585>things <00:37:38.725>and

753
00:37:41.455 --> 00:37:45.135
<00:37:41.455>therefore <00:37:41.582>if <00:37:41.709>you <00:37:41.836>do <00:37:41.964>that <00:37:42.091>you <00:37:42.218>can <00:37:42.345>use <00:37:42.473>the <00:37:42.600>print <00:37:42.727>line <00:37:42.855>macro

754
00:37:45.465 --> 00:37:49.055
<00:37:45.465>which <00:37:45.665>will <00:37:45.865>care <00:37:46.065>for <00:37:46.265>displaying <00:37:46.465>the <00:37:46.665>formatted <00:37:46.865>output

755
00:37:49.075 --> 00:37:51.855
<00:37:49.075>as <00:37:49.250>specified <00:37:49.424>here <00:37:49.600>in <00:37:49.774>line <00:37:49.950>five <00:37:50.125>on <00:37:50.299>standard <00:37:50.475>out.

756
00:37:52.075 --> 00:37:54.335
<00:37:52.075>You <00:37:52.230>do <00:37:52.386>not <00:37:52.541>need <00:37:52.697>to <00:37:52.852>write <00:37:53.008>many <00:37:53.163>lines <00:37:53.319>of <00:37:53.475>codes

757
00:37:54.335 --> 00:37:56.055
<00:37:54.335>to <00:37:54.568>print <00:37:54.801>something <00:37:55.035>formatted <00:37:55.268>on <00:37:55.501>the <00:37:55.735>screen.

758
00:37:56.075 --> 00:37:58.095
<00:37:56.075>You <00:37:56.250>can <00:37:56.424>just <00:37:56.600>just <00:37:56.774>use <00:37:56.950>a <00:37:57.125>macro <00:37:57.299>for <00:37:57.475>it.

759
00:37:58.475 --> 00:38:00.735
<00:37:58.475>So <00:37:58.755>macros <00:37:59.035>are <00:37:59.315>again <00:37:59.595>very <00:37:59.875>important.

760
00:38:03.205 --> 00:38:05.465
<00:38:03.205>The <00:38:03.332>next <00:38:03.459>thing <00:38:03.586>that <00:38:03.714>I <00:38:03.841>would <00:38:03.968>like <00:38:04.095>to <00:38:04.223>speak <00:38:04.350>about <00:38:04.477>are <00:38:04.605>ens.

761
00:38:06.385 --> 00:38:09.745
<00:38:06.385>I <00:38:06.525>guess <00:38:06.665>you <00:38:06.805>know <00:38:06.945>what <00:38:07.085>enums <00:38:07.225>are <00:38:07.365>from <00:38:07.505>languages <00:38:07.645>like <00:38:07.785>Java,

762
00:38:09.895 --> 00:38:11.705
<00:38:09.895>like <00:38:10.245>C <00:38:10.595>sharp <00:38:10.945>or <00:38:11.295>TypeScript.

763
00:38:12.285 --> 00:38:15.105
<00:38:12.285>But <00:38:12.518>enums <00:38:12.751>in <00:38:12.984>rust <00:38:13.218>are <00:38:13.451>more <00:38:13.685>powerful

764
00:38:15.175 --> 00:38:17.705
<00:38:15.175>because <00:38:15.350>enums, <00:38:15.525>as <00:38:15.700>you <00:38:15.875>can <00:38:16.050>see <00:38:16.225>in <00:38:16.400>line <00:38:16.575>eight

765
00:38:18.085 --> 00:38:19.905
<00:38:18.085>and <00:38:18.435>nine <00:38:18.785>can <00:38:19.135>have <00:38:19.485>values.

766
00:38:20.405 --> 00:38:21.905
<00:38:20.405>So <00:38:20.742>think <00:38:21.080>about <00:38:21.417>poker <00:38:21.755>moves.

767
00:38:22.025 --> 00:38:23.145
<00:38:22.025>I <00:38:22.193>don't <00:38:22.361>know <00:38:22.529>if <00:38:22.697>you <00:38:22.865>played <00:38:23.033>poker

768
00:38:23.205 --> 00:38:24.385
<00:38:23.205>or <00:38:23.417>if <00:38:23.629>you <00:38:23.842>ever <00:38:24.054>played <00:38:24.267>poker,

769
00:38:24.765 --> 00:38:27.585
<00:38:24.765>but <00:38:24.920>in <00:38:25.076>poker <00:38:25.231>it <00:38:25.387>is <00:38:25.542>possible <00:38:25.698>to <00:38:25.853>call <00:38:26.009>a <00:38:26.165>hand.

770
00:38:27.775 --> 00:38:30.225
<00:38:27.775>That <00:38:27.950>means <00:38:28.125>you <00:38:28.300>have <00:38:28.475>to <00:38:28.650>place <00:38:28.825>the <00:38:29.000>same <00:38:29.175>amount

771
00:38:30.225 --> 00:38:32.505
<00:38:30.225>of <00:38:30.365>money <00:38:30.505>into <00:38:30.645>the <00:38:30.785>pot <00:38:30.924>that <00:38:31.065>is <00:38:31.205>already <00:38:31.345>in <00:38:31.485>the <00:38:31.625>pot

772
00:38:32.845 --> 00:38:36.245
<00:38:32.845>or <00:38:32.984>you <00:38:33.125>can <00:38:33.265>raise, <00:38:33.404>so <00:38:33.544>you <00:38:33.685>have <00:38:33.825>to <00:38:33.964>p <00:38:34.105>you <00:38:34.245>have

773
00:38:36.245 --> 00:38:38.085
<00:38:36.245>to <00:38:36.444>put <00:38:36.645>even <00:38:36.845>more <00:38:37.045>money <00:38:37.245>into <00:38:37.444>the <00:38:37.645>pot.

774
00:38:38.745 --> 00:38:39.805
<00:38:38.745>And <00:38:38.935>as <00:38:39.126>you <00:38:39.317>can <00:38:39.508>see <00:38:39.698>here,

775
00:38:39.945 --> 00:38:43.205
<00:38:39.945>the <00:38:40.100>Enum <00:38:40.256>poker <00:38:40.411>move <00:38:40.567>contains <00:38:40.722>a <00:38:40.878>fold <00:38:41.033>means <00:38:41.189>I'm <00:38:41.345>stopping,

776
00:38:43.305 --> 00:38:45.925
<00:38:43.305>I'm <00:38:43.480>no <00:38:43.654>longer <00:38:43.830>playing, <00:38:44.004>calling <00:38:44.180>and <00:38:44.355>raising <00:38:44.529>and <00:38:44.705>calling

777
00:38:45.945 --> 00:38:48.405
<00:38:45.945>and <00:38:46.178>raising <00:38:46.411>get <00:38:46.645>parameters <00:38:46.878>to <00:38:47.111>the <00:38:47.345>enum.

778
00:38:48.585 --> 00:38:51.645
<00:38:48.585>That's <00:38:48.785>a <00:38:48.985>special <00:38:49.185>case <00:38:49.385>for <00:38:49.585>enums <00:38:49.785>in <00:38:49.985>rust.

779
00:38:52.265 --> 00:38:55.965
<00:38:52.265>And <00:38:52.420>enums <00:38:52.576>are <00:38:52.731>also <00:38:52.887>exactly <00:38:53.042>as <00:38:53.198>powerful <00:38:53.353>as <00:38:53.509>structures <00:38:53.665>are.

780
00:38:56.235 --> 00:38:58.285
<00:38:56.235>They <00:38:56.435>can <00:38:56.635>implement <00:38:56.835>traits <00:38:57.035>and <00:38:57.235>things <00:38:57.435>like <00:38:57.635>that.

781
00:39:00.055 --> 00:39:02.325
<00:39:00.055>Enums <00:39:00.404>are <00:39:00.754>additionally <00:39:01.105>deeply <00:39:01.455>integrated

782
00:39:02.355 --> 00:39:03.565
<00:39:02.355>into <00:39:02.572>the <00:39:02.790>rest <00:39:03.008>of <00:39:03.226>the <00:39:03.444>language.

783
00:39:03.955 --> 00:39:05.965
<00:39:03.955>Take <00:39:04.154>a <00:39:04.355>look <00:39:04.555>at <00:39:04.755>the <00:39:04.955>match <00:39:05.154>statement <00:39:05.355>here.

784
00:39:06.505 --> 00:39:10.045
<00:39:06.505>The <00:39:06.705>match <00:39:06.905>statement <00:39:07.105>allows <00:39:07.305>you <00:39:07.505>to <00:39:07.705>specify <00:39:07.905>all

785
00:39:10.805 --> 00:39:13.525
<00:39:10.805>possible <00:39:11.085>um, <00:39:11.365>values <00:39:11.645>of <00:39:11.924>the <00:39:12.205>enum

786
00:39:13.865 --> 00:39:18.405
<00:39:13.865>and <00:39:13.981>rust <00:39:14.098>will <00:39:14.214>make <00:39:14.331>sure <00:39:14.448>that <00:39:14.564>you <00:39:14.681>do <00:39:14.798>not <00:39:14.915>forget <00:39:15.031>a <00:39:15.148>single, <00:39:15.265>um,

787
00:39:18.725 --> 00:39:20.845
<00:39:18.725>a <00:39:18.900>single <00:39:19.075>value <00:39:19.250>that <00:39:19.424>is <00:39:19.600>possible <00:39:19.775>in <00:39:19.950>the <00:39:20.125>enum.

788
00:39:20.865 --> 00:39:24.925
<00:39:20.865>So <00:39:21.004>if <00:39:21.145>you <00:39:21.285>don't <00:39:21.424>have <00:39:21.564>the <00:39:21.705>line <00:39:21.845>five <00:39:21.984>default <00:39:22.125>value <00:39:22.265>here,

789
00:39:24.985 --> 00:39:27.685
<00:39:24.985>it <00:39:25.140>would <00:39:25.296>raise <00:39:25.451>a <00:39:25.607>run <00:39:25.762>a, <00:39:25.918>a <00:39:26.073>compiled <00:39:26.229>time <00:39:26.385>exception

790
00:39:27.685 --> 00:39:32.165
<00:39:27.685>because <00:39:27.840>you <00:39:27.996>have <00:39:28.151>to <00:39:28.307>specify <00:39:28.462>at <00:39:28.618>defined <00:39:28.773>behavior <00:39:28.929>for <00:39:29.085>every,

791
00:39:32.505 --> 00:39:35.525
<00:39:32.505>for <00:39:32.660>every <00:39:32.816>value <00:39:32.971>of <00:39:33.127>the <00:39:33.282>enum, <00:39:33.438>you <00:39:33.593>cannot <00:39:33.749>forget <00:39:33.905>anything.

792
00:39:35.895 --> 00:39:38.125
<00:39:35.895>Again, <00:39:36.175>that's <00:39:36.455>a <00:39:36.735>question <00:39:37.015>of <00:39:37.295>safetiness.

793
00:39:39.345 --> 00:39:42.335
<00:39:39.345>Enums <00:39:39.544>are <00:39:39.745>widely <00:39:39.944>used <00:39:40.145>inside <00:39:40.345>the <00:39:40.544>standard <00:39:40.745>library.

794
00:39:42.835 --> 00:39:46.095
<00:39:42.835>For <00:39:42.975>instance, <00:39:43.115>I <00:39:43.255>would <00:39:43.395>like <00:39:43.535>to <00:39:43.675>point <00:39:43.815>out <00:39:43.955>the <00:39:44.095>option <00:39:44.235>enum.

795
00:39:46.125 --> 00:39:47.895
<00:39:46.125>It's <00:39:46.358>part <00:39:46.591>of <00:39:46.825>the <00:39:47.058>rust <00:39:47.291>standard <00:39:47.525>library

796
00:39:48.515 --> 00:39:51.855
<00:39:48.515>and <00:39:48.670>it <00:39:48.826>is <00:39:48.981>the <00:39:49.137>uh, <00:39:49.292>it <00:39:49.448>is <00:39:49.603>the <00:39:49.759>the <00:39:49.915>replacement

797
00:39:51.855 --> 00:39:53.455
<00:39:51.855>of <00:39:52.321>null <00:39:52.788>by <00:39:53.255>default.

798
00:39:53.555 --> 00:39:57.975
<00:39:53.555>If <00:39:53.710>you're <00:39:53.866>not <00:39:54.021>using <00:39:54.177>some <00:39:54.332>unsafe <00:39:54.488>pointer <00:39:54.643>magic <00:39:54.799>by <00:39:54.955>default,

799
00:39:58.175 --> 00:39:59.735
<00:39:58.175>a <00:39:58.408>variable <00:39:58.641>in <00:39:58.875>rust <00:39:59.108>cannot <00:39:59.341>be <00:39:59.575>null.

800
00:39:59.755 --> 00:40:03.655
<00:39:59.755>It <00:39:59.895>is <00:40:00.035>not <00:40:00.175>possible. <00:40:00.315>But <00:40:00.455>at <00:40:00.595>some <00:40:00.735>point <00:40:00.875>you <00:40:01.015>maybe <00:40:01.155>have

801
00:40:03.655 --> 00:40:06.295
<00:40:03.655>to <00:40:03.855>represent <00:40:04.055>that <00:40:04.255>a <00:40:04.455>variable <00:40:04.655>has <00:40:04.855>a <00:40:05.055>value

802
00:40:06.315 --> 00:40:07.495
<00:40:06.315>or <00:40:06.580>doesn't <00:40:06.846>have <00:40:07.111>a <00:40:07.377>value.

803
00:40:08.115 --> 00:40:11.535
<00:40:08.115>And <00:40:08.270>here <00:40:08.426>a <00:40:08.581>good <00:40:08.737>example <00:40:08.892>is <00:40:09.048>the <00:40:09.203>option <00:40:09.359>ina <00:40:09.515>option,

804
00:40:11.715 --> 00:40:12.935
<00:40:11.715>as <00:40:11.898>you <00:40:12.081>can <00:40:12.264>see <00:40:12.447>in <00:40:12.630>line <00:40:12.813>11

805
00:40:12.955 --> 00:40:14.935
<00:40:12.955>and <00:40:13.188>12 <00:40:13.421>can <00:40:13.654>have <00:40:13.888>two <00:40:14.121>different <00:40:14.355>values.

806
00:40:14.995 --> 00:40:17.455
<00:40:14.995>Either <00:40:15.194>none <00:40:15.395>if <00:40:15.595>it <00:40:15.795>doesn't <00:40:15.995>have <00:40:16.194>a <00:40:16.395>value

807
00:40:17.555 --> 00:40:21.375
<00:40:17.555>or <00:40:17.694>some <00:40:17.835>with <00:40:17.975>a <00:40:18.115>value <00:40:18.254>parameter <00:40:18.395>if <00:40:18.535>it <00:40:18.674>has <00:40:18.815>a <00:40:18.955>value.

808
00:40:21.755 --> 00:40:24.695
<00:40:21.755>And <00:40:21.930>here <00:40:22.105>in <00:40:22.280>this <00:40:22.455>example <00:40:22.630>I'm <00:40:22.805>using <00:40:22.980>an <00:40:23.155>iterator

809
00:40:24.955 --> 00:40:26.735
<00:40:24.955>to <00:40:25.305>get <00:40:25.654>the <00:40:26.005>fifth <00:40:26.355>element.

810
00:40:26.965 --> 00:40:28.935
<00:40:26.965>It's <00:40:27.245>zero <00:40:27.525>based <00:40:27.805>from <00:40:28.085>an <00:40:28.365>iterator.

811
00:40:29.635 --> 00:40:33.015
<00:40:29.635>If <00:40:29.775>it <00:40:29.915>finds <00:40:30.055>a <00:40:30.195>value, <00:40:30.335>I <00:40:30.475>go <00:40:30.615>into <00:40:30.755>the <00:40:30.895>sum <00:40:31.035>part

812
00:40:33.075 --> 00:40:34.455
<00:40:33.075>of <00:40:33.323>my <00:40:33.571>program, <00:40:33.820>found <00:40:34.068>a <00:40:34.317>move.

813
00:40:34.635 --> 00:40:37.855
<00:40:34.635>If <00:40:34.790>it <00:40:34.946>doesn't <00:40:35.101>find <00:40:35.257>a <00:40:35.412>a <00:40:35.568>move <00:40:35.723>inside <00:40:35.879>the <00:40:36.035>backdoor,

814
00:40:38.035 --> 00:40:40.575
<00:40:38.035>it <00:40:38.210>enters <00:40:38.384>the <00:40:38.560>non <00:40:38.734>part <00:40:38.910>of <00:40:39.085>the <00:40:39.259>match <00:40:39.435>course.

815
00:40:41.115 --> 00:40:44.295
<00:40:41.115>So <00:40:41.254>as <00:40:41.395>you <00:40:41.535>can <00:40:41.674>see <00:40:41.814>here, <00:40:41.955>this <00:40:42.095>is <00:40:42.234>obviously <00:40:42.375>often <00:40:42.515>used

816
00:40:44.315 --> 00:40:45.655
<00:40:44.315>inside <00:40:44.717>the <00:40:45.119>standard <00:40:45.521>library.

817
00:40:46.405 --> 00:40:49.095
<00:40:46.405>Also <00:40:46.685>the <00:40:46.965>result, <00:40:47.245>the <00:40:47.525>optional <00:40:47.805>result

818
00:40:49.395 --> 00:40:51.975
<00:40:49.395>of <00:40:49.570>a <00:40:49.745>function <00:40:49.920>which <00:40:50.095>can <00:40:50.270>either <00:40:50.445>be <00:40:50.620>a <00:40:50.795>result

819
00:40:52.155 --> 00:40:54.895
<00:40:52.155>or <00:40:52.355>an <00:40:52.555>error <00:40:52.755>is <00:40:52.955>represented <00:40:53.155>by <00:40:53.355>an <00:40:53.555>enum.

820
00:40:55.155 --> 00:40:57.375
<00:40:55.155>The <00:40:55.435>result <00:40:55.715>enum <00:40:55.995>is <00:40:56.275>frequently <00:40:56.555>used.

821
00:40:57.875 --> 00:40:59.895
<00:40:57.875>The <00:40:58.108>result <00:40:58.341>enum <00:40:58.575>can <00:40:58.808>either <00:40:59.041>be <00:40:59.275>okay

822
00:41:00.405 --> 00:41:04.415
<00:41:00.405>with <00:41:00.545>the <00:41:00.685>resulting <00:41:00.825>data <00:41:00.965>in <00:41:01.105>this <00:41:01.245>case <00:41:01.385>it <00:41:01.525>read <00:41:01.665>some <00:41:01.805>string,

823
00:41:04.605 --> 00:41:05.815
<00:41:04.605>some <00:41:04.968>data <00:41:05.331>from <00:41:05.694>file

824
00:41:06.195 --> 00:41:09.415
<00:41:06.195>or <00:41:06.395>the <00:41:06.595>error <00:41:06.795>thing <00:41:06.995>here <00:41:07.195>which <00:41:07.395>will <00:41:07.595>uh,

825
00:41:09.415 --> 00:41:10.935
<00:41:09.415>which <00:41:09.757>will <00:41:10.099>represent <00:41:10.441>the <00:41:10.783>error

826
00:41:11.005 --> 00:41:13.015
<00:41:11.005>that <00:41:11.285>happens <00:41:11.565>when <00:41:11.845>accessing <00:41:12.125>the <00:41:12.405>file.

827
00:41:13.165 --> 00:41:14.815
<00:41:13.165>Main <00:41:13.515>Rs <00:41:13.865>in <00:41:14.215>this <00:41:14.565>example.

828
00:41:14.875 --> 00:41:17.455
<00:41:14.875>So <00:41:15.050>you <00:41:15.225>see <00:41:15.400>enums <00:41:15.575>are <00:41:15.750>also <00:41:15.925>a <00:41:16.100>building <00:41:16.275>block

829
00:41:17.715 --> 00:41:19.575
<00:41:17.715>of <00:41:17.948>the <00:41:18.181>core <00:41:18.415>type <00:41:18.648>system <00:41:18.881>of <00:41:19.115>rust.

830
00:41:20.315 --> 00:41:25.015
<00:41:20.315>So <00:41:20.442>to <00:41:20.569>make <00:41:20.696>a <00:41:20.824>long <00:41:20.951>story <00:41:21.078>short, <00:41:21.205>rust <00:41:21.333>has <00:41:21.460>deepness, <00:41:21.587>it <00:41:21.715>has

831
00:41:25.535 --> 00:41:27.455
<00:41:25.535>powerful <00:41:26.001>feature-rich <00:41:26.468>type <00:41:26.935>system.

832
00:41:27.995 --> 00:41:30.615
<00:41:27.995>It <00:41:28.134>has <00:41:28.275>a <00:41:28.415>lot <00:41:28.555>of <00:41:28.694>built-in <00:41:28.835>types <00:41:28.975>like <00:41:29.115>basic <00:41:29.255>data <00:41:29.395>types,

833
00:41:30.825 --> 00:41:32.415
<00:41:30.825>standalone <00:41:31.174>functions, <00:41:31.524>things <00:41:31.875>like <00:41:32.225>that.

834
00:41:32.755 --> 00:41:35.565
<00:41:32.755>But <00:41:33.035>it <00:41:33.315>has <00:41:33.595>STRs, <00:41:33.875>enums <00:41:34.155>traits

835
00:41:35.585 --> 00:41:37.845
<00:41:35.585>and <00:41:35.935>macros <00:41:36.285>as <00:41:36.635>the <00:41:36.985>foundation

836
00:41:38.105 --> 00:41:41.125
<00:41:38.105>for <00:41:38.385>building <00:41:38.665>powerful <00:41:38.945>class <00:41:39.225>libraries, <00:41:39.505>applications,

837
00:41:41.525 --> 00:41:43.365
<00:41:41.525>standard <00:41:41.758>libraries, <00:41:41.991>whatever <00:41:42.225>you <00:41:42.458>want <00:41:42.691>to <00:41:42.925>build.

838
00:41:46.045 --> 00:41:48.385
<00:41:46.045>And <00:41:46.245>then <00:41:46.445>there <00:41:46.645>are <00:41:46.845>so <00:41:47.045>many <00:41:47.245>small <00:41:47.445>traits

839
00:41:48.765 --> 00:41:51.305
<00:41:48.765>as <00:41:48.998>a <00:41:49.231>developer <00:41:49.464>I <00:41:49.698>sometimes <00:41:49.931>love <00:41:50.165>this

840
00:41:51.955 --> 00:41:55.625
<00:41:51.955>small <00:41:52.110>little <00:41:52.266>simple <00:41:52.421>things <00:41:52.577>which <00:41:52.732>really <00:41:52.888>make <00:41:53.043>my <00:41:53.199>life <00:41:53.355>easier.

841
00:41:56.345 --> 00:41:58.505
<00:41:56.345>I <00:41:56.500>will <00:41:56.656>go <00:41:56.811>very <00:41:56.967>quickly <00:41:57.122>to <00:41:57.278>some <00:41:57.433>of <00:41:57.589>the <00:41:57.745>things.

842
00:41:58.565 --> 00:42:00.145
<00:41:58.565>So <00:41:58.915>you <00:41:59.265>see <00:41:59.615>that <00:41:59.965>the,

843
00:42:00.165 --> 00:42:02.545
<00:42:00.165>the <00:42:00.340>reason <00:42:00.515>why <00:42:00.690>I <00:42:00.865>really <00:42:01.040>love <00:42:01.215>to <00:42:01.390>use <00:42:01.565>rust.

844
00:42:03.205 --> 00:42:04.865
<00:42:03.205>So <00:42:03.380>let's <00:42:03.555>take <00:42:03.730>a <00:42:03.904>look <00:42:04.080>at <00:42:04.255>the <00:42:04.430>first <00:42:04.605>treat.

845
00:42:05.205 --> 00:42:06.865
<00:42:05.205>The <00:42:05.485>first <00:42:05.765>treat <00:42:06.045>as <00:42:06.325>I <00:42:06.605>mentioned

846
00:42:06.865 --> 00:42:10.425
<00:42:06.865>before, <00:42:07.331>is <00:42:07.798>mutable <00:42:08.265>shadowing

847
00:42:10.685 --> 00:42:13.305
<00:42:10.685>and <00:42:10.965>sorry, <00:42:11.245>notables <00:42:11.525>shadowing <00:42:11.805>and <00:42:12.085>freezing.

848
00:42:13.815 --> 00:42:14.985
<00:42:13.815>Take <00:42:14.025>a <00:42:14.236>look <00:42:14.446>at <00:42:14.657>line <00:42:14.868>one.

849
00:42:15.405 --> 00:42:18.905
<00:42:15.405>We <00:42:15.545>get <00:42:15.685>a <00:42:15.825>location <00:42:15.965>which <00:42:16.105>is <00:42:16.245>a <00:42:16.385>reference <00:42:16.525>to <00:42:16.665>a <00:42:16.805>string.

850
00:42:19.085 --> 00:42:20.345
<00:42:19.085>It <00:42:19.311>can <00:42:19.538>either <00:42:19.765>be <00:42:19.992>a <00:42:20.219>string

851
00:42:20.525 --> 00:42:22.425
<00:42:20.525>or <00:42:20.725>a <00:42:20.925>string <00:42:21.125>slice <00:42:21.325>or <00:42:21.525>something <00:42:21.725>like <00:42:21.925>this.

852
00:42:22.725 --> 00:42:25.345
<00:42:22.725>But <00:42:22.900>notice <00:42:23.075>that <00:42:23.250>inside <00:42:23.424>the <00:42:23.600>function <00:42:23.775>I <00:42:23.950>also <00:42:24.125>define

853
00:42:25.385 --> 00:42:26.585
<00:42:25.385>a <00:42:25.745>variable <00:42:26.105>called <00:42:26.465>location.

854
00:42:26.805 --> 00:42:28.105
<00:42:26.805>In <00:42:27.194>many <00:42:27.585>other <00:42:27.975>languages

855
00:42:28.175 --> 00:42:30.265
<00:42:28.175>that <00:42:28.350>will <00:42:28.525>be <00:42:28.700>an <00:42:28.875>error <00:42:29.050>but <00:42:29.225>not <00:42:29.400>in <00:42:29.575>rust.

856
00:42:30.925 --> 00:42:34.345
<00:42:30.925>In <00:42:31.125>rust <00:42:31.325>we <00:42:31.525>are <00:42:31.725>shadowing <00:42:31.925>the <00:42:32.125>existing <00:42:32.325>variable.

857
00:42:35.045 --> 00:42:38.185
<00:42:35.045>We <00:42:35.185>are <00:42:35.325>redefining <00:42:35.465>the <00:42:35.605>variable <00:42:35.745>and <00:42:35.885>give <00:42:36.025>it <00:42:36.165>a <00:42:36.305>new <00:42:36.445>type.

858
00:42:38.365 --> 00:42:39.505
<00:42:38.365>It <00:42:38.621>still <00:42:38.877>is <00:42:39.134>type <00:42:39.391>safe

859
00:42:39.845 --> 00:42:43.345
<00:42:39.845>but <00:42:40.000>it <00:42:40.156>shadows, <00:42:40.311>it <00:42:40.467>hides <00:42:40.622>the <00:42:40.778>original <00:42:40.933>meaning <00:42:41.089>of <00:42:41.245>location

860
00:42:43.885 --> 00:42:46.545
<00:42:43.885>and <00:42:44.040>that <00:42:44.196>can <00:42:44.351>be <00:42:44.507>used <00:42:44.662>for <00:42:44.818>some <00:42:44.973>pretty <00:42:45.129>powerful <00:42:45.285>thing.

861
00:42:47.115 --> 00:42:49.225
<00:42:47.115>Think <00:42:47.348>of <00:42:47.581>you <00:42:47.814>have <00:42:48.048>a <00:42:48.281>mutable <00:42:48.515>value

862
00:42:49.325 --> 00:42:51.585
<00:42:49.325>and <00:42:49.480>for <00:42:49.636>some <00:42:49.791>area <00:42:49.947>in <00:42:50.102>your <00:42:50.258>code <00:42:50.413>you <00:42:50.569>would <00:42:50.725>like

863
00:42:51.585 --> 00:42:52.825
<00:42:51.585>to <00:42:51.957>freeze <00:42:52.328>this <00:42:52.701>value.

864
00:42:53.285 --> 00:42:55.705
<00:42:53.285>So <00:42:53.440>you <00:42:53.596>can <00:42:53.751>open <00:42:53.907>a <00:42:54.062>code <00:42:54.218>block <00:42:54.373>like <00:42:54.529>shown <00:42:54.685>here,

865
00:42:56.445 --> 00:42:59.105
<00:42:56.445>assign <00:42:56.645>the <00:42:56.845>mutable <00:42:57.045>value <00:42:57.245>to <00:42:57.445>an <00:42:57.645>immutable <00:42:57.845>value

866
00:42:59.645 --> 00:43:02.745
<00:42:59.645>and <00:42:59.800>suddenly <00:42:59.956>inside <00:43:00.111>the <00:43:00.267>code <00:43:00.422>block <00:43:00.578>the <00:43:00.733>value <00:43:00.889>is <00:43:01.045>frozen.

867
00:43:03.605 --> 00:43:05.745
<00:43:03.605>You <00:43:03.885>cannot <00:43:04.165>accidentally <00:43:04.445>assign <00:43:04.725>a <00:43:05.005>value

868
00:43:05.745 --> 00:43:10.025
<00:43:05.745>to <00:43:05.852>it <00:43:05.960>when <00:43:06.068>you <00:43:06.175>leave <00:43:06.283>the <00:43:06.391>code <00:43:06.498>block, <00:43:06.606>take <00:43:06.714>a <00:43:06.821>look <00:43:06.929>at <00:43:07.037>line <00:43:07.145>14,

869
00:43:10.485 --> 00:43:12.185
<00:43:10.485>you <00:43:10.718>can <00:43:10.951>assign <00:43:11.185>something <00:43:11.418>to <00:43:11.651>the <00:43:11.885>value.

870
00:43:12.195 --> 00:43:16.145
<00:43:12.195>Again, <00:43:12.395>beautiful <00:43:12.595>isn't <00:43:12.795>it <00:43:12.995>Mutability <00:43:13.195>shadowing <00:43:13.395>and <00:43:13.595>freezing

871
00:43:16.765 --> 00:43:18.465
<00:43:16.765>or <00:43:17.464>error <00:43:18.165>propagation.

872
00:43:18.775 --> 00:43:20.625
<00:43:18.775>Take <00:43:18.950>a <00:43:19.125>look <00:43:19.300>at <00:43:19.475>this <00:43:19.650>small <00:43:19.825>question <00:43:20.000>mark <00:43:20.175>here.

873
00:43:21.205 --> 00:43:24.345
<00:43:21.205>In <00:43:21.345>this <00:43:21.485>case <00:43:21.625>I'm <00:43:21.765>writing <00:43:21.904>a <00:43:22.045>helper <00:43:22.185>method <00:43:22.325>called <00:43:22.465>read <00:43:22.605>data.

874
00:43:25.085 --> 00:43:28.665
<00:43:25.085>And <00:43:25.240>this <00:43:25.396>read <00:43:25.551>data <00:43:25.707>uses <00:43:25.862>file <00:43:26.018>open <00:43:26.173>in <00:43:26.329>the <00:43:26.485>background

875
00:43:29.295 --> 00:43:31.545
<00:43:29.295>file <00:43:29.575>open <00:43:29.855>obviously <00:43:30.135>returns <00:43:30.415>a <00:43:30.695>result

876
00:43:31.545 --> 00:43:32.865
<00:43:31.545>and <00:43:31.743>it <00:43:31.941>can <00:43:32.139>result <00:43:32.337>in <00:43:32.535>an <00:43:32.732>error.

877
00:43:33.085 --> 00:43:36.025
<00:43:33.085>And <00:43:33.212>by <00:43:33.339>adding <00:43:33.466>the <00:43:33.594>question <00:43:33.721>mark <00:43:33.848>at <00:43:33.975>the <00:43:34.103>end <00:43:34.230>I'm <00:43:34.357>telling <00:43:34.485>rust,

878
00:43:36.085 --> 00:43:38.025
<00:43:36.085>Hey <00:43:36.240>rust, <00:43:36.396>if <00:43:36.551>there <00:43:36.707>is <00:43:36.862>an <00:43:37.018>error, <00:43:37.173>take <00:43:37.329>the <00:43:37.485>error

879
00:43:38.285 --> 00:43:42.065
<00:43:38.285>and <00:43:38.460>return <00:43:38.634>it <00:43:38.810>as <00:43:38.984>an <00:43:39.160>error <00:43:39.335>result <00:43:39.509>from <00:43:39.685>me.

880
00:43:42.255 --> 00:43:45.585
<00:43:42.255>From <00:43:42.430>the <00:43:42.605>method <00:43:42.780>read <00:43:42.955>data <00:43:43.130>that <00:43:43.305>I'm <00:43:43.480>currently <00:43:43.655>implementing,

881
00:43:45.935 --> 00:43:47.705
<00:43:45.935>it's <00:43:46.401>called <00:43:46.868>error <00:43:47.335>propagation.

882
00:43:47.735 --> 00:43:49.945
<00:43:47.735>Beautiful, <00:43:48.015>isn't <00:43:48.295>it <00:43:48.575>nice <00:43:48.855>to <00:43:49.135>write

883
00:43:50.605 --> 00:43:53.745
<00:43:50.605>or <00:43:50.780>another <00:43:50.955>thing <00:43:51.130>in <00:43:51.305>this <00:43:51.480>case <00:43:51.655>I <00:43:51.830>want <00:43:52.005>you

884
00:43:53.745 --> 00:43:55.305
<00:43:53.745>to <00:43:54.025>focus <00:43:54.305>not <00:43:54.585>on <00:43:54.865>the <00:43:55.145>code,

885
00:43:55.605 --> 00:43:57.625
<00:43:55.605>but <00:43:55.780>I <00:43:55.955>want <00:43:56.130>you <00:43:56.305>to <00:43:56.480>focus <00:43:56.655>on <00:43:56.830>the <00:43:57.005>comments.

886
00:43:58.165 --> 00:44:00.545
<00:43:58.165>Can <00:43:58.320>you <00:43:58.476>see <00:43:58.631>the <00:43:58.787>example <00:43:58.942>section <00:43:59.098>in <00:43:59.253>the <00:43:59.409>comments <00:43:59.565>here?

887
00:44:00.895 --> 00:44:04.465
<00:44:00.895>Believe <00:44:01.050>it <00:44:01.206>or <00:44:01.361>not, <00:44:01.517>that's <00:44:01.672>executable <00:44:01.828>rust <00:44:01.983>code <00:44:02.139>in <00:44:02.295>rust.

888
00:44:04.605 --> 00:44:09.305
<00:44:04.605>You <00:44:04.721>can <00:44:04.838>add <00:44:04.955>examples <00:44:05.071>to <00:44:05.188>the <00:44:05.305>docks <00:44:05.421>and <00:44:05.538>you <00:44:05.655>can <00:44:05.771>test <00:44:05.888>the <00:44:06.005>code.

889
00:44:09.615 --> 00:44:12.305
<00:44:09.615>Take <00:44:09.754>a <00:44:09.895>look <00:44:10.035>at <00:44:10.174>the <00:44:10.314>screenshot <00:44:10.455>in <00:44:10.595>the <00:44:10.734>right <00:44:10.875>lower <00:44:11.015>corner,

890
00:44:12.725 --> 00:44:14.985
<00:44:12.725>you <00:44:12.852>can <00:44:12.979>see <00:44:13.106>that <00:44:13.234>I <00:44:13.361>call <00:44:13.488>cargo, <00:44:13.615>which <00:44:13.743>is <00:44:13.870>the <00:44:13.997>build <00:44:14.125>tool

891
00:44:14.985 --> 00:44:16.305
<00:44:14.985>of <00:44:15.282>rust <00:44:15.579>cargo <00:44:15.875>test <00:44:16.173>dock

892
00:44:16.765 --> 00:44:21.665
<00:44:16.765>and <00:44:16.940>it'll <00:44:17.115>execute <00:44:17.290>the <00:44:17.464>code <00:44:17.640>inside <00:44:17.815>of <00:44:17.990>the <00:44:18.165>documentation

893
00:44:22.325 --> 00:44:24.505
<00:44:22.325>and <00:44:22.524>also <00:44:22.725>make <00:44:22.924>sure <00:44:23.125>that <00:44:23.325>it <00:44:23.524>doesn't <00:44:23.725>panic.

894
00:44:24.605 --> 00:44:25.865
<00:44:24.605>So <00:44:24.794>you <00:44:24.983>can <00:44:25.172>add <00:44:25.361>some <00:44:25.549>kind <00:44:25.738>of

895
00:44:25.885 --> 00:44:27.665
<00:44:25.885>as <00:44:26.165>assertations <00:44:26.445>just <00:44:26.725>like <00:44:27.005>unit <00:44:27.285>tests.

896
00:44:28.505 --> 00:44:31.065
<00:44:28.505>Speaking <00:44:28.738>of <00:44:28.971>unit <00:44:29.205>tests, <00:44:29.438>obviously <00:44:29.671>Rust <00:44:29.905>has

897
00:44:31.165 --> 00:44:32.205
<00:44:31.165>a <00:44:31.399>concept <00:44:31.633>of <00:44:31.866>unit <00:44:32.101>tests.

898
00:44:32.395 --> 00:44:34.165
<00:44:32.395>Here <00:44:32.628>you <00:44:32.861>see <00:44:33.095>just <00:44:33.328>a <00:44:33.561>simple <00:44:33.795>example

899
00:44:34.425 --> 00:44:36.125
<00:44:34.425>but <00:44:34.600>you <00:44:34.775>have <00:44:34.950>to <00:44:35.125>take <00:44:35.300>a <00:44:35.475>look <00:44:35.650>into <00:44:35.825>the

900
00:44:36.285 --> 00:44:37.605
<00:44:36.285>documentation <00:44:36.522>to <00:44:36.760>read <00:44:36.997>more <00:44:37.235>about <00:44:37.473>it.

901
00:44:39.475 --> 00:44:40.525
<00:44:39.475>Another <00:44:39.947>quick <00:44:40.420>one

902
00:44:40.585 --> 00:44:42.965
<00:44:40.585>and <00:44:40.712>then <00:44:40.839>we <00:44:40.966>have <00:44:41.094>to <00:44:41.221>come <00:44:41.348>to <00:44:41.475>an <00:44:41.603>end <00:44:41.730>is <00:44:41.857>typing <00:44:41.985>fields.

903
00:44:43.665 --> 00:44:46.165
<00:44:43.665>Do <00:44:43.820>you <00:44:43.976>see <00:44:44.131>line <00:44:44.287>two? <00:44:44.442>We <00:44:44.598>create <00:44:44.753>the <00:44:44.909>vector <00:44:45.065>off.

904
00:44:47.055 --> 00:44:48.145
<00:44:47.055>Well <00:44:47.300>we <00:44:47.545>have <00:44:47.790>no <00:44:48.036>idea.

905
00:44:48.645 --> 00:44:49.665
<00:44:48.645>We <00:44:48.874>just <00:44:49.104>create <00:44:49.333>a <00:44:49.563>vector

906
00:44:49.805 --> 00:44:53.025
<00:44:49.805>and <00:44:49.944>ask <00:44:50.085>rust <00:44:50.225>to <00:44:50.365>figure <00:44:50.504>out <00:44:50.645>the <00:44:50.785>type <00:44:50.924>of <00:44:51.065>the <00:44:51.205>vector.

907
00:44:53.075 --> 00:44:55.425
<00:44:53.075>Later <00:44:53.250>on <00:44:53.424>it <00:44:53.600>takes <00:44:53.774>a <00:44:53.950>look <00:44:54.125>at <00:44:54.299>line <00:44:54.475>four

908
00:44:55.425 --> 00:44:57.665
<00:44:55.425>and <00:44:55.625>says, <00:44:55.825>oh, <00:44:56.025>rhino <00:44:56.225>is <00:44:56.425>pushing <00:44:56.625>an <00:44:56.825>integer

909
00:44:57.665 --> 00:44:59.185
<00:44:57.665>32 <00:44:58.007>bit <00:44:58.349>into <00:44:58.691>the <00:44:59.033>vector.

910
00:44:59.445 --> 00:45:03.505
<00:44:59.445>So <00:44:59.572>I <00:44:59.699>understand <00:44:59.826>that <00:44:59.954>this <00:45:00.081>vector <00:45:00.208>now <00:45:00.335>has <00:45:00.463>the <00:45:00.590>type <00:45:00.717>integer <00:45:00.845>32

911
00:45:03.885 --> 00:45:07.785
<00:45:03.885>so <00:45:04.025>I <00:45:04.165>can <00:45:04.305>not <00:45:04.445>push <00:45:04.585>a <00:45:04.725>string <00:45:04.865>value <00:45:05.005>into <00:45:05.145>this <00:45:05.285>vector.

912
00:45:09.395 --> 00:45:13.225
<00:45:09.395>These <00:45:09.522>were <00:45:09.649>just <00:45:09.776>a <00:45:09.904>few <00:45:10.031>treats <00:45:10.158>that <00:45:10.285>I <00:45:10.413>wanted <00:45:10.540>to <00:45:10.667>show <00:45:10.795>you

913
00:45:13.615 --> 00:45:17.425
<00:45:13.615>that <00:45:13.895>should <00:45:14.174>that <00:45:14.455>that <00:45:14.734>stand <00:45:15.015>exemplary

914
00:45:17.565 --> 00:45:19.705
<00:45:17.565>for <00:45:17.765>why <00:45:17.965>I <00:45:18.165>really <00:45:18.365>love <00:45:18.565>to <00:45:18.765>use <00:45:18.965>rust

915
00:45:19.925 --> 00:45:22.225
<00:45:19.925>and <00:45:20.100>why <00:45:20.275>I <00:45:20.450>think <00:45:20.625>rust <00:45:20.800>is <00:45:20.975>a <00:45:21.150>great <00:45:21.325>language.

916
00:45:24.065 --> 00:45:28.005
<00:45:24.065>Did <00:45:24.240>you <00:45:24.415>get <00:45:24.590>curious? <00:45:24.765>We <00:45:24.940>only <00:45:25.115>had <00:45:25.290>45 <00:45:25.465>minutes

917
00:45:28.305 --> 00:45:31.605
<00:45:28.305>for <00:45:28.432>this <00:45:28.559>quick <00:45:28.686>talk <00:45:28.814>and <00:45:28.941>I <00:45:29.068>promised <00:45:29.195>you <00:45:29.323>that <00:45:29.450>I <00:45:29.577>tell <00:45:29.705>you

918
00:45:32.265 --> 00:45:34.765
<00:45:32.265>why <00:45:32.464>I <00:45:32.665>wrote <00:45:32.865>this <00:45:33.065>love <00:45:33.265>letter <00:45:33.464>to <00:45:33.665>Rust.

919
00:45:35.545 --> 00:45:38.765
<00:45:35.545>If <00:45:35.661>you <00:45:35.778>are <00:45:35.895>curious, <00:45:36.011>if <00:45:36.128>you <00:45:36.245>think <00:45:36.361>that <00:45:36.478>maybe <00:45:36.595>this <00:45:36.711>is <00:45:36.828>a <00:45:36.945>loving

920
00:45:38.865 --> 00:45:41.005
<00:45:38.865>and <00:45:39.098>caring <00:45:39.331>relationship <00:45:39.564>for <00:45:39.798>you, <00:45:40.031>for <00:45:40.265>Rust

921
00:45:41.005 --> 00:45:44.165
<00:45:41.005>and <00:45:41.121>for <00:45:41.238>Rust <00:45:41.355>for <00:45:41.471>you, <00:45:41.588>then <00:45:41.705>you <00:45:41.821>might <00:45:41.938>take <00:45:42.055>a <00:45:42.171>look <00:45:42.288>at <00:45:42.405>these

922
00:45:44.165 --> 00:45:45.965
<00:45:44.165>options <00:45:44.631>you <00:45:45.098>have <00:45:45.565>gotten.

923
00:45:46.245 --> 00:45:48.805
<00:45:46.245>I <00:45:46.384>think <00:45:46.525>the <00:45:46.665>link <00:45:46.805>to <00:45:46.944>my <00:45:47.085>slides <00:45:47.225>already <00:45:47.365>in <00:45:47.505>the <00:45:47.645>chat.

924
00:45:49.965 --> 00:45:52.095
<00:45:49.965>Rust <00:45:50.165>has <00:45:50.365>a <00:45:50.565>great <00:45:50.765>rust <00:45:50.965>book <00:45:51.165>which <00:45:51.365>is

925
00:45:52.095 --> 00:45:53.375
<00:45:52.095>available <00:45:52.479>for <00:45:52.863>free <00:45:53.247>online.

926
00:45:53.375 --> 00:45:55.215
<00:45:53.375>Just <00:45:53.530>click <00:45:53.686>on <00:45:53.841>the <00:45:53.997>link <00:45:54.152>and <00:45:54.308>you <00:45:54.463>have <00:45:54.619>the <00:45:54.775>book.

927
00:45:55.845 --> 00:45:57.895
<00:45:55.845>Just <00:45:56.125>install <00:45:56.404>rust <00:45:56.685>and <00:45:56.964>start <00:45:57.245>coding.

928
00:45:57.995 --> 00:45:59.975
<00:45:57.995>The <00:45:58.194>best <00:45:58.395>way <00:45:58.595>of <00:45:58.795>learning <00:45:58.995>a <00:45:59.194>programming <00:45:59.395>language

929
00:45:59.975 --> 00:46:01.055
<00:45:59.975>is <00:46:00.299>by <00:46:00.623>practicing <00:46:00.946>it.

930
00:46:01.625 --> 00:46:04.895
<00:46:01.625>There <00:46:01.780>is <00:46:01.936>also <00:46:02.091>a <00:46:02.247>great <00:46:02.402>website <00:46:02.558>which <00:46:02.713>is <00:46:02.869>called <00:46:03.025>Exorcism,

931
00:46:05.285 --> 00:46:08.775
<00:46:05.285>with <00:46:05.440>lots <00:46:05.596>and <00:46:05.751>lots <00:46:05.907>of <00:46:06.062>small <00:46:06.218>examples <00:46:06.373>which <00:46:06.529>allow <00:46:06.685>you

932
00:46:08.795 --> 00:46:12.775
<00:46:08.795>to <00:46:08.950>make <00:46:09.106>a <00:46:09.261>gradual <00:46:09.417>step-by-step <00:46:09.572>entry <00:46:09.728>into <00:46:09.883>this <00:46:10.039>new <00:46:10.195>language.

933
00:46:13.515 --> 00:46:14.735
<00:46:13.515>You <00:46:13.789>can <00:46:14.064>visit <00:46:14.338>a <00:46:14.613>meetup

934
00:46:15.195 --> 00:46:18.255
<00:46:15.195>and <00:46:15.395>I <00:46:15.595>couldn't <00:46:15.795>resist <00:46:15.995>to <00:46:16.195>add <00:46:16.395>a <00:46:16.595>link

935
00:46:18.255 --> 00:46:20.735
<00:46:18.255>to <00:46:18.430>our <00:46:18.605>own <00:46:18.780>Rust <00:46:18.955>Links <00:46:19.130>meetup <00:46:19.305>where <00:46:19.480>I'm <00:46:19.655>one

936
00:46:20.735 --> 00:46:22.175
<00:46:20.735>of <00:46:20.994>the <00:46:21.253>founder <00:46:21.512>and <00:46:21.771>hosts <00:46:22.031>of.

937
00:46:22.175 --> 00:46:24.135
<00:46:22.175>So <00:46:22.350>if <00:46:22.525>you <00:46:22.700>would <00:46:22.875>like <00:46:23.050>to <00:46:23.225>visit <00:46:23.400>us, <00:46:23.575>talk

938
00:46:24.135 --> 00:46:26.135
<00:46:24.135>with <00:46:24.368>peers <00:46:24.601>about <00:46:24.835>Rust, <00:46:25.068>follow <00:46:25.301>this <00:46:25.535>link.

939
00:46:26.555 --> 00:46:29.775
<00:46:26.555>And <00:46:26.671>last <00:46:26.788>but <00:46:26.904>not <00:46:27.021>least, <00:46:27.138>I <00:46:27.254>also <00:46:27.371>added <00:46:27.488>a <00:46:27.605>link <00:46:27.721>to <00:46:27.838>a <00:46:27.955>conference

940
00:46:30.025 --> 00:46:33.415
<00:46:30.025>where <00:46:30.180>you <00:46:30.336>can <00:46:30.491>learn <00:46:30.647>more <00:46:30.802>about <00:46:30.958>various <00:46:31.113>topics <00:46:31.269>about <00:46:31.425>Rust.

941
00:46:34.035 --> 00:46:36.415
<00:46:34.035>And <00:46:34.234>with <00:46:34.435>that <00:46:34.634>I <00:46:34.835>say <00:46:35.035>thank <00:46:35.234>you <00:46:35.435>very

942
00:46:36.415 --> 00:46:37.615
<00:46:36.415>much <00:46:36.685>for <00:46:36.955>attending <00:46:37.225>this <00:46:37.495>session.

943
00:46:38.215 --> 00:46:41.695
<00:46:38.215>I <00:46:38.415>enjoyed <00:46:38.615>telling <00:46:38.815>you <00:46:39.015>45 <00:46:39.215>minutes <00:46:39.415>about <00:46:39.615>Rust

944
00:46:42.155 --> 00:46:44.135
<00:46:42.155>and <00:46:42.388>about <00:46:42.621>my <00:46:42.855>Love <00:46:43.088>letter <00:46:43.321>to <00:46:43.555>Rust.

945
00:46:44.885 --> 00:46:48.015
<00:46:44.885>That <00:46:45.025>was <00:46:45.165>it. <00:46:45.305>And <00:46:45.445>I <00:46:45.585>say <00:46:45.725>thank <00:46:45.865>you <00:46:46.005>for <00:46:46.145>Hayek <00:46:46.285>giving,

946
00:46:48.115 --> 00:46:51.055
<00:46:48.115>for <00:46:48.254>giving <00:46:48.395>me <00:46:48.535>the <00:46:48.674>opportunity <00:46:48.814>to <00:46:48.955>talk <00:46:49.095>about <00:46:49.234>my <00:46:49.375>favorite, <00:46:49.515>one

947
00:46:51.055 --> 00:46:52.695
<00:46:51.055>of <00:46:51.335>my <00:46:51.615>favorite <00:46:51.895>programming <00:46:52.174>languages <00:46:52.455>here.

948
00:46:53.115 --> 00:46:57.335
<00:46:53.115>And <00:46:53.242>I <00:46:53.369>hand <00:46:53.496>back <00:46:53.624>to <00:46:53.751>Ske <00:46:53.878>Ske, <00:46:54.005>do <00:46:54.133>we <00:46:54.260>have <00:46:54.387>any <00:46:54.515>questions?

949
00:46:57.515 --> 00:46:58.815
<00:46:57.515>Did <00:46:57.807>you <00:46:58.100>like <00:46:58.392>the <00:46:58.685>presentation?

950
00:46:58.955 --> 00:47:01.175
<00:46:58.955>Are <00:46:59.154>you <00:46:59.355>also <00:46:59.555>in <00:46:59.755>love <00:46:59.955>with <00:47:00.154>Rust <00:47:00.355>now?

951
00:47:02.455 --> 00:47:04.375
<00:47:02.455>I <00:47:02.630>think <00:47:02.805>I <00:47:02.980>need <00:47:03.154>to <00:47:03.330>start <00:47:03.505>programming <00:47:03.680>in <00:47:03.855>Rust

952
00:47:04.435 --> 00:47:05.495
<00:47:04.435>too <00:47:04.752>now. <00:47:05.071>Yeah, <00:47:05.389>you

953
00:47:05.495 --> 00:47:06.495
<00:47:05.495>Have <00:47:06.395>to.

954
00:47:07.245 --> 00:47:09.175
<00:47:07.245>What <00:47:07.711>an <00:47:08.178>energetic <00:47:08.645>introduction

955
00:47:09.175 --> 00:47:10.455
<00:47:09.175>to <00:47:09.559>this <00:47:09.943>programming <00:47:10.327>language.

956
00:47:10.555 --> 00:47:13.775
<00:47:10.555>Uh, <00:47:10.710>thank <00:47:10.866>you. <00:47:11.021>People <00:47:11.177>were <00:47:11.332>really, <00:47:11.488>really <00:47:11.643>stunned. <00:47:11.799>I <00:47:11.955>think.

957
00:47:13.955 --> 00:47:17.215
<00:47:13.955>Um, <00:47:14.095>many, <00:47:14.235>many <00:47:14.375>thank <00:47:14.515>yous <00:47:14.654>now <00:47:14.795>popping <00:47:14.935>up <00:47:15.075>in <00:47:15.215>the <00:47:15.355>chat

958
00:47:17.235 --> 00:47:19.935
<00:47:17.235>and <00:47:17.435>we <00:47:17.635>had <00:47:17.835>quite <00:47:18.035>a <00:47:18.235>couple <00:47:18.435>of <00:47:18.635>questions.

959
00:47:20.155 --> 00:47:22.135
<00:47:20.155>Um, <00:47:20.355>I'm <00:47:20.555>afraid <00:47:20.755>we <00:47:20.955>don't <00:47:21.155>have <00:47:21.355>much <00:47:21.555>time,

960
00:47:22.235 --> 00:47:26.015
<00:47:22.235>but <00:47:22.410>um, <00:47:22.585>we <00:47:22.760>can <00:47:22.935>perhaps <00:47:23.110>address <00:47:23.285>one <00:47:23.460>or <00:47:23.635>two

961
00:47:26.155 --> 00:47:30.005
<00:47:26.155>before <00:47:26.295>you <00:47:26.435>move <00:47:26.575>on <00:47:26.715>to <00:47:26.855>the <00:47:26.995>um, <00:47:27.135>q <00:47:27.275>and <00:47:27.415>A <00:47:27.555>launch.

962
00:47:30.235 --> 00:47:32.405
<00:47:30.235>Some <00:47:30.515>people <00:47:30.795>have, <00:47:31.075>yeah, <00:47:31.355>really, <00:47:31.635>uh,

963
00:47:32.705 --> 00:47:34.645
<00:47:32.705>gotten <00:47:32.938>the <00:47:33.171>flavor <00:47:33.404>of <00:47:33.638>Rust <00:47:33.871>I <00:47:34.105>think.

964
00:47:34.795 --> 00:47:36.485
<00:47:34.795>Awesome. <00:47:35.495>Um, <00:47:36.195>yeah.

965
00:47:36.825 --> 00:47:40.165
<00:47:36.825>Uh, <00:47:37.000>what <00:47:37.174>kinds <00:47:37.350>of <00:47:37.524>projects <00:47:37.700>are <00:47:37.875>predestined <00:47:38.049>to <00:47:38.225>use?

966
00:47:40.235 --> 00:47:42.405
<00:47:40.235>Rust <00:47:40.435>was <00:47:40.635>one <00:47:40.835>of <00:47:41.035>the <00:47:41.235>most <00:47:41.435>like <00:47:41.635>questions.

967
00:47:42.435 --> 00:47:45.205
<00:47:42.435>Yeah, <00:47:42.590>yeah. <00:47:42.746>Uh, <00:47:42.901>don't <00:47:43.057>get <00:47:43.212>a <00:47:43.368>wrong <00:47:43.523>impression <00:47:43.679>from <00:47:43.835>Rust.

968
00:47:45.635 --> 00:47:48.885
<00:47:45.635>Rust <00:47:45.810>has <00:47:45.985>its <00:47:46.160>root <00:47:46.335>in <00:47:46.510>system <00:47:46.685>programming <00:47:46.860>like <00:47:47.035>c

969
00:47:48.885 --> 00:47:51.965
<00:47:48.885>or <00:47:49.060>c <00:47:49.235>plus <00:47:49.410>plus, <00:47:49.585>but <00:47:49.760>it's <00:47:49.935>absolutely <00:47:50.110>not <00:47:50.285>limited

970
00:47:52.185 --> 00:47:53.285
<00:47:52.185>to <00:47:52.680>system <00:47:53.174>programming.

971
00:47:53.585 --> 00:47:55.885
<00:47:53.585>You <00:47:53.865>can <00:47:54.145>definitely <00:47:54.425>do <00:47:54.705>application <00:47:54.985>programming.

972
00:47:55.885 --> 00:47:58.325
<00:47:55.885>So <00:47:56.085>I <00:47:56.285>would <00:47:56.485>say <00:47:56.685>every <00:47:56.885>kind <00:47:57.085>of <00:47:57.285>application

973
00:47:58.325 --> 00:48:00.845
<00:47:58.325>that <00:47:58.500>runs <00:47:58.674>on <00:47:58.850>a <00:47:59.024>server <00:47:59.200>side <00:47:59.375>like <00:47:59.549>web <00:47:59.725>APIs

974
00:48:00.865 --> 00:48:03.045
<00:48:00.865>or <00:48:01.040>things <00:48:01.214>like <00:48:01.390>that <00:48:01.564>are <00:48:01.740>awesome <00:48:01.915>to <00:48:02.089>write <00:48:02.265>in.

975
00:48:03.045 --> 00:48:04.685
<00:48:03.045>Rust <00:48:03.745>Microservice <00:48:04.445>great.

976
00:48:05.095 --> 00:48:07.685
<00:48:05.095>Serverless <00:48:05.328>great <00:48:05.561>because <00:48:05.794>of <00:48:06.028>the <00:48:06.261>great <00:48:06.495>performance

977
00:48:07.985 --> 00:48:09.485
<00:48:07.985>and <00:48:08.322>a <00:48:08.660>slow, <00:48:08.997>uh, <00:48:09.335>and,

978
00:48:09.485 --> 00:48:12.405
<00:48:09.485>and <00:48:09.660>really <00:48:09.835>awesome <00:48:10.010>Cold <00:48:10.185>Start <00:48:10.360>performance, <00:48:10.535>things <00:48:10.710>like <00:48:10.885>that.

979
00:48:13.055 --> 00:48:16.845
<00:48:13.055>Where <00:48:13.230>Rust <00:48:13.404>Doesn't <00:48:13.580>Shine <00:48:13.754>currently <00:48:13.930>to <00:48:14.105>my <00:48:14.279>personal <00:48:14.455>opinion,

980
00:48:17.225 --> 00:48:18.845
<00:48:17.225>is <00:48:17.691>graphical <00:48:18.158>user <00:48:18.625>interfaces.

981
00:48:18.845 --> 00:48:22.005
<00:48:18.845>So <00:48:18.961>if <00:48:19.078>you <00:48:19.194>want <00:48:19.311>to <00:48:19.428>build <00:48:19.544>a <00:48:19.661>native <00:48:19.778>UI <00:48:19.895>for <00:48:20.011>a <00:48:20.128>mobile <00:48:20.245>app

982
00:48:22.105 --> 00:48:23.885
<00:48:22.105>or <00:48:22.571>Windows <00:48:23.038>or <00:48:23.505>Linux

983
00:48:23.885 --> 00:48:26.405
<00:48:23.885>or <00:48:24.060>something <00:48:24.235>like <00:48:24.410>this, <00:48:24.585>you <00:48:24.760>don't <00:48:24.935>have <00:48:25.110>the <00:48:25.285>best

984
00:48:26.555 --> 00:48:27.725
<00:48:26.555>ecosystem <00:48:26.906>in <00:48:27.257>the <00:48:27.607>world.

985
00:48:27.895 --> 00:48:29.805
<00:48:27.895>There <00:48:28.245>are <00:48:28.595>maybe <00:48:28.945>other <00:48:29.295>platforms

986
00:48:29.805 --> 00:48:31.885
<00:48:29.805>and <00:48:30.085>languages <00:48:30.365>which <00:48:30.645>are <00:48:30.924>better <00:48:31.205>suited.

987
00:48:31.945 --> 00:48:33.165
<00:48:31.945>So <00:48:32.164>if <00:48:32.384>you <00:48:32.603>build <00:48:32.823>a <00:48:33.043>CLI

988
00:48:33.345 --> 00:48:34.485
<00:48:33.345>or <00:48:33.687>a <00:48:34.029>server <00:48:34.371>application,

989
00:48:34.515 --> 00:48:37.005
<00:48:34.515>then <00:48:34.654>you <00:48:34.795>should <00:48:34.935>definitely <00:48:35.075>take, <00:48:35.214>uh, <00:48:35.355>take <00:48:35.495>a <00:48:35.634>look <00:48:35.775>at <00:48:35.915>Rust.

990
00:48:38.535 --> 00:48:41.905
<00:48:38.535>Wonderful. <00:48:38.674>So <00:48:38.815>now <00:48:38.955>I <00:48:39.095>think <00:48:39.234>it's <00:48:39.375>really <00:48:39.515>time <00:48:39.654>for <00:48:39.795>you <00:48:39.935>all.

991
00:48:42.265 --> 00:48:46.505
<00:48:42.265>I <00:48:42.420>mean <00:48:42.576>the <00:48:42.731>audience, <00:48:42.887>154 <00:48:43.042>people <00:48:43.198>were <00:48:43.353>just <00:48:43.509>Oh, <00:48:43.665>awesome.

992
00:48:46.945 --> 00:48:49.185
<00:48:46.945>Fascinated <00:48:47.178>and <00:48:47.411>listening <00:48:47.645>all <00:48:47.878>the <00:48:48.111>way <00:48:48.345>through.

993
00:48:49.285 --> 00:48:50.865
<00:48:49.285>Uh, <00:48:49.484>no <00:48:49.685>one <00:48:49.884>got <00:48:50.085>lost <00:48:50.285>on <00:48:50.484>the <00:48:50.685>way.

994
00:48:50.925 --> 00:48:54.865
<00:48:50.925>Uh, <00:48:51.080>I've <00:48:51.236>I've <00:48:51.391>I've <00:48:51.547>monitored <00:48:51.702>that <00:48:51.858>and <00:48:52.013>love <00:48:52.169>it <00:48:52.325>now.

995
00:48:55.175 --> 00:48:58.265
<00:48:55.175>Yeah, <00:48:55.302>there's, <00:48:55.429>uh, <00:48:55.556>there's <00:48:55.684>a <00:48:55.811>link <00:48:55.938>for, <00:48:56.065>for <00:48:56.193>all <00:48:56.320>of <00:48:56.447>you <00:48:56.575>to,

996
00:48:58.605 --> 00:49:01.465
<00:48:58.605>uh, <00:48:58.745>go <00:48:58.885>to <00:48:59.025>the <00:48:59.165>q <00:48:59.305>and <00:48:59.445>a <00:48:59.585>lounge <00:48:59.725>has <00:48:59.865>a <00:49:00.005>developer

997
00:49:01.845 --> 00:49:03.665
<00:49:01.845>and <00:49:02.020>for <00:49:02.194>how <00:49:02.370>long <00:49:02.544>will <00:49:02.720>you <00:49:02.895>be <00:49:03.069>present <00:49:03.245>there?

998
00:49:03.695 --> 00:49:04.865
<00:49:03.695>That <00:49:03.958>was <00:49:04.221>also <00:49:04.484>a <00:49:04.747>question.

999
00:49:06.005 --> 00:49:07.825
<00:49:06.005>Oh, <00:49:06.180>I <00:49:06.355>can <00:49:06.530>stay <00:49:06.705>there <00:49:06.880>for, <00:49:07.055>I <00:49:07.230>don't <00:49:07.405>know,

1000
00:49:07.825 --> 00:49:08.985
<00:49:07.825>quite <00:49:07.999>of <00:49:08.173>an <00:49:08.346>hour, <00:49:08.521>half <00:49:08.695>an <00:49:08.869>hour.

1001
00:49:09.085 --> 00:49:11.305
<00:49:09.085>We <00:49:09.240>will <00:49:09.396>see <00:49:09.551>how, <00:49:09.707>how <00:49:09.862>long <00:49:10.018>the <00:49:10.173>questions <00:49:10.329>are <00:49:10.485>there.

1002
00:49:11.645 --> 00:49:14.985
<00:49:11.645>We <00:49:11.772>will <00:49:11.899>see. <00:49:12.026>I <00:49:12.154>don't <00:49:12.281>have <00:49:12.408>any <00:49:12.535>talks <00:49:12.663>anymore, <00:49:12.790>so <00:49:12.917>it's <00:49:13.045>fine.

1003
00:49:15.165 --> 00:49:17.865
<00:49:15.165>Uh, <00:49:15.305>Sika <00:49:15.445>can <00:49:15.585>I, <00:49:15.725>can <00:49:15.865>I <00:49:16.005>quickly <00:49:16.145>get <00:49:16.285>on <00:49:16.425>one <00:49:16.565>question?

1004
00:49:18.085 --> 00:49:19.625
<00:49:18.085>One <00:49:18.362>last <00:49:18.639>question <00:49:18.916>because <00:49:19.193>I <00:49:19.471>see

1005
00:49:19.885 --> 00:49:22.225
<00:49:19.885>by <00:49:20.085>scroll <00:49:20.285>I <00:49:20.485>have <00:49:20.685>crossed <00:49:20.885>through <00:49:21.085>the <00:49:21.285>I

1006
00:49:22.225 --> 00:49:23.225
<00:49:22.225>Have <00:49:22.525>crossed <00:49:22.825>through. <00:49:23.125>Yeah,

1007
00:49:23.225 --> 00:49:26.065
<00:49:23.225>yeah, <00:49:23.458>yeah, <00:49:23.691>yeah. <00:49:23.924>The <00:49:24.158>question <00:49:24.391>about <00:49:24.625>Go

1008
00:49:26.245 --> 00:49:29.705
<00:49:26.245>and <00:49:26.400>Rust, <00:49:26.556>I <00:49:26.711>get <00:49:26.867>this <00:49:27.022>one <00:49:27.178>exactly <00:49:27.333>very, <00:49:27.489>very <00:49:27.645>frequently.

1009
00:49:30.245 --> 00:49:32.625
<00:49:30.245>Let <00:49:30.384>me <00:49:30.525>quickly <00:49:30.665>tell <00:49:30.805>you <00:49:30.944>one <00:49:31.085>or <00:49:31.225>two <00:49:31.365>things <00:49:31.505>about <00:49:31.645>that.

1010
00:49:33.085 --> 00:49:36.105
<00:49:33.085>If <00:49:33.225>you <00:49:33.365>want <00:49:33.505>to <00:49:33.645>learn <00:49:33.785>a <00:49:33.925>programming <00:49:34.065>language <00:49:34.205>quickly <00:49:34.345>over <00:49:34.485>a

1011
00:49:36.105 --> 00:49:37.785
<00:49:36.105>weekend, <00:49:36.571>go <00:49:37.038>for <00:49:37.505>Go.

1012
00:49:37.965 --> 00:49:41.505
<00:49:37.965>Go <00:49:38.092>is <00:49:38.219>simple. <00:49:38.346>Go <00:49:38.474>is <00:49:38.601>easy <00:49:38.728>to <00:49:38.855>learn, <00:49:38.983>go <00:49:39.110>has <00:49:39.237>Managed <00:49:39.365>Memory,

1013
00:49:42.045 --> 00:49:46.105
<00:49:42.045>go <00:49:42.152>has <00:49:42.260>a <00:49:42.368>focus <00:49:42.475>on <00:49:42.583>simplicity <00:49:42.691>and <00:49:42.798>I <00:49:42.906>love <00:49:43.014>to <00:49:43.121>write <00:49:43.229>code <00:49:43.337>in <00:49:43.445>Go.

1014
00:49:46.205 --> 00:49:50.025
<00:49:46.205>I'm <00:49:46.345>also <00:49:46.485>passionate <00:49:46.625>about <00:49:46.765>Go <00:49:46.904>Rust <00:49:47.045>is <00:49:47.185>much <00:49:47.325>harder <00:49:47.465>to <00:49:47.605>learn,

1015
00:49:50.325 --> 00:49:52.785
<00:49:50.325>but <00:49:50.558>has <00:49:50.791>a <00:49:51.024>way <00:49:51.258>richer <00:49:51.491>type <00:49:51.725>system.

1016
00:49:53.405 --> 00:49:56.385
<00:49:53.405>So <00:49:53.560>Rust <00:49:53.716>is <00:49:53.871>something <00:49:54.027>that <00:49:54.182>you <00:49:54.338>learn <00:49:54.493>in <00:49:54.649>a <00:49:54.805>week

1017
00:49:56.405 --> 00:49:58.465
<00:49:56.405>or <00:49:56.638>a <00:49:56.871>month <00:49:57.105>while <00:49:57.338>go <00:49:57.571>is <00:49:57.805>something

1018
00:49:58.465 --> 00:50:01.105
<00:49:58.465>that <00:49:58.640>you <00:49:58.815>learn <00:49:58.990>in <00:49:59.165>a <00:49:59.340>day <00:49:59.515>or <00:49:59.690>a <00:49:59.865>weekend.

1019
00:50:01.205 --> 00:50:02.305
<00:50:01.205>So <00:50:01.535>that <00:50:01.865>is <00:50:02.194>important.

1020
00:50:03.245 --> 00:50:08.225
<00:50:03.245>Go <00:50:03.478>simplicity, <00:50:03.711>rust, <00:50:03.944>expressiveness <00:50:04.178>Go, <00:50:04.411>can <00:50:04.645>go,

1021
00:50:08.405 --> 00:50:12.065
<00:50:08.405>uh, <00:50:08.521>rust <00:50:08.638>can <00:50:08.755>go <00:50:08.871>very <00:50:08.988>deep <00:50:09.105>even <00:50:09.221>down <00:50:09.338>to <00:50:09.455>where <00:50:09.571>Go <00:50:09.688>cannot <00:50:09.805>go

1022
00:50:12.175 --> 00:50:15.665
<00:50:12.175>because <00:50:12.455>rust <00:50:12.735>has <00:50:13.015>zero <00:50:13.295>cost <00:50:13.575>abstractions.

1023
00:50:16.245 --> 00:50:19.425
<00:50:16.245>So <00:50:16.444>Rust <00:50:16.645>is <00:50:16.845>more <00:50:17.045>rich, <00:50:17.245>more <00:50:17.444>feature <00:50:17.645>rich,

1024
00:50:19.645 --> 00:50:22.225
<00:50:19.645>and <00:50:19.820>can <00:50:19.995>be <00:50:20.170>used <00:50:20.345>in <00:50:20.520>areas <00:50:20.695>where <00:50:20.870>performance <00:50:21.045>need

1025
00:50:22.365 --> 00:50:26.025
<00:50:22.365>to <00:50:22.520>be <00:50:22.676>really <00:50:22.831>world <00:50:22.987>class <00:50:23.142>go <00:50:23.298>is <00:50:23.453>easier <00:50:23.609>to <00:50:23.765>learn,

1026
00:50:26.525 --> 00:50:27.965
<00:50:26.525>but <00:50:26.849>it <00:50:27.173>has <00:50:27.497>some <00:50:27.821>limitations

1027
00:50:27.965 --> 00:50:30.325
<00:50:27.965>because <00:50:28.165>of <00:50:28.365>its <00:50:28.565>nature <00:50:28.765>as <00:50:28.965>a <00:50:29.165>managed <00:50:29.365>language.

1028
00:50:33.475 --> 00:50:35.895
<00:50:33.475>And <00:50:33.615>that's <00:50:33.755>it. <00:50:33.895>I <00:50:34.035>think <00:50:34.174>I, <00:50:34.315>I <00:50:34.455>I <00:50:34.595>think <00:50:34.735>that's <00:50:34.875>it

1029
00:50:35.895 --> 00:50:37.455
<00:50:35.895>for <00:50:36.128>the <00:50:36.361>moment, <00:50:36.595>for <00:50:36.828>the <00:50:37.061>time <00:50:37.295>being.

1030
00:50:37.595 --> 00:50:37.815
Um.