Add images that only had placeholders

This commit is contained in:
Carol (Nichols || Goulding) 2016-09-06 20:39:26 -04:00
parent 8029bdb072
commit 591e8a0aea
6 changed files with 265 additions and 2 deletions

31
dot/trpl04-05.dot Normal file
View File

@ -0,0 +1,31 @@
digraph {
rankdir=LR;
dpi=300.0;
node [shape="plaintext"];
table0[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD COLSPAN="2" SIDES="B">s</TD></TR>
<TR><TD>name</TD><TD>value</TD></TR>
<TR><TD>ptr</TD><TD PORT="borrower"></TD></TR>
</TABLE>>];
table1[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD COLSPAN="2" SIDES="B">s1</TD></TR>
<TR><TD>name</TD><TD>value</TD></TR>
<TR><TD PORT="borrowee">ptr</TD><TD PORT="pointer"></TD></TR>
<TR><TD>len</TD><TD>5</TD></TR>
<TR><TD>capacity</TD><TD>5</TD></TR>
</TABLE>>];
table2[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD>index</TD><TD>value</TD></TR>
<TR><TD PORT="pointee">0</TD><TD>h</TD></TR>
<TR><TD>1</TD><TD>e</TD></TR>
<TR><TD>2</TD><TD>l</TD></TR>
<TR><TD>3</TD><TD>l</TD></TR>
<TR><TD>4</TD><TD>o</TD></TR>
</TABLE>>];
edge[tailclip="false"];
table1:pointer:c -> table2:pointee;
table0:borrower:c -> table1:borrowee;
}

40
dot/trpl04-06.dot Normal file
View File

@ -0,0 +1,40 @@
digraph {
rankdir=LR;
dpi=300.0;
node [shape="plaintext"];
table0[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD COLSPAN="2" SIDES="B">world</TD></TR>
<TR><TD>name</TD><TD>value</TD></TR>
<TR><TD>ptr</TD><TD PORT="pointer2"></TD></TR>
<TR><TD>len</TD><TD>5</TD></TR>
</TABLE>>];
table3[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD COLSPAN="2" SIDES="B">s</TD></TR>
<TR><TD>name</TD><TD>value</TD></TR>
<TR><TD>ptr</TD><TD PORT="pointer"></TD></TR>
<TR><TD>len</TD><TD>5</TD></TR>
<TR><TD>capacity</TD><TD>5</TD></TR>
</TABLE>>];
table4[label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
<TR><TD>index</TD><TD>value</TD></TR>
<TR><TD PORT="pointee">0</TD><TD>h</TD></TR>
<TR><TD>1</TD><TD>e</TD></TR>
<TR><TD>2</TD><TD>l</TD></TR>
<TR><TD>3</TD><TD>l</TD></TR>
<TR><TD>4</TD><TD>o</TD></TR>
<TR><TD>5</TD><TD> </TD></TR>
<TR><TD PORT="pointee2">6</TD><TD>w</TD></TR>
<TR><TD>7</TD><TD>o</TD></TR>
<TR><TD>8</TD><TD>r</TD></TR>
<TR><TD>9</TD><TD>l</TD></TR>
<TR><TD>10</TD><TD>d</TD></TR>
</TABLE>>];
edge[tailclip="false"];
table0:pointer2:c -> table4:pointee2;
table3:pointer:c -> table4:pointee;
}

View File

@ -53,7 +53,7 @@ function return value is gone. Next, note that we pass `&s1` into
These `&`s are called *references*, and they allow you to refer to some value
without taking ownership of it. Heres a diagram:
DIAGRAM GOES HERE of a &String pointing at a String, with (ptr, len, capacity)
<img alt="&String s pointing at String s1" src="img/trpl04-05.svg" class="center" />
Lets take a closer look at the function call here:

View File

@ -141,7 +141,7 @@ contains a pointer to the 6th byte of `s` and a length value of 5.
In other words, it looks like this:
DIAGRAM GOES HERE of s, hello, and world
<img alt="world containing a pointer to the 6th byte of String s and a length 5" src="img/trpl04-06.svg" class="center" style="width: 50%;" />
With Rusts `..` range syntax, if you want to start at the first index (zero),
you can drop the value before the `..`. In other words, these are equal:

