Slide 18
Slide 18 text
Basic concepts
•
•
•
•
crate
trait
mod
unsafe
Keywords
•
•
•
•
•
•
•
•
mut: Indicates that a binding or reference is mutable, meaning its value can be changed.
dyn: Used to indicate a dynamic (trait object) type. A trait object is a runtime instance of a type implementing a specific trait.
mpl: Used for implementing a trait for a specific type or defining inherent methods on a type.
move: A keyword used in closures to take ownership of captured variables.
pub: Specifies that an item (e.g., function, module, struct, or enum) should be publicly accessible from outside the current module.
ref: Used in pattern matching to create a reference to the matched value.
Self (capitalized): Refers to the type implementing a trait within the trait definition or implementation block.
use: Used to import items (functions, structs, traits, etc.) from other modules or crates into the current scope.