Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Ekosystem Rusta

Ekosystem Rusta składa się z wielu narzędzi, z których główne to:

  • rustc: kompilator Rusta, który zmienia pliki .rs na pliki binarne i inne formaty pośrednie.

  • cargo: the Rust dependency manager and build tool. Cargo knows how to download dependencies, usually hosted on https://crates.io, and it will pass them to rustc when building your project. Cargo also comes with a built-in test runner which is used to execute unit tests.

  • rustup: the Rust toolchain installer and updater. This tool is used to install and update rustc and cargo when new versions of Rust are released. In addition, rustup can also download documentation for the standard library. You can have multiple versions of Rust installed at once and rustup will let you switch between them as needed.

Kluczowe punkty:

  • Rust ma szybki harmonogram wydań z nową wersją co sześć tygodni. Nowe wersje zachowują kompatybilność wsteczną z starymi wersjami — plus umożliwiają nowe funkcjonalności.

  • Istnieją trzy kanały wydania: “stable” (“stabilny”), “beta” i “nightly” (“nocny”).

  • Nowe funkcje są testowane na “nightly”, “beta” jest tym, co staje się “stable” co sześć tygodni.

  • Dependencies can also be resolved from alternative registries, git, folders, and more.

  • Rust ma również edycje: obecna edycja to Rust 2021. Poprzednie edycje to Rust 2015 i Rust 2018.

    • Edycje mogą wprowadzać do języka zmiany niekompatybilne wstecznie.

    • Aby zapobiec niekompatybilności kodu, edycje są opcjonalne: wybierasz edycję swojej skrzyni za pomocą pliku Cargo.toml.

    • Aby uniknąć podziału ekosystemu, kompilatory Rusta mogą mieszać kod napisany dla różnych edycji.

    • Wspomnij, że dość rzadko używa się kompilatora bezpośrednio, a nie przez cargo (większość użytkowników nigdy tego nie robi).

    • It might be worth alluding that Cargo itself is an extremely powerful and comprehensive tool. It is capable of many advanced features including but not limited to:

    • Przeczytaj więcej w oficjalnej księdze Cargo