Modules (mod, pub, use)
Në shqip: Modulet në Rust
ShpjegimiSQ
Kodi në Rust ndahet në module me mod. Çdo gjë është private si parazgjedhje — me pub e bën publike. Me use i sjell emrat në skedarin tënd: use crate::modelet::Nxenes;.
EnglishEN
Rust code is split into modules with mod. Everything is private by default — pub makes it public. With use you bring names into your file: use crate::models::Student;.
Si ta mendosh
Si dhomat e një shtëpie: dyert janë të mbyllura, përveç atyre që i hap qëllimisht.
Lexoje në anglisht
Like rooms in a house: doors are closed except the ones you deliberately open.
Shembull kodirust
mod modelet {
pub struct Nxenes { pub emri: String }
}
use modelet::Nxenes;