Keywords Flashcards

1
Q

as

A

perform primitive casting, disambiguate the specific trait containing an item, or rename items in use and extern crate statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

async

A

return a Future instead of blocking the current thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

await

A

suspend execution until the result of a Future is ready

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

break

A

exit a loop immediately

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

const

A

define constant items or constant raw pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

continue

A

continue to the next loop iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

crate

A

link an external crate or a macro variable representing the crate in which the macro is defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

dyn

A

dynamic dispatch to a trait object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

else

A

fallback for if and if let control flow constructs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

enum

A

define an enumeration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

extern

A

link an external crate, function, or variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

false

A

Boolean false literal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

fn

A

define a function or the function pointer type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

for

A

loop over items from an iterator, implement a trait, or specify a higher-ranked lifetime

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

if

A

branch based on the result of a conditional expression

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

impl

A

implement inherent or trait functionality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

in

A

part of for loop syntax

18
Q

let

A

bind a variable

19
Q

loop

A

loop unconditionally

20
Q

match

A

match a value to patterns

21
Q

mod

A

define a module

22
Q

move

A

make a closure take ownership of all its captures

23
Q

mut

A

denote mutability in references, raw pointers, or pattern bindings

24
Q

pub

A

denote public visibility in struct fields, impl blocks, or modules

25
Q

ref

A

bind by reference

26
Q

return

A

return from function

27
Q

Self

A

a type alias for the type we are defining or implementing

28
Q

self

A

method subject or current module

29
Q

static

A

global variable or lifetime lasting the entire program execution

30
Q

struct

A

define a structure

31
Q

super

A

parent module of the current module

32
Q

trait

A

define a trait

33
Q

true

A

Boolean true literal

34
Q

type

A

define a type alias or associated type

35
Q

union

A

define a union and is only a keyword when used in a union declaration

36
Q

unsafe

A

denote unsafe code, functions, traits, or implementations

37
Q

use

A

bring symbols into scope

38
Q

where

A

denote clauses that constrain a type

39
Q

while

A

loop conditionally based on the result of an expression

40
Q

raw identifiers

A

Raw identifiers are the syntax that lets you use keywords where they wouldn’t normally be allowed.

You use a raw identifier by prefixing a keyword with r#.

Raw identifiers allow you to use any word you choose as an identifier, even if that word happens to be a reserved keyword.

In addition, raw identifiers allow you to use libraries written in a different Rust edition than your crate uses.