RustbyExample
Introduction
Hello World
Comments
Formatted print
Debug
Display
Testcase: List
Formatting
Primitives
Literals and operators
Tuples
Arrays and Slices
Custom types
Structures
Enums
use
C-like
Testcase: linked-list
constants
Variable Bindings
Mutability
Scope and shadowing
Declare first
Casting
Literals
Inference
Alias
Expressions
Flow Control
if/else
loop
Nesting and labels
while
for and range
match
Destructuring
tuples
enums
pointers/ref
structs
Guards
Binding
if let
while let
Functions
Methods
Closures
Capturing
As input parameters
Type anonymity
Input functions
As output parameters
Examples in std
Iterator::any
Iterator::find
Higher Order Functions
Modules
Visibility
Struct visibility
The use declaration
super and self
File hierarchy
Crates
Library
extern crate
Attributes
dead_code
Crates
cfg
Custom
Generics
Functions
Implementation
Traits
Bounds
Testcase: empty bounds
Multiple bounds
Where clauses
Associated items
The Problem
Associated types
Phantom type parameters
Testcase: unit clarification
Scoping rules
RAII
Ownership and moves
Mutability
Borrowing
Mutability
Freezing
Aliasing
The ref pattern
Lifetimes
Explicit annotation
Functions
Methods
Structs
Bounds
Coercion
static
elision
Traits
Derive
Operator Overloading
Drop
Iterators
Clone
macro_rules!
Designators
Overload
Repeat
DRY (Don't Repeat Yourself)
Error handling
panic
Option & unwrap
Combinators: map
Combinators: and_then
Result
map for Result
aliases for Result
Multiple error types
Early returns
Introducing try!
Defining an error type
Other uses of try!
Boxing errors
Std library types
Box, stack and heap
Vectors
Strings
Option
Result
try!
panic!
HashMap
Alternate/custom key types
HashSet
Std misc
Threads
Channels
Path
File I/O
open
create
Child processes
Pipes
Wait
Filesystem Operations
Program arguments
Argument parsing
Foreign Function Interface
Meta
Documentation
Testing
Unsafe operations
Powered by
GitBook
Custom types
3 Custom types
Rust 사용자 정의 데이터 타입은 주로 두 키워드를 통해 형성된다.
struct
: 구조체를 정의한다..
enum
: 열거형을 정의한다.
상수들은
const
혹은
static
키워드로 생성할 수 있다.
results matching "
"
No results matching "
"