Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

visibility

Who is allowed to use an item: only its own module, the whole crate, or anyone.

Items are private to their module by default; pub makes them visible wherever their parent is, pub(crate) within the crate, pub(super) in the parent module, and pub(in path) in a named ancestor.

Loading interactive…

Examples

  • If pub struct Setpoint { celsius: f32 } keeps celsius private, code outside its module can call Setpoint::new(21.0) but writing Setpoint { celsius: 21.0 } fails with E0451.

Read the full section →