9.14 Additional Topics

9.14.1 Struct Visibility

By default, structs and their fields are private to the module. You can make them public using the pub keyword.

pub struct PublicStruct {
    pub field: Type,
}
  • Modules and Crates: We'll discuss visibility and modules in a later chapter.