82
src/img/trpl04-05.svg Normal file
View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %3 Pages: 1 -->
<svg
viewBox="0.00 0.00 1500.00 650.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(4.16667 4.16667) rotate(0) translate(4 152)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-152 357,-152 357,4 -4,4"/>
<!-- table0 -->
<g id="node1" class="node"><title>table0</title>
<polyline fill="none" stroke="black" points="8,-124 80,-124 "/>
<text text-anchor="start" x="41.2759" y="-129.8" font-family="Times,serif" font-size="14.00">s</text>
<polygon fill="none" stroke="black" points="8,-104 8,-124 44,-124 44,-104 8,-104"/>
<text text-anchor="start" x="10.8413" y="-109.8" font-family="Times,serif" font-size="14.00">name</text>
<polygon fill="none" stroke="black" points="44,-104 44,-124 80,-124 80,-104 44,-104"/>
<text text-anchor="start" x="46.8413" y="-109.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="8,-84 8,-104 44,-104 44,-84 8,-84"/>
<text text-anchor="start" x="18.2241" y="-89.8" font-family="Times,serif" font-size="14.00">ptr</text>
<polygon fill="none" stroke="black" points="44,-84 44,-104 80,-104 80,-84 44,-84"/>
</g>
<!-- table1 -->
<g id="node2" class="node"><title>table1</title>
<polyline fill="none" stroke="black" points="132,-124 220,-124 "/>
<text text-anchor="start" x="169.776" y="-129.8" font-family="Times,serif" font-size="14.00">s1</text>
<polygon fill="none" stroke="black" points="132,-104 132,-124 184,-124 184,-104 132,-104"/>
<text text-anchor="start" x="142.841" y="-109.8" font-family="Times,serif" font-size="14.00">name</text>
<polygon fill="none" stroke="black" points="184,-104 184,-124 220,-124 220,-104 184,-104"/>
<text text-anchor="start" x="186.841" y="-109.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="132,-84 132,-104 184,-104 184,-84 132,-84"/>
<text text-anchor="start" x="150.224" y="-89.8" font-family="Times,serif" font-size="14.00">ptr</text>
<polygon fill="none" stroke="black" points="184,-84 184,-104 220,-104 220,-84 184,-84"/>
<polygon fill="none" stroke="black" points="132,-64 132,-84 184,-84 184,-64 132,-64"/>
<text text-anchor="start" x="149.448" y="-69.8" font-family="Times,serif" font-size="14.00">len</text>
<polygon fill="none" stroke="black" points="184,-64 184,-84 220,-84 220,-64 184,-64"/>
<text text-anchor="start" x="198.5" y="-69.8" font-family="Times,serif" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="132,-44 132,-64 184,-64 184,-44 132,-44"/>
<text text-anchor="start" x="134.683" y="-49.8" font-family="Times,serif" font-size="14.00">capacity</text>
<polygon fill="none" stroke="black" points="184,-44 184,-64 220,-64 220,-44 184,-44"/>
<text text-anchor="start" x="198.5" y="-49.8" font-family="Times,serif" font-size="14.00">5</text>
</g>
<!-- table0&#45;&gt;table1 -->
<g id="edge2" class="edge"><title>table0:borrower:c&#45;&gt;table1:borrowee</title>
<path fill="none" stroke="black" d="M63,-94C63,-94 92.9658,-94 120.871,-94"/>
<polygon fill="black" stroke="black" points="121,-97.5001 131,-94 121,-90.5001 121,-97.5001"/>
</g>
<!-- table2 -->
<g id="node3" class="node"><title>table2</title>
<polygon fill="none" stroke="black" points="272.5,-104 272.5,-124 309.5,-124 309.5,-104 272.5,-104"/>
<text text-anchor="start" x="275.448" y="-109.8" font-family="Times,serif" font-size="14.00">index</text>
<polygon fill="none" stroke="black" points="309.5,-104 309.5,-124 345.5,-124 345.5,-104 309.5,-104"/>
<text text-anchor="start" x="312.341" y="-109.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="272.5,-84 272.5,-104 309.5,-104 309.5,-84 272.5,-84"/>
<text text-anchor="start" x="287.5" y="-89.8" font-family="Times,serif" font-size="14.00">0</text>
<polygon fill="none" stroke="black" points="309.5,-84 309.5,-104 345.5,-104 345.5,-84 309.5,-84"/>
<text text-anchor="start" x="324" y="-89.8" font-family="Times,serif" font-size="14.00">h</text>
<polygon fill="none" stroke="black" points="272.5,-64 272.5,-84 309.5,-84 309.5,-64 272.5,-64"/>
<text text-anchor="start" x="287.5" y="-69.8" font-family="Times,serif" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="309.5,-64 309.5,-84 345.5,-84 345.5,-64 309.5,-64"/>
<text text-anchor="start" x="324.393" y="-69.8" font-family="Times,serif" font-size="14.00">e</text>
<polygon fill="none" stroke="black" points="272.5,-44 272.5,-64 309.5,-64 309.5,-44 272.5,-44"/>
<text text-anchor="start" x="287.5" y="-49.8" font-family="Times,serif" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="309.5,-44 309.5,-64 345.5,-64 345.5,-44 309.5,-44"/>
<text text-anchor="start" x="325.555" y="-49.8" font-family="Times,serif" font-size="14.00">l</text>
<polygon fill="none" stroke="black" points="272.5,-24 272.5,-44 309.5,-44 309.5,-24 272.5,-24"/>
<text text-anchor="start" x="287.5" y="-29.8" font-family="Times,serif" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="309.5,-24 309.5,-44 345.5,-44 345.5,-24 309.5,-24"/>
<text text-anchor="start" x="325.555" y="-29.8" font-family="Times,serif" font-size="14.00">l</text>
<polygon fill="none" stroke="black" points="272.5,-4 272.5,-24 309.5,-24 309.5,-4 272.5,-4"/>
<text text-anchor="start" x="287.5" y="-9.8" font-family="Times,serif" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="309.5,-4 309.5,-24 345.5,-24 345.5,-4 309.5,-4"/>
<text text-anchor="start" x="324" y="-9.8" font-family="Times,serif" font-size="14.00">o</text>
</g>
<!-- table1&#45;&gt;table2 -->
<g id="edge1" class="edge"><title>table1:pointer:c&#45;&gt;table2:pointee</title>
<path fill="none" stroke="black" d="M203,-94C203,-94 233.186,-94 261.297,-94"/>
<polygon fill="black" stroke="black" points="261.5,-97.5001 271.5,-94 261.5,-90.5001 261.5,-97.5001"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

