mirror of
https://github.com/darkicewolf50/RustBrock.git
synced 2025-06-15 04:54:17 -06:00
tried out obsidian, started ch 6.2
This commit is contained in:
parent
fdbc82191c
commit
30047d24ea
3
.obsidian/app.json
vendored
Normal file
3
.obsidian/app.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"promptDelete": false
|
||||
}
|
3
.obsidian/appearance.json
vendored
Normal file
3
.obsidian/appearance.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"baseFontSize": 20
|
||||
}
|
30
.obsidian/core-plugins.json
vendored
Normal file
30
.obsidian/core-plugins.json
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"properties": false,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"bookmarks": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false
|
||||
}
|
22
.obsidian/graph.json
vendored
Normal file
22
.obsidian/graph.json
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"collapse-filter": true,
|
||||
"search": "",
|
||||
"showTags": false,
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": false,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": true,
|
||||
"colorGroups": [],
|
||||
"collapse-display": true,
|
||||
"showArrow": false,
|
||||
"textFadeMultiplier": 0,
|
||||
"nodeSizeMultiplier": 1,
|
||||
"lineSizeMultiplier": 1,
|
||||
"collapse-forces": true,
|
||||
"centerStrength": 0.518713248970312,
|
||||
"repelStrength": 10,
|
||||
"linkStrength": 1,
|
||||
"linkDistance": 250,
|
||||
"scale": 1.0000000000000013,
|
||||
"close": false
|
||||
}
|
193
.obsidian/workspace.json
vendored
Normal file
193
.obsidian/workspace.json
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "669114c9aeb479f1",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "0396922c68d14225",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "bda58467a9a0a34e",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "data_types.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "data_types"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "bc05904661f131c7",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Constants.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "Constants"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "4a2ac149e0acbcf8",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "10608f12da25d504",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "2762bac0796f3b15",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical"
|
||||
},
|
||||
"icon": "lucide-folder-closed",
|
||||
"title": "Files"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "e01f0973d4ae17ac",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
},
|
||||
"icon": "lucide-search",
|
||||
"title": "Search"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "a5a36aa2f6495eb4",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "bookmarks",
|
||||
"state": {},
|
||||
"icon": "lucide-bookmark",
|
||||
"title": "Bookmarks"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300
|
||||
},
|
||||
"right": {
|
||||
"id": "b825b33a537311a6",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "6b5c338364576725",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "64f5647672cce551",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"file": "Constants.md",
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
"showSearch": false,
|
||||
"searchQuery": "",
|
||||
"backlinkCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-coming-in",
|
||||
"title": "Backlinks for Constants"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "ae0f9a12d31c4020",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"file": "Constants.md",
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-going-out",
|
||||
"title": "Outgoing links from Constants"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "5ce87307dea085ad",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true
|
||||
},
|
||||
"icon": "lucide-tags",
|
||||
"title": "Tags"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "2673cce22cbc6751",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"file": "Constants.md"
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "Outline of Constants"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 3
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300,
|
||||
"collapsed": true
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"switcher:Open quick switcher": false,
|
||||
"graph:Open graph view": false,
|
||||
"canvas:Create new canvas": false,
|
||||
"daily-notes:Open today's daily note": false,
|
||||
"templates:Insert template": false,
|
||||
"command-palette:Open command palette": false
|
||||
}
|
||||
},
|
||||
"active": "bda58467a9a0a34e",
|
||||
"lastOpenFiles": [
|
||||
"README.md",
|
||||
"data_types.md",
|
||||
"Untitled.canvas",
|
||||
"ownership.md",
|
||||
"Variables.md",
|
||||
"Data Types.md",
|
||||
"Constants.md",
|
||||
"Enums.md",
|
||||
"Structures.md",
|
||||
"Primitives.md"
|
||||
]
|
||||
}
|
11
Constants.md
Normal file
11
Constants.md
Normal file
@ -0,0 +1,11 @@
|
||||
# Constants
|
||||
|
||||
- Can be declared anywhere,
|
||||
- The convention to use all caps in a constant's name
|
||||
- Needs const keyword
|
||||
- Not always evaluated at compile time (there are rules for this but too complex to know everything)
|
||||
- Variables can only be assigned once (needs mut to assign more than once (need to be same type))
|
||||
|
||||
```rust
|
||||
const SECONDS_PER_HOUR: i32 = 60 * 60;
|
||||
```
|
9
Data Types.md
Normal file
9
Data Types.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Data Types
|
||||
There are many different data types [variables](Variables.md) can [own](ownership.md)
|
||||
|
||||
There are many data types such as:
|
||||
|
||||
1. [Constants](Constants.md)
|
||||
2. [Primitives](Primitives.md)
|
||||
3. [Structures](Structures.md)
|
||||
5. [Enums](Enums.md)
|
0
Primitives.md
Normal file
0
Primitives.md
Normal file
0
Structures.md
Normal file
0
Structures.md
Normal file
32
Variables.md
Normal file
32
Variables.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Variables
|
||||
- Are Immutable by default
|
||||
- can be inferred but sometimes needs explicit typing
|
||||
|
||||
```rust
|
||||
let foo = 5;
|
||||
```
|
||||
- Need to add mut keyword to enable rewriting, generally avoid unless actually used
|
||||
|
||||
```rust
|
||||
let mut bar = 6;
|
||||
```
|
||||
|
||||
# SHADOWING
|
||||
|
||||
#### Cannot have mutable shadows
|
||||
|
||||
allows for reuse of namespace instead of spaces_str and spaces_num
|
||||
```rust
|
||||
let spaces = " _ _ ";
|
||||
let spaces = spaces.len();
|
||||
// will output 5 instead of " _ _ " beacuse that is how long it is
|
||||
// the shadow of spaces (first) wont be printed until the overshadow of spaces goes out of scope
|
||||
println!("{spaces}"); // output: 5
|
||||
```
|
||||
|
||||
not allowed shadow
|
||||
```rust
|
||||
let mut spaces = " _ _ ";
|
||||
spaces = spaces.len();
|
||||
```
|
||||
cannot change type of variable once declared
|
@ -13,7 +13,7 @@ const SECONDS_PER_HOUR: i32 = 60 * 60;
|
||||
|
||||
## Variables
|
||||
|
||||
variables are immuatable by default
|
||||
variables are immutable by default
|
||||
variables can be inferred but sometimes needs explicit typing
|
||||
|
||||
```rust
|
||||
@ -733,6 +733,7 @@ this is a problem of implementation
|
||||
|
||||
rust doesnt have nulls but can be expressed as the enum Option<T>
|
||||
which is defined by the standard library as
|
||||
|
||||
```rust
|
||||
enum Option<T> {
|
||||
None,
|
||||
@ -740,16 +741,16 @@ enum Option<T> {
|
||||
}
|
||||
```
|
||||
|
||||
dont need to explicitly bring into scope but can
|
||||
don't need to explicitly bring into scope but can
|
||||
can also call it by ``Some`` or ``None``
|
||||
<T> is the genertic type parameter
|
||||
all of these replace the T generic tpye in the Option enum
|
||||
<T> is the generic type parameter
|
||||
all of these replace the T generic type in the Option enum
|
||||
|
||||
```rust
|
||||
let some_number = Some(5); // can be inferred due to the value being stored
|
||||
let some_char = Some('e'); // can be inferred due to the value being stored
|
||||
|
||||
let absent_number: Option<i32> = None; // needs generic type sepcification for the None option
|
||||
let absent_number: Option<i32> = None; // needs generic type specification for the None option
|
||||
```
|
||||
|
||||
all valid T is any type
|
||||
@ -761,12 +762,92 @@ the compiler will always ensure that i8 is a valid value
|
||||
the complier will not ensure that Option<i8> stores a valid value
|
||||
will have to check if it has a non-null value in the enum then convert it into a T type from Option<T> type in order to use it
|
||||
|
||||
this eliminates the issue of it being assued that is it a non-null tpye by being forced to handle the null variant
|
||||
everywhere where the value isnt a Option<T> can be safely assumed to be a non null type
|
||||
this eliminates the issue of it being assumed that is it a non-null type by being forced to handle the null variant
|
||||
everywhere where the value isn't a Option<T> can be safely assumed to be a non null type
|
||||
|
||||
[documentation for Option T](https://doc.rust-lang.org/std/option/enum.Option.html)
|
||||
|
||||
This has lots of useful values attached to it
|
||||
|
||||
in general you want code that only runs when you have some T and another code that runs when you have a None value
|
||||
The match expression is a control flow construct that an handle this, it is suited for enums, it will run different code depending on the enum state/value that it has that code can then be used inside the mtaching value
|
||||
In general you want code that only runs when you have some T and another code that runs when you have a None value
|
||||
The match expression is a control flow construct that an handle this, it is suited for enums, it will run different code depending on the enum state/value that it has that code can then be used inside the matching value
|
||||
|
||||
# Match and Control Flow
|
||||
|
||||
A construct that allows you to compare against a series of patterns then execute code based on which pattern matches
|
||||
|
||||
Patterns can be made up of literal values, variable names, wildcards and many other things
|
||||
|
||||
The power of matches comes from the expressiveness in patterns and the fact that the compiler handles all possible cases
|
||||
|
||||
This is like a coin storer where the coin goes into the hole that fits first
|
||||
Match does this same concept
|
||||
|
||||
Coin Example
|
||||
This takes in a coin enum and returns the value in cents
|
||||
```rust
|
||||
enum Coin {
|
||||
Penny,
|
||||
Nickel,
|
||||
Dime,
|
||||
Quarter,
|
||||
}
|
||||
|
||||
fn value_in_cents (coin: Coin) -> u8 {
|
||||
match coin {
|
||||
Coin::Penny => 1,
|
||||
Coin::Nickel => 5,
|
||||
Coin::Dime => 10,
|
||||
Coin::Quarter => 25,
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
It is used by first saying match then an expression (like a variable without ;)
|
||||
This is like a if statement but if needs to evaluate to a Boolean for the condition
|
||||
|
||||
Match arms has a pattern then the code to run separated by a => , or a => {}, (optional comma) (for multiline/longer expressions)
|
||||
If the pattern doesn't match then the next arm is tried until a arm fits (compiler will check that all possibilities are accounted for)
|
||||
|
||||
## Patterns that Bind to Values
|
||||
Arms can bind to parts of values that match the pattern
|
||||
This can allow us to extract values out of enum variants
|
||||
|
||||
example
|
||||
quarters now have a state in which they were minted in
|
||||
|
||||
```rust
|
||||
#[derive(Debug)] // so we can inspect the state in a minute
|
||||
enum UsState {
|
||||
Alabama,
|
||||
Alaska,
|
||||
// --snip--
|
||||
}
|
||||
|
||||
enum Coin {
|
||||
Penny,
|
||||
Nickel,
|
||||
Dime,
|
||||
Quarter(UsState),
|
||||
}
|
||||
|
||||
fn value_in_cents(coin: Coin) -> u8 {
|
||||
match coin {
|
||||
Coin::Penny => 1,
|
||||
Coin::Nickel => 5,
|
||||
Coin::Dime => 10,
|
||||
// state is a bind
|
||||
Coin::Quarter(state) => { // the binding for state will be the value UsState::Alaska
|
||||
println!("State quarter from {state:?}!");
|
||||
25
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
if the value to match was
|
||||
coin::Quarter(UsState::Alaska)
|
||||
then it would print out State quarter from Alaska
|
||||
because that is the only pattern that matches
|
||||
|
||||
## Matching with Option T
|
||||
|
@ -1 +1 @@
|
||||
{"rustc_fingerprint":13662911779824945272,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.83.0 (90b35a623 2024-11-26)\nbinary: rustc\ncommit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\ncommit-date: 2024-11-26\nhost: x86_64-pc-windows-msvc\nrelease: 1.83.0\nLLVM version: 19.1.1\n","stderr":""},"12744816824612481171":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"lahfsahf\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nub_checks\nwindows\n","stderr":""}},"successes":{}}
|
||||
{"rustc_fingerprint":13662911779824945272,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.83.0 (90b35a623 2024-11-26)\nbinary: rustc\ncommit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\ncommit-date: 2024-11-26\nhost: x86_64-pc-windows-msvc\nrelease: 1.83.0\nLLVM version: 19.1.1\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"lahfsahf\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nub_checks\nwindows\n","stderr":""},"12744816824612481171":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""}},"successes":{}}
|
@ -1 +1 @@
|
||||
{"rustc_fingerprint":13662911779824945272,"outputs":{"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.83.0 (90b35a623 2024-11-26)\nbinary: rustc\ncommit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\ncommit-date: 2024-11-26\nhost: x86_64-pc-windows-msvc\nrelease: 1.83.0\nLLVM version: 19.1.1\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"lahfsahf\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nub_checks\nwindows\n","stderr":""},"12744816824612481171":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""}},"successes":{}}
|
||||
{"rustc_fingerprint":13662911779824945272,"outputs":{"12744816824612481171":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.83.0 (90b35a623 2024-11-26)\nbinary: rustc\ncommit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\ncommit-date: 2024-11-26\nhost: x86_64-pc-windows-msvc\nrelease: 1.83.0\nLLVM version: 19.1.1\n","stderr":""},"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Brock\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\npacked\n___\ndebug_assertions\nfmt_debug=\"full\"\noverflow_checks\npanic=\"unwind\"\nproc_macro\nrelocation_model=\"pic\"\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"cmpxchg16b\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"lahfsahf\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_has_atomic\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"pc\"\nub_checks\nwindows\n","stderr":""}},"successes":{}}
|
@ -6,9 +6,9 @@
|
||||
1. When owner goes out of scope, the value will be dropped
|
||||
|
||||
# Scope
|
||||
Range in which a veraible is valid, noramlly indicated by a {inside is a scope}
|
||||
Range in which a variable is valid, normally indicated by a {inside is a scope}
|
||||
|
||||
Variables are only vaid between the time they are decalred and the end of a scope
|
||||
Variables are only valid between the time they are declared and the end of a scope
|
||||
|
||||
# Shallow Copy
|
||||
This causes a move (shallow copy) to s2 where s2 has the value previously owned by s1
|
||||
|
Loading…
x
Reference in New Issue
Block a user