Rust

Ownership

Në shqip: Pronësia

ShpjegimiSQ

Ideja kryesore e Rust-it: çdo vlerë ka një pronar të vetëm. Kur pronari del nga blloku, vlera fshihet vetë — pa garbage collector dhe pa free() me dorë. Kështu Rust-i është i shpejtë dhe i sigurt njëkohësisht.

EnglishEN

Rust's core idea: every value has exactly one owner. When the owner goes out of scope, the value is freed automatically — no garbage collector and no manual free(). That's how Rust is fast and safe at the same time.

Si ta mendosh

Si një libër me një pronar të vetëm: kur ai largohet nga shkolla, libri kthehet në bibliotekë.

Lexoje në anglisht

Like a book with a single owner: when they leave the school, the book goes back to the library.

Shembull kodirust

{
    let s = String::from("Arta");   // s është pronari
}   // këtu s fshihet vetë

Terma të lidhur