110
src/img/trpl04-06.svg Normal file
View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: %3 Pages: 1 -->
<svg
viewBox="0.00 0.00 1000.00 1279.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(4.16667 4.16667) rotate(0) translate(4 275)">
<title>%3</title>
<polygon fill="white" stroke="none" points="-4,4 -4,-275 233,-275 233,4 -4,4"/>
<!-- table0 -->
<g id="node1" class="node"><title>table0</title>
<polyline fill="none" stroke="black" points="16,-121 88,-121 "/>
<text text-anchor="start" x="35.6689" y="-126.8" font-family="Times,serif" font-size="14.00">world</text>
<polygon fill="none" stroke="black" points="16,-101 16,-121 52,-121 52,-101 16,-101"/>
<text text-anchor="start" x="18.8413" y="-106.8" font-family="Times,serif" font-size="14.00">name</text>
<polygon fill="none" stroke="black" points="52,-101 52,-121 88,-121 88,-101 52,-101"/>
<text text-anchor="start" x="54.8413" y="-106.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="16,-81 16,-101 52,-101 52,-81 16,-81"/>
<text text-anchor="start" x="26.2241" y="-86.8" font-family="Times,serif" font-size="14.00">ptr</text>
<polygon fill="none" stroke="black" points="52,-81 52,-101 88,-101 88,-81 52,-81"/>
<polygon fill="none" stroke="black" points="16,-61 16,-81 52,-81 52,-61 16,-61"/>
<text text-anchor="start" x="25.4482" y="-66.8" font-family="Times,serif" font-size="14.00">len</text>
<polygon fill="none" stroke="black" points="52,-61 52,-81 88,-81 88,-61 52,-61"/>
<text text-anchor="start" x="66.5" y="-66.8" font-family="Times,serif" font-size="14.00">5</text>
</g>
<!-- table4 -->
<g id="node3" class="node"><title>table4</title>
<polygon fill="none" stroke="black" points="148.5,-224 148.5,-244 185.5,-244 185.5,-224 148.5,-224"/>
<text text-anchor="start" x="151.448" y="-229.8" font-family="Times,serif" font-size="14.00">index</text>
<polygon fill="none" stroke="black" points="185.5,-224 185.5,-244 221.5,-244 221.5,-224 185.5,-224"/>
<text text-anchor="start" x="188.341" y="-229.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="148.5,-204 148.5,-224 185.5,-224 185.5,-204 148.5,-204"/>
<text text-anchor="start" x="163.5" y="-209.8" font-family="Times,serif" font-size="14.00">0</text>
<polygon fill="none" stroke="black" points="185.5,-204 185.5,-224 221.5,-224 221.5,-204 185.5,-204"/>
<text text-anchor="start" x="200" y="-209.8" font-family="Times,serif" font-size="14.00">h</text>
<polygon fill="none" stroke="black" points="148.5,-184 148.5,-204 185.5,-204 185.5,-184 148.5,-184"/>
<text text-anchor="start" x="163.5" y="-189.8" font-family="Times,serif" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="185.5,-184 185.5,-204 221.5,-204 221.5,-184 185.5,-184"/>
<text text-anchor="start" x="200.393" y="-189.8" font-family="Times,serif" font-size="14.00">e</text>
<polygon fill="none" stroke="black" points="148.5,-164 148.5,-184 185.5,-184 185.5,-164 148.5,-164"/>
<text text-anchor="start" x="163.5" y="-169.8" font-family="Times,serif" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="185.5,-164 185.5,-184 221.5,-184 221.5,-164 185.5,-164"/>
<text text-anchor="start" x="201.555" y="-169.8" font-family="Times,serif" font-size="14.00">l</text>
<polygon fill="none" stroke="black" points="148.5,-144 148.5,-164 185.5,-164 185.5,-144 148.5,-144"/>
<text text-anchor="start" x="163.5" y="-149.8" font-family="Times,serif" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="185.5,-144 185.5,-164 221.5,-164 221.5,-144 185.5,-144"/>
<text text-anchor="start" x="201.555" y="-149.8" font-family="Times,serif" font-size="14.00">l</text>
<polygon fill="none" stroke="black" points="148.5,-124 148.5,-144 185.5,-144 185.5,-124 148.5,-124"/>
<text text-anchor="start" x="163.5" y="-129.8" font-family="Times,serif" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="185.5,-124 185.5,-144 221.5,-144 221.5,-124 185.5,-124"/>
<text text-anchor="start" x="200" y="-129.8" font-family="Times,serif" font-size="14.00">o</text>
<polygon fill="none" stroke="black" points="148.5,-104 148.5,-124 185.5,-124 185.5,-104 148.5,-104"/>
<text text-anchor="start" x="163.5" y="-109.8" font-family="Times,serif" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="185.5,-104 185.5,-124 221.5,-124 221.5,-104 185.5,-104"/>
<text text-anchor="start" x="201.75" y="-109.8" font-family="Times,serif" font-size="14.00"> </text>
<polygon fill="none" stroke="black" points="148.5,-84 148.5,-104 185.5,-104 185.5,-84 148.5,-84"/>
<text text-anchor="start" x="163.5" y="-89.8" font-family="Times,serif" font-size="14.00">6</text>
<polygon fill="none" stroke="black" points="185.5,-84 185.5,-104 221.5,-104 221.5,-84 185.5,-84"/>
<text text-anchor="start" x="198.445" y="-89.8" font-family="Times,serif" font-size="14.00">w</text>
<polygon fill="none" stroke="black" points="148.5,-64 148.5,-84 185.5,-84 185.5,-64 148.5,-64"/>
<text text-anchor="start" x="163.5" y="-69.8" font-family="Times,serif" font-size="14.00">7</text>
<polygon fill="none" stroke="black" points="185.5,-64 185.5,-84 221.5,-84 221.5,-64 185.5,-64"/>
<text text-anchor="start" x="200" y="-69.8" font-family="Times,serif" font-size="14.00">o</text>
<polygon fill="none" stroke="black" points="148.5,-44 148.5,-64 185.5,-64 185.5,-44 148.5,-44"/>
<text text-anchor="start" x="163.5" y="-49.8" font-family="Times,serif" font-size="14.00">8</text>
<polygon fill="none" stroke="black" points="185.5,-44 185.5,-64 221.5,-64 221.5,-44 185.5,-44"/>
<text text-anchor="start" x="201.169" y="-49.8" font-family="Times,serif" font-size="14.00">r</text>
<polygon fill="none" stroke="black" points="148.5,-24 148.5,-44 185.5,-44 185.5,-24 148.5,-24"/>
<text text-anchor="start" x="163.5" y="-29.8" font-family="Times,serif" font-size="14.00">9</text>
<polygon fill="none" stroke="black" points="185.5,-24 185.5,-44 221.5,-44 221.5,-24 185.5,-24"/>
<text text-anchor="start" x="201.555" y="-29.8" font-family="Times,serif" font-size="14.00">l</text>
<polygon fill="none" stroke="black" points="148.5,-4 148.5,-24 185.5,-24 185.5,-4 148.5,-4"/>
<text text-anchor="start" x="160" y="-9.8" font-family="Times,serif" font-size="14.00">10</text>
<polygon fill="none" stroke="black" points="185.5,-4 185.5,-24 221.5,-24 221.5,-4 185.5,-4"/>
<text text-anchor="start" x="200" y="-9.8" font-family="Times,serif" font-size="14.00">d</text>
</g>
<!-- table0&#45;&gt;table4 -->
<g id="edge1" class="edge"><title>table0:pointer2:c&#45;&gt;table4:pointee2</title>
<path fill="none" stroke="black" d="M71,-91C71,-91 105.583,-93.4427 137.337,-93.9198"/>
<polygon fill="black" stroke="black" points="137.473,-97.4208 147.5,-94 137.528,-90.4211 137.473,-97.4208"/>
</g>
<!-- table3 -->
<g id="node2" class="node"><title>table3</title>
<polyline fill="none" stroke="black" points="8,-247 96,-247 "/>
<text text-anchor="start" x="49.2759" y="-252.8" font-family="Times,serif" font-size="14.00">s</text>
<polygon fill="none" stroke="black" points="8,-227 8,-247 60,-247 60,-227 8,-227"/>
<text text-anchor="start" x="18.8413" y="-232.8" font-family="Times,serif" font-size="14.00">name</text>
<polygon fill="none" stroke="black" points="60,-227 60,-247 96,-247 96,-227 60,-227"/>
<text text-anchor="start" x="62.8413" y="-232.8" font-family="Times,serif" font-size="14.00">value</text>
<polygon fill="none" stroke="black" points="8,-207 8,-227 60,-227 60,-207 8,-207"/>
<text text-anchor="start" x="26.2241" y="-212.8" font-family="Times,serif" font-size="14.00">ptr</text>
<polygon fill="none" stroke="black" points="60,-207 60,-227 96,-227 96,-207 60,-207"/>
<polygon fill="none" stroke="black" points="8,-187 8,-207 60,-207 60,-187 8,-187"/>
<text text-anchor="start" x="25.4482" y="-192.8" font-family="Times,serif" font-size="14.00">len</text>
<polygon fill="none" stroke="black" points="60,-187 60,-207 96,-207 96,-187 60,-187"/>
<text text-anchor="start" x="74.5" y="-192.8" font-family="Times,serif" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="8,-167 8,-187 60,-187 60,-167 8,-167"/>
<text text-anchor="start" x="10.6826" y="-172.8" font-family="Times,serif" font-size="14.00">capacity</text>
<polygon fill="none" stroke="black" points="60,-167 60,-187 96,-187 96,-167 60,-167"/>
<text text-anchor="start" x="74.5" y="-172.8" font-family="Times,serif" font-size="14.00">5</text>
</g>
<!-- table3&#45;&gt;table4 -->
<g id="edge2" class="edge"><title>table3:pointer:c&#45;&gt;table4:pointee</title>
<path fill="none" stroke="black" d="M79,-217C79,-217 109.163,-214.62 137.289,-214.1"/>
<polygon fill="black" stroke="black" points="137.535,-217.598 147.5,-214 137.466,-210.598 137.535,-217.598"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.8 KiB