diff --git a/po/fr.po b/po/fr.po index fceab189114..2bf04e8ed83 100644 --- a/po/fr.po +++ b/po/fr.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-01-24T13:24:49+01:00\n" +"POT-Creation-Date: 2024-04-05T16:37:18-04:00\n" "PO-Revision-Date: 2024-02-02 17:59-0500\n" "Last-Translator: Olivier Charrez \n" "Language-Team: French \n" @@ -56,7 +56,7 @@ msgstr "Jour 1 : Matin" msgid "Welcome" msgstr "Bienvenue" -#: src/SUMMARY.md src/hello-world.md src/hello-world/hello-world.md +#: src/SUMMARY.md src/hello-world.md src/types-and-values/hello-world.md #, fuzzy msgid "Hello, World" msgstr "Bonjour le monde!" @@ -89,11 +89,6 @@ msgstr "" msgid "Arithmetic" msgstr "" -#: src/SUMMARY.md src/types-and-values/strings.md -#, fuzzy -msgid "Strings" -msgstr "Cordes" - #: src/SUMMARY.md src/types-and-values/inference.md msgid "Type Inference" msgstr "Inférence de type" @@ -109,9 +104,9 @@ msgstr "" #: src/generics/solution.md src/std-types/solution.md #: src/std-traits/solution.md src/memory-management/solution.md #: src/smart-pointers/solution.md src/borrowing/solution.md -#: src/slices-and-lifetimes/solution.md src/iterators/solution.md -#: src/modules/solution.md src/testing/solution.md -#: src/error-handling/solution.md src/unsafe-rust/solution.md +#: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md +#: src/testing/solution.md src/error-handling/solution.md +#: src/unsafe-rust/solution.md #, fuzzy msgid "Solution" msgstr "Solutions" @@ -121,24 +116,42 @@ msgstr "Solutions" msgid "Control Flow Basics" msgstr "Flux de contrôle" -#: src/SUMMARY.md src/control-flow-basics/conditionals.md -msgid "Conditionals" -msgstr "" +#: src/SUMMARY.md +#, fuzzy +msgid "`if` Expressions" +msgstr "expressions \"si\"" #: src/SUMMARY.md src/control-flow-basics/loops.md #, fuzzy msgid "Loops" msgstr "Boucles `for`" +#: src/SUMMARY.md src/control-flow-basics/loops/for.md +#, fuzzy +msgid "`for`" +msgstr "Boucles `for`" + +#: src/SUMMARY.md src/control-flow-basics/loops/loop.md +msgid "`loop`" +msgstr "" + #: src/SUMMARY.md src/control-flow-basics/break-continue.md #, fuzzy msgid "`break` and `continue`" msgstr "`pause` et `continue`" +#: src/SUMMARY.md src/control-flow-basics/break-continue/labels.md +msgid "Labels" +msgstr "" + #: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes.md msgid "Blocks and Scopes" msgstr "" +#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md +msgid "Scopes and Shadowing" +msgstr "Portée et masquage" + #: src/SUMMARY.md src/control-flow-basics/functions.md msgid "Functions" msgstr "Fonctions" @@ -156,23 +169,25 @@ msgid "Day 1: Afternoon" msgstr "Jour 1 : Après-midi" #: src/SUMMARY.md src/tuples-and-arrays.md -#: src/tuples-and-arrays/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "" +#: src/SUMMARY.md src/tuples-and-arrays/arrays.md +msgid "Arrays" +msgstr "" + +#: src/SUMMARY.md src/tuples-and-arrays/tuples.md +msgid "Tuples" +msgstr "" + #: src/SUMMARY.md src/tuples-and-arrays/iteration.md #, fuzzy msgid "Array Iteration" msgstr "Iterator" -#: src/SUMMARY.md src/tuples-and-arrays/match.md src/pattern-matching.md -msgid "Pattern Matching" -msgstr "Filtrage par motif" - #: src/SUMMARY.md src/tuples-and-arrays/destructuring.md -#: src/pattern-matching/destructuring.md #, fuzzy -msgid "Destructuring" +msgid "Patterns and Destructuring" msgstr "Déstructuration des énumérations" #: src/SUMMARY.md src/tuples-and-arrays/exercise.md @@ -193,6 +208,16 @@ msgstr "Références" msgid "Exclusive References" msgstr "Références invalides" +#: src/SUMMARY.md +#, fuzzy +msgid "Slices: `&[T]`" +msgstr "Tranches" + +#: src/SUMMARY.md src/references/strings.md +#, fuzzy +msgid "Strings" +msgstr "Cordes" + #: src/SUMMARY.md src/references/exercise.md msgid "Exercise: Geometry" msgstr "" @@ -215,10 +240,15 @@ msgstr "Structures tuple" msgid "Enums" msgstr "Énumérations" -#: src/SUMMARY.md src/user-defined-types/static-and-const.md +#: src/SUMMARY.md +#, fuzzy +msgid "Static" +msgstr "`statique`" + +#: src/SUMMARY.md #, fuzzy -msgid "Static and Const" -msgstr "static & const" +msgid "Const" +msgstr "`const`" #: src/SUMMARY.md src/user-defined-types/aliases.md msgid "Type Aliases" @@ -232,6 +262,19 @@ msgstr "" msgid "Day 2: Morning" msgstr "Jour 2 : Matin" +#: src/SUMMARY.md src/pattern-matching.md +msgid "Pattern Matching" +msgstr "Filtrage par motif" + +#: src/SUMMARY.md src/pattern-matching/match.md +msgid "Matching Values" +msgstr "" + +#: src/SUMMARY.md src/pattern-matching/destructuring.md +#, fuzzy +msgid "Destructuring" +msgstr "Déstructuration des énumérations" + #: src/SUMMARY.md src/pattern-matching/let-control-flow.md #, fuzzy msgid "Let Control Flow" @@ -254,16 +297,27 @@ msgstr "Méthodes" msgid "Traits" msgstr "Traits" +#: src/SUMMARY.md src/methods-and-traits/traits/implementing.md +#, fuzzy +msgid "Implementing Traits" +msgstr "Implémentation de traits non sécurisés" + +#: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md +#, fuzzy +msgid "Supertraits" +msgstr "Plus de traits" + +#: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md +#, fuzzy +msgid "Associated Types" +msgstr "Types scalaires" + #: src/SUMMARY.md src/methods-and-traits/deriving.md #, fuzzy msgid "Deriving" msgstr "Traits dérivés" -#: src/SUMMARY.md src/methods-and-traits/trait-objects.md -msgid "Trait Objects" -msgstr "Objets traits" - -#: src/SUMMARY.md src/methods-and-traits/exercise.md +#: src/SUMMARY.md #, fuzzy msgid "Exercise: Generic Logger" msgstr "Exercices" @@ -281,6 +335,11 @@ msgstr "Fonctions externes" msgid "Generic Data Types" msgstr "Types de données génériques" +#: src/SUMMARY.md src/generics/generic-traits.md +#, fuzzy +msgid "Generic Traits" +msgstr "Génériques" + #: src/SUMMARY.md src/generics/trait-bounds.md msgid "Trait Bounds" msgstr "Traits lié" @@ -322,7 +381,8 @@ msgstr "`Durée`" msgid "`Result`" msgstr "`Option`, `Résultat`" -#: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md +#: src/SUMMARY.md src/android/aidl/types/primitives.md +#: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "`String`" msgstr "String" @@ -444,6 +504,10 @@ msgstr "`Boîte`" msgid "`Rc`" msgstr "`Rc`" +#: src/SUMMARY.md src/smart-pointers/trait-objects.md +msgid "Trait Objects" +msgstr "Objets traits" + #: src/SUMMARY.md src/smart-pointers/exercise.md msgid "Exercise: Binary Tree" msgstr "" @@ -476,22 +540,11 @@ msgstr "Interopérabilité" msgid "Exercise: Health Statistics" msgstr "Statistiques de santé" -#: src/SUMMARY.md src/slices-and-lifetimes.md -#, fuzzy -msgid "Slices and Lifetimes" +#: src/SUMMARY.md src/lifetimes.md +msgid "Lifetimes" msgstr "Durées de vie" -#: src/SUMMARY.md -#, fuzzy -msgid "Slices: `&[T]`" -msgstr "Tranches" - -#: src/SUMMARY.md src/slices-and-lifetimes/str.md -#, fuzzy -msgid "String References" -msgstr "Références invalides" - -#: src/SUMMARY.md src/slices-and-lifetimes/lifetime-annotations.md +#: src/SUMMARY.md src/lifetimes/lifetime-annotations.md #, fuzzy msgid "Lifetime Annotations" msgstr "Durées de vie dans les appels de fonction" @@ -506,7 +559,7 @@ msgstr "Durées de vie" msgid "Struct Lifetimes" msgstr "Durées de vie" -#: src/SUMMARY.md src/slices-and-lifetimes/exercise.md +#: src/SUMMARY.md src/lifetimes/exercise.md msgid "Exercise: Protobuf Parsing" msgstr "" @@ -573,18 +626,6 @@ msgstr "Modules de test" msgid "Other Types of Tests" msgstr "Autres projets" -#: src/SUMMARY.md src/testing/useful-crates.md -msgid "Useful Crates" -msgstr "Crates utiles" - -#: src/SUMMARY.md src/testing/googletest.md -msgid "GoogleTest" -msgstr "" - -#: src/SUMMARY.md src/testing/mocking.md -msgid "Mocking" -msgstr "" - #: src/SUMMARY.md src/testing/lints.md msgid "Compiler Lints and Clippy" msgstr "" @@ -692,19 +733,29 @@ msgstr "Bibliothèque" msgid "AIDL" msgstr "AIDL" +#: src/SUMMARY.md src/android/aidl/birthday-service.md +#, fuzzy +msgid "Birthday Service Tutorial" +msgstr "_service_anniversaire/src/lib.rs_ :" + #: src/SUMMARY.md msgid "Interface" msgstr "Interface" #: src/SUMMARY.md -msgid "Implementation" -msgstr "Mise en œuvre" +msgid "Service API" +msgstr "" + +#: src/SUMMARY.md +#, fuzzy +msgid "Service" +msgstr "Serveur" #: src/SUMMARY.md msgid "Server" msgstr "Serveur" -#: src/SUMMARY.md src/android/aidl/deploy.md +#: src/SUMMARY.md src/android/aidl/example-service/deploy.md msgid "Deploy" msgstr "Déployer" @@ -712,10 +763,51 @@ msgstr "Déployer" msgid "Client" msgstr "Client" -#: src/SUMMARY.md src/android/aidl/changing.md +#: src/SUMMARY.md src/android/aidl/example-service/changing-definition.md msgid "Changing API" msgstr "Modification de l'API" +#: src/SUMMARY.md +#, fuzzy +msgid "Updating Implementations" +msgstr "Mise en œuvre" + +#: src/SUMMARY.md +#, fuzzy +msgid "AIDL Types" +msgstr "Types" + +#: src/SUMMARY.md src/android/aidl/types/primitives.md +msgid "Primitive Types" +msgstr "" + +#: src/SUMMARY.md src/android/aidl/types/arrays.md +#, fuzzy +msgid "Array Types" +msgstr "Types composés" + +#: src/SUMMARY.md src/android/aidl/types/objects.md +#, fuzzy +msgid "Sending Objects" +msgstr "Objets traits" + +#: src/SUMMARY.md src/android/aidl/types/parcelables.md +#, fuzzy +msgid "Parcelables" +msgstr "Variables" + +#: src/SUMMARY.md src/android/aidl/types/file-descriptor.md +msgid "Sending Files" +msgstr "" + +#: src/SUMMARY.md src/android/testing/googletest.md +msgid "GoogleTest" +msgstr "" + +#: src/SUMMARY.md src/android/testing/mocking.md +msgid "Mocking" +msgstr "" + #: src/SUMMARY.md src/android/logging.md src/bare-metal/aps/logging.md msgid "Logging" msgstr "Journalisation" @@ -1061,6 +1153,10 @@ msgstr "Utilisation" msgid "Exceptions" msgstr "Exceptions" +#: src/SUMMARY.md +msgid "Useful Crates" +msgstr "Crates utiles" + #: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md #, fuzzy msgid "`zerocopy`" @@ -1298,6 +1394,10 @@ msgstr "" "depuis une autre adresse, n'hésitez pas à suivre ce lien pour accéder à la " "dernière version." +#: src/index.md +msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." +msgstr "" + #: src/index.md msgid "" "The goal of the course is to teach you Rust. We assume you don't know " @@ -1583,142 +1683,10 @@ msgstr "" "Les quatre premiers jours constituent les [Fondamentaux de Rust](../welcome-" "day-1.md). Le rythme est soutenu et nous couvrons beaucoup de sujets!" -#: src/running-the-course/course-structure.md -msgid "Course schedule:" -msgstr "Structure du cours:" - -#: src/running-the-course/course-structure.md -msgid "Day 1 Morning (3 hours, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-1.md) (5 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Hello, World](../hello-world.md) (20 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Types and Values](../types-and-values.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Control Flow Basics](../control-flow-basics.md) (1 hour)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 1 Afternoon (2 hours and 55 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Tuples and Arrays](../tuples-and-arrays.md) (1 hour)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[References](../references.md) (50 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 2 Morning (3 hours and 5 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-2.md) (3 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -#, fuzzy -msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" -msgstr "" -"Voir [Filtrage par motif](../pattern-matching.md) pour plus de détails sur " -"les motifs avec Rust." - -#: src/running-the-course/course-structure.md -msgid "[Methods and Traits](../methods-and-traits.md) (55 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Generics](../generics.md) (45 minutes)" -msgstr "" - #: src/running-the-course/course-structure.md #, fuzzy -msgid "Day 2 Afternoon (3 hours, including breaks)" -msgstr "Exercices de l'après-midi du jour 2" - -#: src/running-the-course/course-structure.md -msgid "[Standard Library Types](../std-types.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 3 Morning (2 hours and 15 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-3.md) (3 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Memory Management](../memory-management.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Smart Pointers](../smart-pointers.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 3 Afternoon (2 hours and 20 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Borrowing](../borrowing.md) (1 hour)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "" -"[Slices and Lifetimes](../slices-and-lifetimes.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Morning (3 hours and 5 minutes, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-4.md) (3 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Iterators](../iterators.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Modules](../modules.md) (40 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Testing](../testing.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Afternoon (2 hours, including breaks)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Error Handling](../error-handling.md) (45 minutes)" -msgstr "" - -#: src/running-the-course/course-structure.md -msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "" +msgid "{{%course outline Fundamentals}}" +msgstr "Fondamentaux de Rust" #: src/running-the-course/course-structure.md msgid "Deep Dives" @@ -1945,8 +1913,9 @@ msgstr "" #, fuzzy msgid "" "[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" -"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), and " -"[@jooyunghan](https://github.com/jooyunghan)." +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " +"[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." +"com/namhyung)." msgstr "" "[coréen](https://google.github.io/comprehensive-rust/ko/) par [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) et " @@ -2001,6 +1970,17 @@ msgid "" "momotaro1105)." msgstr "" +#: src/running-the-course/translations.md +#, fuzzy +msgid "" +"[Italian](https://google.github.io/comprehensive-rust/it/) by " +"[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" +"github.com/detro)." +msgstr "" +"[coréen](https://google.github.io/comprehensive-rust/ko/) par [@keispace]" +"(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp) et " +"[@jooyunghan](https://github.com/jooyunghan)." + #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" @@ -2116,10 +2096,9 @@ msgstr "" "standard. Vous pouvez avoir plusieurs versions de Rust installées à la fois " "et `rustup` vous permettra de basculer entre elles au besoin." -#: src/cargo/rust-ecosystem.md src/hello-world/hello-world.md -#: src/tuples-and-arrays/tuples-and-arrays.md src/references/exclusive.md -#: src/pattern-matching/destructuring.md src/memory-management/move.md -#: src/error-handling/try.md src/android/setup.md src/concurrency/threads.md +#: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md +#: src/references/exclusive.md src/pattern-matching/destructuring.md +#: src/memory-management/move.md src/error-handling/try.md src/android/setup.md #: src/async/async-await.md msgid "Key points:" msgstr "Points clés:" @@ -2448,40 +2427,20 @@ msgstr "" #: src/welcome-day-2-afternoon.md src/welcome-day-3.md #: src/welcome-day-3-afternoon.md src/welcome-day-4.md #: src/welcome-day-4-afternoon.md -msgid "In this session:" +msgid "{{%session outline}}" msgstr "" #: src/welcome-day-1.md -msgid "[Welcome](./welcome-day-1.md) (5 minutes)" -msgstr "" +msgid "Please remind the students that:" +msgstr "Veuillez rappeler aux élèves que :" #: src/welcome-day-1.md -msgid "[Hello, World](./hello-world.md) (20 minutes)" +#, fuzzy +msgid "" +"They should ask questions when they get them, don't save them to the end." msgstr "" - -#: src/welcome-day-1.md -msgid "[Types and Values](./types-and-values.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/welcome-day-1.md -msgid "[Control Flow Basics](./control-flow-basics.md) (1 hour)" -msgstr "" - -#: src/welcome-day-1.md src/welcome-day-2-afternoon.md -msgid "Including 10 minute breaks, this session should take about 3 hours" -msgstr "" - -#: src/welcome-day-1.md -msgid "Please remind the students that:" -msgstr "Veuillez rappeler aux élèves que :" - -#: src/welcome-day-1.md -#, fuzzy -msgid "" -"They should ask questions when they get them, don't save them to the end." -msgstr "" -"Ils doivent poser des questions lorsqu'ils les reçoivent, ne les enregistrez " -"pas jusqu'à la fin." +"Ils doivent poser des questions lorsqu'ils les reçoivent, ne les enregistrez " +"pas jusqu'à la fin." #: src/welcome-day-1.md #, fuzzy @@ -2544,30 +2503,9 @@ msgstr "" #: src/tuples-and-arrays.md src/references.md src/user-defined-types.md #: src/pattern-matching.md src/methods-and-traits.md src/generics.md #: src/std-types.md src/std-traits.md src/memory-management.md -#: src/smart-pointers.md src/borrowing.md src/slices-and-lifetimes.md -#: src/iterators.md src/modules.md src/testing.md src/error-handling.md -#: src/unsafe-rust.md -msgid "In this segment:" -msgstr "" - -#: src/hello-world.md -msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Hello, World](./hello-world/hello-world.md) (5 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "[Playground](./hello-world/playground.md) (2 minutes)" -msgstr "" - -#: src/hello-world.md -msgid "This segment should take about 20 minutes" +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/iterators.md +#: src/modules.md src/testing.md src/error-handling.md src/unsafe-rust.md +msgid "{{%segment outline}}" msgstr "" #: src/hello-world/what-is-rust.md @@ -2664,102 +2602,6 @@ msgid "Focuses on reliability and safety without sacrificing performance." msgstr "" "Se concentre sur la fiabilité et la sécurité sans sacrifier les performances." -#: src/hello-world/hello-world.md -msgid "" -"Let us jump into the simplest possible Rust program, a classic Hello World " -"program:" -msgstr "" -"Passons au programme Rust le plus simple possible, un Bonjour Monde " -"classique programme:" - -#: src/hello-world/hello-world.md -msgid "\"Hello 🌍!\"" -msgstr "" - -#: src/hello-world/hello-world.md -msgid "What you see:" -msgstr "Ce que tu vois:" - -#: src/hello-world/hello-world.md -msgid "Functions are introduced with `fn`." -msgstr "Les fonctions sont introduites avec `fn`." - -#: src/hello-world/hello-world.md -msgid "Blocks are delimited by curly braces like in C and C++." -msgstr "Les blocs sont délimités par des accolades comme en C et C++." - -#: src/hello-world/hello-world.md -msgid "The `main` function is the entry point of the program." -msgstr "La fonction `main` est le point d'entrée du programme." - -#: src/hello-world/hello-world.md -msgid "Rust has hygienic macros, `println!` is an example of this." -msgstr "Rust a des macros hygiéniques, `println!` en est un exemple." - -#: src/hello-world/hello-world.md -msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." -msgstr "" -"Les strings Rust sont encodées en UTF-8 et peuvent contenir n'importe quel " -"caractère Unicode." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"This slide tries to make the students comfortable with Rust code. They will " -"see a ton of it over the next four days so we start small with something " -"familiar." -msgstr "" -"Cette diapositive tente de mettre les étudiants à l'aise avec le code Rust. " -"Ils en verront une tonne durant les quatre prochains jours, alors nous " -"commençons petit avec quelque chose de familier." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"Rust is very much like other languages in the C/C++/Java tradition. It is " -"imperative and it doesn't try to reinvent things unless absolutely necessary." -msgstr "" -"Rust ressemble beaucoup aux autres langages traditionnels C/C++/Java. C'est " -"impératif (non fonctionnel) et il n'essaie pas de réinventer les choses à " -"moins qu'absolument nécessaire." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "Rust is modern with full support for things like Unicode." -msgstr "" -"Rust est moderne avec un support complet pour des choses comme Unicode." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"Rust uses macros for situations where you want to have a variable number of " -"arguments (no function [overloading](../control-flow-basics/functions.md))." -msgstr "" -"Rust utilise des macros pour les situations où vous souhaitez avoir un " -"nombre variable d'arguments (pas de fonction [surchargées](basic-syntax/" -"functions-interlude.md))." - -#: src/hello-world/hello-world.md -#, fuzzy -msgid "" -"Macros being 'hygienic' means they don't accidentally capture identifiers " -"from the scope they are used in. Rust macros are actually only [partially " -"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." -"html)." -msgstr "" -"Les macros étant \"hygiéniques\", elles ne capturent pas accidentellement " -"les identifiants de la portée dans laquelle elles sont utilisées. Les macros " -"Rust ne sont en fait que [partiellement hygiénique](https://veykril.github." -"io/tlborm/decl-macros/minutiae/hygiene.html)." - -#: src/hello-world/hello-world.md -msgid "" -"Rust is multi-paradigm. For example, it has powerful [object-oriented " -"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " -"while it is not a functional language, it includes a range of [functional " -"concepts](https://doc.rust-lang.org/book/ch13-00-functional-features.html)." -msgstr "" - #: src/hello-world/benefits.md msgid "Some unique selling points of Rust:" msgstr "Quelques arguments de vente uniques à Rust :" @@ -2937,32 +2779,100 @@ msgid "" "assembly." msgstr "" -#: src/types-and-values.md -msgid "[Variables](./types-and-values/variables.md) (5 minutes)" +#: src/types-and-values/hello-world.md +msgid "" +"Let us jump into the simplest possible Rust program, a classic Hello World " +"program:" +msgstr "" +"Passons au programme Rust le plus simple possible, un Bonjour Monde " +"classique programme:" + +#: src/types-and-values/hello-world.md +msgid "\"Hello 🌍!\"" +msgstr "" + +#: src/types-and-values/hello-world.md +msgid "What you see:" +msgstr "Ce que tu vois:" + +#: src/types-and-values/hello-world.md +msgid "Functions are introduced with `fn`." +msgstr "Les fonctions sont introduites avec `fn`." + +#: src/types-and-values/hello-world.md +msgid "Blocks are delimited by curly braces like in C and C++." +msgstr "Les blocs sont délimités par des accolades comme en C et C++." + +#: src/types-and-values/hello-world.md +msgid "The `main` function is the entry point of the program." +msgstr "La fonction `main` est le point d'entrée du programme." + +#: src/types-and-values/hello-world.md +msgid "Rust has hygienic macros, `println!` is an example of this." +msgstr "Rust a des macros hygiéniques, `println!` en est un exemple." + +#: src/types-and-values/hello-world.md +msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" +"Les strings Rust sont encodées en UTF-8 et peuvent contenir n'importe quel " +"caractère Unicode." -#: src/types-and-values.md -msgid "[Values](./types-and-values/values.md) (10 minutes)" +#: src/types-and-values/hello-world.md +#, fuzzy +msgid "" +"This slide tries to make the students comfortable with Rust code. They will " +"see a ton of it over the next four days so we start small with something " +"familiar." msgstr "" +"Cette diapositive tente de mettre les étudiants à l'aise avec le code Rust. " +"Ils en verront une tonne durant les quatre prochains jours, alors nous " +"commençons petit avec quelque chose de familier." -#: src/types-and-values.md -msgid "[Arithmetic](./types-and-values/arithmetic.md) (5 minutes)" +#: src/types-and-values/hello-world.md +#, fuzzy +msgid "" +"Rust is very much like other languages in the C/C++/Java tradition. It is " +"imperative and it doesn't try to reinvent things unless absolutely necessary." msgstr "" +"Rust ressemble beaucoup aux autres langages traditionnels C/C++/Java. C'est " +"impératif (non fonctionnel) et il n'essaie pas de réinventer les choses à " +"moins qu'absolument nécessaire." -#: src/types-and-values.md -msgid "[Strings](./types-and-values/strings.md) (10 minutes)" +#: src/types-and-values/hello-world.md +#, fuzzy +msgid "Rust is modern with full support for things like Unicode." msgstr "" +"Rust est moderne avec un support complet pour des choses comme Unicode." -#: src/types-and-values.md -msgid "[Type Inference](./types-and-values/inference.md) (5 minutes)" +#: src/types-and-values/hello-world.md +#, fuzzy +msgid "" +"Rust uses macros for situations where you want to have a variable number of " +"arguments (no function [overloading](../control-flow-basics/functions.md))." msgstr "" +"Rust utilise des macros pour les situations où vous souhaitez avoir un " +"nombre variable d'arguments (pas de fonction [surchargées](basic-syntax/" +"functions-interlude.md))." -#: src/types-and-values.md -msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (30 minutes)" +#: src/types-and-values/hello-world.md +#, fuzzy +msgid "" +"Macros being 'hygienic' means they don't accidentally capture identifiers " +"from the scope they are used in. Rust macros are actually only [partially " +"hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." +"html)." msgstr "" +"Les macros étant \"hygiéniques\", elles ne capturent pas accidentellement " +"les identifiants de la portée dans laquelle elles sont utilisées. Les macros " +"Rust ne sont en fait que [partiellement hygiénique](https://veykril.github." +"io/tlborm/decl-macros/minutiae/hygiene.html)." -#: src/types-and-values.md src/testing.md src/unsafe-rust.md -msgid "This segment should take about 1 hour and 5 minutes" +#: src/types-and-values/hello-world.md +msgid "" +"Rust is multi-paradigm. For example, it has powerful [object-oriented " +"programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " +"while it is not a functional language, it includes a range of [functional " +"concepts](https://doc.rust-lang.org/book/ch13-00-functional-features.html)." msgstr "" #: src/types-and-values/variables.md @@ -2974,8 +2884,7 @@ msgstr "" "Rust fournit une sécurité de type via le typage statique. Les liaisons " "variables sont immuables par défaut:" -#: src/types-and-values/variables.md src/control-flow-basics/loops.md -#: src/control-flow-basics/break-continue.md +#: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md msgid "\"x: {x}\"" msgstr "" @@ -3005,13 +2914,12 @@ msgid "" "each type." msgstr "" -#: src/types-and-values/values.md src/tuples-and-arrays/tuples-and-arrays.md -#: src/unsafe-rust/exercise.md +#: src/types-and-values/values.md src/unsafe-rust/exercise.md #, fuzzy msgid "Types" msgstr "Types" -#: src/types-and-values/values.md src/tuples-and-arrays/tuples-and-arrays.md +#: src/types-and-values/values.md #, fuzzy msgid "Literals" msgstr "Littéraux" @@ -3066,7 +2974,7 @@ msgstr "`3.14`, `-10.0e20`, `2f32`" msgid "Unicode scalar values" msgstr "Valeurs scalaires Unicode" -#: src/types-and-values/values.md +#: src/types-and-values/values.md src/android/aidl/types/primitives.md #, fuzzy msgid "`char`" msgstr "`car`" @@ -3081,7 +2989,7 @@ msgstr "`'a'`, `'α'`, `'∞'`" msgid "Booleans" msgstr "Chaînes d'octets" -#: src/types-and-values/values.md +#: src/types-and-values/values.md src/android/aidl/types/primitives.md #, fuzzy msgid "`bool`" msgstr "`&[u8]`" @@ -3171,82 +3079,6 @@ msgid "" "why the example requires a separate function." msgstr "" -#: src/types-and-values/strings.md -msgid "" -"Rust has two types to represent strings, both of which will be covered in " -"more depth later. Both _always_ store UTF-8 encoded strings." -msgstr "" - -#: src/types-and-values/strings.md -#, fuzzy -msgid "`String` - a modifiable, owned string." -msgstr "`String` un tampon de chaîne mutable." - -#: src/types-and-values/strings.md -msgid "`&str` - a read-only string. String literals have this type." -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"Greetings\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"🪐\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\", \"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "\"final sentence: {}\"" -msgstr "" - -#: src/types-and-values/strings.md src/async/control-flow/join.md -msgid "\"{:?}\"" -msgstr "" - -#: src/types-and-values/strings.md -msgid "//println!(\"{:?}\", &sentence[12..13]);\n" -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"This slide introduces strings. Everything here will be covered in more depth " -"later, but this is enough for subsequent slides and exercises to use strings." -msgstr "" - -#: src/types-and-values/strings.md -msgid "Invalid UTF-8 in a string is UB, and this not allowed in safe Rust." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"`String` is a user-defined type with a constructor (`::new()`) and methods " -"like `s.push_str(..)`." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"The `&` in `&str` indicates that this is a reference. We will cover " -"references later, so for now just think of `&str` as a unit meaning \"a read-" -"only string\"." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"The commented-out line is indexing into the string by byte position. " -"`12..13` does not end on a character boundary, so the program panics. Adjust " -"it to a range that does, based on the error message." -msgstr "" - -#: src/types-and-values/strings.md -msgid "" -"Raw strings allow you to create a `&str` value with escapes disabled: " -"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " -"amount of `#` on either side of the quotes:" -msgstr "" - #: src/types-and-values/inference.md #, fuzzy msgid "Rust will look at how the variable is _used_ to determine the type:" @@ -3316,129 +3148,65 @@ msgid "// The recursive case.\n" msgstr "" #: src/types-and-values/exercise.md src/types-and-values/solution.md -msgid "\"fib(n) = {}\"" -msgstr "" - -#: src/control-flow-basics.md -msgid "[Conditionals](./control-flow-basics/conditionals.md) (5 minutes)" +msgid "\"fib({n}) = {}\"" msgstr "" -#: src/control-flow-basics.md -msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" -msgstr "" +#: src/control-flow-basics/if.md +#, fuzzy +msgid "`if` expressions" +msgstr "expressions \"si\"" -#: src/control-flow-basics.md +#: src/control-flow-basics/if.md msgid "" -"[break and continue](./control-flow-basics/break-continue.md) (5 minutes)" +"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" +"if-expr.html#if-expressions) exactly like `if` statements in other languages:" msgstr "" -#: src/control-flow-basics.md -msgid "" -"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (10 minutes)" +#: src/control-flow-basics/if.md +msgid "\"zero!\"" msgstr "" -#: src/control-flow-basics.md -msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" +#: src/control-flow-basics/if.md +msgid "\"biggish\"" msgstr "" -#: src/control-flow-basics.md -msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" +#: src/control-flow-basics/if.md +msgid "\"huge\"" msgstr "" -#: src/control-flow-basics.md +#: src/control-flow-basics/if.md +#, fuzzy msgid "" -"[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (30 minutes)" +"In addition, you can use `if` as an expression. The last expression of each " +"block becomes the value of the `if` expression:" msgstr "" +"De plus, vous pouvez l'utiliser comme expression. Cela fait la même chose " +"que ci-dessus:" -#: src/control-flow-basics.md src/tuples-and-arrays.md src/borrowing.md -msgid "This segment should take about 1 hour" +#: src/control-flow-basics/if.md +msgid "\"small\"" msgstr "" -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" +#: src/control-flow-basics/if.md +msgid "\"large\"" msgstr "" -"Une grande partie de la syntaxe de Rust vous sera familière en C, C++ ou " -"Java :" -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "Blocks are delimited by curly braces." -msgstr "Les blocs et les portées sont délimités par des accolades." +#: src/control-flow-basics/if.md +msgid "\"number size: {}\"" +msgstr "" -#: src/control-flow-basics/conditionals.md -#, fuzzy +#: src/control-flow-basics/if.md msgid "" -"Line comments are started with `//`, block comments are delimited by `/* ... " -"*/`." +"Because `if` is an expression and must have a particular type, both of its " +"branch blocks must have the same type. Show what happens if you add `;` " +"after `\"small\"` in the second example." msgstr "" -"Les commentaires de ligne commencent par `//`, les commentaires de bloc sont " -"délimités par `/* ... */`." - -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "Keywords like `if` and `while` work the same." -msgstr "Des mots-clés comme `if` et `while` fonctionnent de la même manière." -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "Variable assignment is done with `=`, comparison is done with `==`." -msgstr "" -"L'affectation des variables se fait avec `=`, la comparaison se fait avec " -"`==`." - -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "`if` expressions" -msgstr "expressions \"si\"" - -#: src/control-flow-basics/conditionals.md -msgid "" -"You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" -"if-expr.html#if-expressions) exactly like `if` statements in other languages:" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "\"small\"" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "\"biggish\"" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "\"huge\"" -msgstr "" - -#: src/control-flow-basics/conditionals.md -#, fuzzy -msgid "" -"In addition, you can use `if` as an expression. The last expression of each " -"block becomes the value of the `if` expression:" -msgstr "" -"De plus, vous pouvez l'utiliser comme expression. Cela fait la même chose " -"que ci-dessus:" - -#: src/control-flow-basics/conditionals.md -msgid "\"large\"" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "\"number size: {}\"" -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "" -"Because `if` is an expression and must have a particular type, both of its " -"branch blocks must have the same type. Show what happens if you add `;` " -"after `\"small\"` in the second example." -msgstr "" - -#: src/control-flow-basics/conditionals.md -msgid "" -"When `if` is used in an expression, the expression must have a `;` to " -"separate it from the next statement. Remove the `;` before `println!` to see " -"the compiler error." +#: src/control-flow-basics/if.md +msgid "" +"When `if` is used in an expression, the expression must have a `;` to " +"separate it from the next statement. Remove the `;` before `println!` to see " +"the compiler error." msgstr "" #: src/control-flow-basics/loops.md @@ -3464,25 +3232,33 @@ msgstr "" msgid "\"Final x: {x}\"" msgstr "" -#: src/control-flow-basics/loops.md -#, fuzzy -msgid "`for`" -msgstr "Boucles `for`" - -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md #, fuzzy msgid "" "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " -"over ranges of values:" +"over ranges of values or the items in a collection:" msgstr "" "[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) utilisé pour " "définir les destructeurs." -#: src/control-flow-basics/loops.md -msgid "`loop`" +#: src/control-flow-basics/loops/for.md +msgid "\"elem: {elem}\"" msgstr "" -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/for.md +msgid "" +"Under the hood `for` loops use a concept called \"iterators\" to handle " +"iterating over different kinds of ranges/collections. Iterators will be " +"discussed in more detail later." +msgstr "" + +#: src/control-flow-basics/loops/for.md +msgid "" +"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " +"an inclusive range." +msgstr "" + +#: src/control-flow-basics/loops/loop.md #, fuzzy msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " @@ -3491,19 +3267,14 @@ msgstr "" "[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) utilisé pour " "définir les destructeurs." -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" msgstr "" -#: src/control-flow-basics/loops.md -msgid "" -"We will discuss iteration later; for now, just stick to range expressions." -msgstr "" - -#: src/control-flow-basics/loops.md +#: src/control-flow-basics/break-continue.md msgid "" -"Note that the `for` loop only iterates to `4`. Show the `1..=5` syntax for " -"an inclusive range." +"If you want to immediately start the next iteration use [`continue`](https://" +"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." msgstr "" #: src/control-flow-basics/break-continue.md @@ -3514,17 +3285,16 @@ msgid "" "`loop` expression." msgstr "" -#: src/control-flow-basics/break-continue.md -msgid "" -"If you want to immediately start the next iteration use [`continue`](https://" -"doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." -msgstr "" - -#: src/control-flow-basics/break-continue.md -msgid "\"{result}\"" +#: src/control-flow-basics/break-continue.md src/std-traits/exercise.md +#: src/std-traits/solution.md src/smart-pointers/trait-objects.md +#: src/modules/exercise.md src/modules/solution.md +#: src/android/build-rules/library.md +#: src/android/interoperability/cpp/rust-bridge.md +#: src/async/pitfalls/cancellation.md +msgid "\"{}\"" msgstr "" -#: src/control-flow-basics/break-continue.md +#: src/control-flow-basics/break-continue/labels.md #, fuzzy msgid "" "Both `continue` and `break` can optionally take a label argument which is " @@ -3535,19 +3305,11 @@ msgstr "" "`continue` et `break` peuvent éventuellement prenez un argument d'étiquette " "qui est utilisé pour sortir des boucles imbriquées :" -#: src/control-flow-basics/break-continue.md -msgid "\"x: {x}, i: {i}\"" -msgstr "" - -#: src/control-flow-basics/break-continue.md -#, fuzzy -msgid "" -"In this case we break the outer loop after 3 iterations of the inner loop." +#: src/control-flow-basics/break-continue/labels.md +msgid "\"elements searched: {elements_searched}\"" msgstr "" -"Dans ce cas, nous cassons la boucle externe après 3 itérations de la boucle " -"interne." -#: src/control-flow-basics/break-continue.md +#: src/control-flow-basics/break-continue/labels.md msgid "" "Note that `loop` is the only looping construct which returns a non-trivial " "value. This is because it's guaranteed to be entered at least once (unlike " @@ -3579,14 +3341,20 @@ msgid "" msgstr "" #: src/control-flow-basics/blocks-and-scopes.md -msgid "Scopes and Shadowing" -msgstr "Portée et masquage" +#, fuzzy +msgid "" +"You can show how the value of the block changes by changing the last line in " +"the block. For instance, adding/removing a semicolon or using a `return`." +msgstr "" +"Vous pouvez montrer comment la valeur du bloc change en modifiant la " +"dernière ligne du bloc. Par exemple, ajouter/supprimer un point-virgule ou " +"utiliser un \"retour\"." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" "You can shadow variables, both those from outer scopes and variables from " @@ -3595,44 +3363,35 @@ msgstr "" "Vous pouvez masquer des variables, à la fois celles des portées externes et " "celles des même périmètre :" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md src/std-traits/from-and-into.md -#: src/slices-and-lifetimes/solution.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/from-and-into.md +#: src/lifetimes/solution.md msgid "\"hello\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"inner scope: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"shadowed in inner scope: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"after: {a}\"" msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md -#, fuzzy -msgid "" -"You can show how the value of the block changes by changing the last line in " -"the block. For instance, adding/removing a semicolon or using a `return`." -msgstr "" -"Vous pouvez montrer comment la valeur du bloc change en modifiant la " -"dernière ligne du bloc. Par exemple, ajouter/supprimer un point-virgule ou " -"utiliser un \"retour\"." - -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" "Show that a variable's scope is limited by adding a `b` in the inner block " "in the last example, and then trying to access it outside that block." msgstr "" -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" "Shadowing is different from mutation, because after shadowing both " @@ -3644,12 +3403,12 @@ msgstr "" "même temps. Les deux sont disponibles sous le même nom, selon l'endroit où " "vous l'utilisez dans le code." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "A shadowing variable can have a different type." msgstr "Une variable d'occultation peut avoir un type différent." -#: src/control-flow-basics/blocks-and-scopes.md +#: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy msgid "" "Shadowing looks obscure at first, but is convenient for holding on to values " @@ -3932,94 +3691,7 @@ msgstr "" msgid "Welcome Back" msgstr "Bienvenue" -#: src/welcome-day-1-afternoon.md -msgid "[Tuples and Arrays](./tuples-and-arrays.md) (1 hour)" -msgstr "" - -#: src/welcome-day-1-afternoon.md -msgid "[References](./references.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-1-afternoon.md -msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-1-afternoon.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 55 " -"minutes" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "" -"[Tuples and Arrays](./tuples-and-arrays/tuples-and-arrays.md) (10 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Pattern Matching](./tuples-and-arrays/match.md) (10 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Destructuring](./tuples-and-arrays/destructuring.md) (5 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (30 minutes)" -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "" -"Tuples and arrays are the first \"compound\" types we have seen. All " -"elements of an array have the same type, while tuples can accommodate " -"different types. Both types have a size fixed at compile time." -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md -msgid "Arrays" -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`[T; N]`" -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`[20, 30, 40]`, `[0; 3]`" -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -#: src/tuples-and-arrays/destructuring.md -msgid "Tuples" -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`()`, `(T,)`, `(T1, T2)`, ..." -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -msgid "`()`, `('x',)`, `('x', 1.2)`, ..." -msgstr "" - -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy -msgid "Array assignment and access:" -msgstr "Affectation et accès aux baies :" - -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy -msgid "Tuple assignment and access:" -msgstr "Affectation et accès aux tuples :" - -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy -msgid "Arrays:" -msgstr "Tableaux :" - -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/arrays.md msgid "" "A value of the array type `[T; N]` holds `N` (a compile-time constant) " "elements of the same type `T`. Note that the length of the array is _part of " @@ -4028,18 +3700,18 @@ msgid "" "covered later." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " "runtime. Rust can usually optimize these checks away, and they can be " "avoided using unsafe Rust." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " "parameter: `{}` gives the default output, `{:?}` gives the debug output. " @@ -4048,29 +3720,24 @@ msgid "" "here." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy -msgid "Tuples:" -msgstr "Tuples :" - -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/tuples.md #, fuzzy msgid "Like arrays, tuples have a fixed length." msgstr "Comme les tableaux, les tuples ont une longueur fixe." -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/tuples.md #, fuzzy msgid "Tuples group together values of different types into a compound type." msgstr "" "Les tuples regroupent des valeurs de différents types dans un type composé." -#: src/tuples-and-arrays/tuples-and-arrays.md +#: src/tuples-and-arrays/tuples.md #, fuzzy msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " @@ -4079,28 +3746,11 @@ msgstr "" "Les champs d'un tuple sont accessibles par le point et l'index de la valeur, " "par ex. `t.0`, `t.1`." -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy -msgid "" -"The empty tuple `()` is also known as the \"unit type\". It is both a type, " -"and the only valid value of that type --- that is to say both the type and " -"its value are expressed as `()`. It is used to indicate, for example, that a " -"function or expression has no return value, as we'll see in a future slide." -msgstr "" -"Le tuple vide `()` est également appelé \"type d'unité\". C'est à la fois un " -"type et la seule valeur valide de ce type - c'est-à-dire à la fois le type " -"et sa valeur sont exprimés par `()`. Il est utilisé pour indiquer, par " -"exemple, qu'une fonction ou expression n'a pas de valeur de retour, comme " -"nous le verrons dans une prochaine diapositive." - -#: src/tuples-and-arrays/tuples-and-arrays.md -#, fuzzy +#: src/tuples-and-arrays/tuples.md msgid "" -"You can think of it as `void` that can be familiar to you from other " -"programming languages." +"The empty tuple `()` is referred to as the \"unit type\" and signifies " +"absence of a return value, akin to `void` in other languages." msgstr "" -"Vous pouvez le considérer comme un \"vide\" qui peut vous être familier " -"d'autres langages de programmation." #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." @@ -4119,316 +3769,106 @@ msgid "" "`debug_assert!` compile to nothing in release builds." msgstr "" -#: src/tuples-and-arrays/match.md -#, fuzzy +#: src/tuples-and-arrays/destructuring.md msgid "" -"The `match` keyword lets you match a value against one or more _patterns_. " -"The comparisons are done from top to bottom and the first match wins." +"When working with tuples and other structured values it's common to want to " +"extract the inner values into local variables. This can be done manually by " +"directly accessing the inner values:" msgstr "" -"Le mot clé `match` vous permet de faire correspondre une valeur à un ou " -"plusieurs _patterns_. Le les comparaisons se font de haut en bas et le " -"premier match l'emporte." -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "The patterns can be simple values, similarly to `switch` in C and C++:" +#: src/tuples-and-arrays/destructuring.md +msgid "\"left: {left}, right: {right}\"" msgstr "" -"Les modèles peuvent être des valeurs simples, de la même manière que " -"`switch` en C et C++ :" -#: src/tuples-and-arrays/match.md -msgid "'x'" +#: src/tuples-and-arrays/destructuring.md +msgid "" +"However, Rust also supports using pattern matching to destructure a larger " +"value into its constituent parts:" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "'q'" +#: src/tuples-and-arrays/destructuring.md +msgid "" +"The patterns used here are \"irrefutable\", meaning that the compiler can " +"statically verify that the value on the right of `=` has the same structure " +"as the pattern." msgstr "" -#: src/tuples-and-arrays/match.md -msgid "\"Quitting\"" +#: src/tuples-and-arrays/destructuring.md +msgid "" +"A variable name is an irrefutable pattern that always matches any value, " +"hence why we can also use `let` to declare a single variable." msgstr "" -#: src/tuples-and-arrays/match.md src/std-traits/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'a'" +#: src/tuples-and-arrays/destructuring.md +msgid "" +"Rust also supports using patterns in conditionals, allowing for equality " +"comparison and destructuring to happen at the same time. This form of " +"pattern matching will be discussed in more detail later." msgstr "" -#: src/tuples-and-arrays/match.md -msgid "'s'" +#: src/tuples-and-arrays/destructuring.md +msgid "" +"Edit the examples above to show the compiler error when the pattern doesn't " +"match the value being matched on." msgstr "" -#: src/tuples-and-arrays/match.md -msgid "'w'" +#: src/tuples-and-arrays/exercise.md +msgid "Arrays can contain other arrays:" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "'d'" +#: src/tuples-and-arrays/exercise.md +#, fuzzy +msgid "What is the type of this variable?" +msgstr "Quel est le type de \"mot\" dans chaque boucle ?" + +#: src/tuples-and-arrays/exercise.md +#, fuzzy +msgid "" +"Use an array such as the above to write a function `transpose` which will " +"transpose a matrix (turn rows into columns):" msgstr "" +"Utilisez ce qui précède pour écrire une fonction `pretty_print` qui imprime " +"joliment une matrice et une fonction `transpose` qui va transposer une " +"matrice (transformer les lignes en colonnes):" -#: src/tuples-and-arrays/match.md -msgid "\"Moving around\"" +#: src/tuples-and-arrays/exercise.md +#, fuzzy +msgid "Hard-code both functions to operate on 3 × 3 matrices." msgstr "" +"Codez en dur les deux fonctions pour qu'elles fonctionnent sur des matrices " +"3 × 3." -#: src/tuples-and-arrays/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md -msgid "'0'" +#: src/tuples-and-arrays/exercise.md +#, fuzzy +msgid "" +"Copy the code below to and implement the " +"functions:" msgstr "" +"Copiez le code ci-dessous sur et implémentez " +"le les fonctions:" -#: src/tuples-and-arrays/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md -msgid "'9'" +#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md +#: src/unsafe-rust/exercise.md +msgid "// TODO: remove this when you're done with your implementation.\n" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "\"Number input\"" +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md +msgid "//\n" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "\"Lowercase: {key}\"" +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md +msgid "// <-- the comment makes rustfmt add a newline\n" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "\"Something else\"" +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md +msgid "\"matrix: {:#?}\"" msgstr "" -#: src/tuples-and-arrays/match.md -msgid "" -"The `_` pattern is a wildcard pattern which matches any value. The " -"expressions _must_ be irrefutable, meaning that it covers every possibility, " -"so `_` is often used as the final catch-all case." +#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md +msgid "\"transposed: {:#?}\"" msgstr "" -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "" -"Match can be used as an expression. Just like `if`, each match arm must have " -"the same type. The type is the last expression of the block, if any. In the " -"example above, the type is `()`." -msgstr "" -"Comme `if let`, chaque bras de correspondance doit avoir le même type. Le " -"type est le dernier expression du bloc, le cas échéant. Dans l'exemple ci-" -"dessus, le type est `()`." - -#: src/tuples-and-arrays/match.md -msgid "" -"A variable in the pattern (`key` in this example) will create a binding that " -"can be used within the match arm." -msgstr "" - -#: src/tuples-and-arrays/match.md -msgid "A match guard causes the arm to match only if the condition is true." -msgstr "" - -#: src/tuples-and-arrays/match.md src/user-defined-types/named-structs.md -#: src/user-defined-types/enums.md src/methods-and-traits/methods.md -#, fuzzy -msgid "Key Points:" -msgstr "Points clés:" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "" -"You might point out how some specific characters are being used when in a " -"pattern" -msgstr "" -"Vous pouvez indiquer comment certains caractères spécifiques sont utilisés " -"dans un modèle" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "`|` as an `or`" -msgstr "`|` comme un `ou`" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "`..` can expand as much as it needs to be" -msgstr "`..` peut s'étendre autant que nécessaire" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "`1..=5` represents an inclusive range" -msgstr "`1..=5` représente une plage inclusive" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "`_` is a wild card" -msgstr "`_` est un joker" - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "" -"Match guards as a separate syntax feature are important and necessary when " -"we wish to concisely express more complex ideas than patterns alone would " -"allow." -msgstr "" -"Les gardes de correspondance en tant que fonctionnalité de syntaxe distincte " -"sont importants et nécessaires lorsque nous souhaitons exprimer de manière " -"concise des idées plus complexes que ne le permettraient les modèles seuls." - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "" -"They are not the same as separate `if` expression inside of the match arm. " -"An `if` expression inside of the branch block (after `=>`) happens after the " -"match arm is selected. Failing the `if` condition inside of that block won't " -"result in other arms of the original `match` expression being considered." -msgstr "" -"Ils ne sont pas identiques à une expression \"if\" séparée à l'intérieur du " -"bras de match. Une expression `if` à l'intérieur du bloc de branche (après " -"`=>`) se produit après la sélection du bras de correspondance. L'échec de la " -"condition \"si\" à l'intérieur de ce bloc n'entraînera pas d'autres bras de " -"l'expression \"match\" d'origine considérée." - -#: src/tuples-and-arrays/match.md -#, fuzzy -msgid "" -"The condition defined in the guard applies to every expression in a pattern " -"with an `|`." -msgstr "" -"La condition définie dans la garde s'applique à chaque expression dans un " -"modèle avec un `|`." - -#: src/tuples-and-arrays/destructuring.md -msgid "" -"Destructuring is a way of extracting data from a data structure by writing a " -"pattern that is matched up to the data structure, binding variables to " -"subcomponents of the data structure." -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -#, fuzzy -msgid "You can destructure tuples and arrays by matching on their elements:" -msgstr "" -"Vous pouvez déstructurer des tableaux, des tuples et des tranches en faisant " -"correspondre leurs éléments :" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"on Y axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"on X axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"left of Y axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"below X axis\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"first quadrant\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"Tell me about {triple:?}\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"First is 0, y = {y}, and z = {z}\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"First is 1 and the rest were ignored\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "\"All elements were ignored\"" -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "Create a new array pattern using `_` to represent an element." -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "Add more values to the array." -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "" -"Point out that how `..` will expand to account for different number of " -"elements." -msgstr "" - -#: src/tuples-and-arrays/destructuring.md -msgid "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" -msgstr "" - -#: src/tuples-and-arrays/exercise.md -msgid "Arrays can contain other arrays:" -msgstr "" - -#: src/tuples-and-arrays/exercise.md -#, fuzzy -msgid "What is the type of this variable?" -msgstr "Quel est le type de \"mot\" dans chaque boucle ?" - -#: src/tuples-and-arrays/exercise.md -#, fuzzy -msgid "" -"Use an array such as the above to write a function `transpose` which will " -"transpose a matrix (turn rows into columns):" -msgstr "" -"Utilisez ce qui précède pour écrire une fonction `pretty_print` qui imprime " -"joliment une matrice et une fonction `transpose` qui va transposer une " -"matrice (transformer les lignes en colonnes):" - -#: src/tuples-and-arrays/exercise.md -#, fuzzy -msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "" -"Codez en dur les deux fonctions pour qu'elles fonctionnent sur des matrices " -"3 × 3." - -#: src/tuples-and-arrays/exercise.md -#, fuzzy -msgid "" -"Copy the code below to and implement the " -"functions:" -msgstr "" -"Copiez le code ci-dessous sur et implémentez " -"le les fonctions:" - -#: src/tuples-and-arrays/exercise.md src/borrowing/exercise.md -#: src/unsafe-rust/exercise.md -msgid "// TODO: remove this when you're done with your implementation.\n" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "// <-- the comment makes rustfmt add a newline\n" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"matrix: {:#?}\"" -msgstr "" - -#: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md -msgid "\"transposed: {:#?}\"" -msgstr "" - -#: src/tuples-and-arrays/solution.md -msgid "//\n" -msgstr "" - -#: src/references.md -msgid "[Shared References](./references/shared.md) (10 minutes)" -msgstr "" - -#: src/references.md -msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" -msgstr "" - -#: src/references.md -msgid "[Exercise: Geometry](./references/exercise.md) (30 minutes)" -msgstr "" - -#: src/references.md src/user-defined-types.md src/pattern-matching.md -msgid "This segment should take about 50 minutes" -msgstr "" - -#: src/references/shared.md +#: src/references/shared.md msgid "" "A reference provides a way to access another value without taking " "responsibility for the value, and is also called \"borrowing\". Shared " @@ -4474,8 +3914,8 @@ msgstr "" #, fuzzy msgid "" "Rust will auto-dereference in some cases, in particular when invoking " -"methods (try `r.count_ones()`). There is no need for an `->` operator like " -"in C++." +"methods (try `r.is_ascii()`). There is no need for an `->` operator like in " +"C++." msgstr "" "Rust déréférencera automatiquement dans certains cas, en particulier lors de " "l'appel méthodes (essayez `ref_x.count_ones()`)." @@ -4536,78 +3976,233 @@ msgstr "" "liée à différentes valeurs, tandis que la seconde représente une référence à " "une valeur modifiable." -#: src/references/exercise.md -msgid "" -"We will create a few utility functions for 3-dimensional geometry, " -"representing a point as `[f64;3]`. It is up to you to determine the function " -"signatures." -msgstr "" - -#: src/references/exercise.md -msgid "" -"// Calculate the magnitude of a vector by summing the squares of its " -"coordinates\n" -"// and taking the square root. Use the `sqrt()` method to calculate the " -"square\n" -"// root, like `v.sqrt()`.\n" -msgstr "" +#: src/references/slices.md +msgid "Slices" +msgstr "Tranches" -#: src/references/exercise.md -msgid "" -"// Normalize a vector by calculating its magnitude and dividing all of its\n" -"// coordinates by that magnitude.\n" -msgstr "" +#: src/references/slices.md +#, fuzzy +msgid "A slice gives you a view into a larger collection:" +msgstr "Une tranche vous donne une vue dans une plus grande collection :" -#: src/references/exercise.md -msgid "// Use the following `main` to test your work.\n" +#: src/references/slices.md +#, fuzzy +msgid "Slices borrow data from the sliced type." msgstr "" +"Les tranches empruntent des données au type en tranches. \\* Question : Que " +"se passe-t-il si vous modifiez `a[3]` ?" -#: src/references/exercise.md src/references/solution.md -msgid "\"Magnitude of a unit vector: {}\"" +#: src/references/slices.md +msgid "Question: What happens if you modify `a[3]` right before printing `s`?" msgstr "" -#: src/references/exercise.md src/references/solution.md -msgid "\"Magnitude of {v:?}: {}\"" +#: src/references/slices.md +#, fuzzy +msgid "" +"We create a slice by borrowing `a` and specifying the starting and ending " +"indexes in brackets." msgstr "" +"Nous créons une tranche en empruntant `a` et en spécifiant les index de " +"début et de fin entre parenthèses." -#: src/references/exercise.md src/references/solution.md -msgid "\"Magnitude of {v:?} after normalization: {}\"" +#: src/references/slices.md +#, fuzzy +msgid "" +"If the slice starts at index 0, Rust’s range syntax allows us to drop the " +"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " +"identical." msgstr "" +"Si la tranche commence à l'index 0, la syntaxe de plage de Rust nous permet " +"de supprimer l'index de départ, ce qui signifie que `&a[0..a.len()]` et " +"`&a[..a.len()]` sont identiques ." -#: src/references/solution.md -msgid "/// Calculate the magnitude of the given vector.\n" +#: src/references/slices.md +#, fuzzy +msgid "" +"The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " +"identical." msgstr "" +"Il en va de même pour le dernier index, donc `&a[2..a.len()]` et `&a[2..]` " +"sont identiques." -#: src/references/solution.md +#: src/references/slices.md +#, fuzzy msgid "" -"/// Change the magnitude of the vector to 1.0 without changing its " -"direction.\n" +"To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" +"Pour créer facilement une tranche du tableau complet, on peut donc utiliser " +"`&a[..]`." -#: src/user-defined-types.md -msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" -msgstr "" +#: src/references/slices.md +#, fuzzy +msgid "" +"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " +"(`&[i32]`) no longer mentions the array length. This allows us to perform " +"computation on slices of different sizes." +msgstr "" +"`s` est une référence à une tranche de `i32`s. Notez que le type de `s` " +"(`&[i32]`) ne mentionne plus la longueur du tableau. Cela nous permet " +"d'effectuer des calculs sur des tranches de tailles différentes." + +#: src/references/slices.md +#, fuzzy +msgid "" +"Slices always borrow from another object. In this example, `a` has to remain " +"'alive' (in scope) for at least as long as our slice." +msgstr "" +"Les tranches empruntent toujours à un autre objet. Dans cet exemple, \"a\" " +"doit rester \"vivant\" (dans la portée) au moins aussi longtemps que notre " +"tranche." + +#: src/references/slices.md +#, fuzzy +msgid "" +"The question about modifying `a[3]` can spark an interesting discussion, but " +"the answer is that for memory safety reasons you cannot do it through `a` at " +"this point in the execution, but you can read the data from both `a` and `s` " +"safely. It works before you created the slice, and again after the " +"`println`, when the slice is no longer used." +msgstr "" +"La question sur la modification de `a[3]` peut susciter une discussion " +"intéressante, mais la réponse est que pour des raisons de sécurité de la " +"mémoire vous ne pouvez pas le faire via `a` après avoir créé une tranche, " +"mais vous pouvez lire les données de `a` et `s` en toute sécurité. Plus de " +"détails seront expliqués dans la section Vérificateur d'emprunt." + +#: src/references/strings.md +#, fuzzy +msgid "We can now understand the two string types in Rust:" +msgstr "" +"Nous pouvons maintenant comprendre les deux types de string avec Rust :" + +#: src/references/strings.md +msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." +msgstr "" + +#: src/references/strings.md +msgid "`String` is an owned, heap-allocated buffer of UTF-8 bytes." +msgstr "" + +#: src/references/strings.md src/std-traits/read-and-write.md +msgid "\"World\"" +msgstr "" + +#: src/references/strings.md +msgid "\"s1: {s1}\"" +msgstr "" + +#: src/references/strings.md +#, fuzzy +msgid "\"Hello \"" +msgstr "Bonjour le monde!" + +#: src/references/strings.md src/memory-management/move.md +msgid "\"s2: {s2}\"" +msgstr "" + +#: src/references/strings.md +msgid "\"s3: {s3}\"" +msgstr "" + +#: src/references/strings.md +msgid "" +"`&str` introduces a string slice, which is an immutable reference to UTF-8 " +"encoded string data stored in a block of memory. String literals " +"(`\"Hello\"`), are stored in the program’s binary." +msgstr "" + +#: src/references/strings.md +msgid "" +"Rust's `String` type is a wrapper around a vector of bytes. As with a " +"`Vec`, it is owned." +msgstr "" -#: src/user-defined-types.md -msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" +#: src/references/strings.md +msgid "" +"As with many other types `String::from()` creates a string from a string " +"literal; `String::new()` creates a new empty string, to which string data " +"can be added using the `push()` and `push_str()` methods." +msgstr "" + +#: src/references/strings.md +msgid "" +"The `format!()` macro is a convenient way to generate an owned string from " +"dynamic values. It accepts the same format specification as `println!()`." +msgstr "" + +#: src/references/strings.md +msgid "" +"You can borrow `&str` slices from `String` via `&` and optionally range " +"selection. If you select a byte range that is not aligned to character " +"boundaries, the expression will panic. The `chars` iterator iterates over " +"characters and is preferred over trying to get character boundaries right." +msgstr "" + +#: src/references/strings.md +msgid "" +"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " +"one that always points to a valid string in memory. Rust `String` is a rough " +"equivalent of `std::string` from C++ (main difference: it can only contain " +"UTF-8 encoded bytes and will never use a small-string optimization)." +msgstr "" + +#: src/references/strings.md +msgid "Byte strings literals allow you to create a `&[u8]` value directly:" +msgstr "" + +#: src/references/strings.md +msgid "" +"Raw strings allow you to create a `&str` value with escapes disabled: " +"`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " +"amount of `#` on either side of the quotes:" msgstr "" -#: src/user-defined-types.md -msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" +#: src/references/exercise.md +msgid "" +"We will create a few utility functions for 3-dimensional geometry, " +"representing a point as `[f64;3]`. It is up to you to determine the function " +"signatures." +msgstr "" + +#: src/references/exercise.md +msgid "" +"// Calculate the magnitude of a vector by summing the squares of its " +"coordinates\n" +"// and taking the square root. Use the `sqrt()` method to calculate the " +"square\n" +"// root, like `v.sqrt()`.\n" msgstr "" -#: src/user-defined-types.md +#: src/references/exercise.md msgid "" -"[Static and Const](./user-defined-types/static-and-const.md) (5 minutes)" +"// Normalize a vector by calculating its magnitude and dividing all of its\n" +"// coordinates by that magnitude.\n" +msgstr "" + +#: src/references/exercise.md +msgid "// Use the following `main` to test your work.\n" +msgstr "" + +#: src/references/exercise.md src/references/solution.md +msgid "\"Magnitude of a unit vector: {}\"" +msgstr "" + +#: src/references/exercise.md src/references/solution.md +msgid "\"Magnitude of {v:?}: {}\"" +msgstr "" + +#: src/references/exercise.md src/references/solution.md +msgid "\"Magnitude of {v:?} after normalization: {}\"" msgstr "" -#: src/user-defined-types.md -msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" +#: src/references/solution.md +msgid "/// Calculate the magnitude of the given vector.\n" msgstr "" -#: src/user-defined-types.md +#: src/references/solution.md msgid "" -"[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" +"/// Change the magnitude of the vector to 1.0 without changing its " +"direction.\n" msgstr "" #: src/user-defined-types/named-structs.md @@ -4632,6 +4227,12 @@ msgstr "" msgid "\"Jackie\"" msgstr "" +#: src/user-defined-types/named-structs.md src/user-defined-types/enums.md +#: src/pattern-matching/match.md src/methods-and-traits/methods.md +#, fuzzy +msgid "Key Points:" +msgstr "Points clés:" + #: src/user-defined-types/named-structs.md msgid "Structs work like in C or C++." msgstr "" @@ -4859,7 +4460,7 @@ msgid "" "bytes." msgstr "" -#: src/user-defined-types/enums.md src/user-defined-types/static-and-const.md +#: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md #: src/smart-pointers/box.md src/borrowing/shared.md msgid "More to Explore" @@ -4885,60 +4486,27 @@ msgid "" "guarantees regarding this representation, therefore this is totally unsafe." msgstr "" -#: src/user-defined-types/static-and-const.md -msgid "" -"Static and constant variables are two different ways to create globally-" -"scoped values that cannot be moved or reallocated during the execution of " -"the program." -msgstr "" - -#: src/user-defined-types/static-and-const.md -#, fuzzy -msgid "`const`" -msgstr "`const`" - -#: src/user-defined-types/static-and-const.md -msgid "" -"Constant variables are evaluated at compile time and their values are " -"inlined wherever they are used:" -msgstr "" - -#: src/user-defined-types/static-and-const.md -#, fuzzy -msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." -msgstr "" -"Selon le \\[Rust RFC Book\\] [1](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html), ceux-ci sont intégrés lors de l'utilisation." - -#: src/user-defined-types/static-and-const.md -msgid "" -"Only functions marked `const` can be called at compile time to generate " -"`const` values. `const` functions can however be called at runtime." -msgstr "" - -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md #, fuzzy msgid "`static`" msgstr "`statique`" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md #, fuzzy msgid "\"Welcome to RustOS 3.14\"" msgstr "Bienvenue au jour 1" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md msgid "\"{BANNER}\"" msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md #, fuzzy msgid "" "As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" @@ -4954,109 +4522,71 @@ msgstr "" "pour le code non sécurisé et intégré, et la variable vit tout au long de " "l'exécution du programme." -#: src/user-defined-types/static-and-const.md -#, fuzzy -msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`." -msgstr "" -"Mentionnez que `const` se comporte sémantiquement de la même manière que " -"`constexpr` de C++." - -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md #, fuzzy -msgid "" -"`static`, on the other hand, is much more similar to a `const` or mutable " -"global variable in C++." +msgid "`static` is similar to mutable global variables in C++." msgstr "" "`static`, d'autre part, ressemble beaucoup plus à une variable globale " "`const` ou mutable en C++." -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/static.md msgid "" "`static` provides object identity: an address in memory and state as " "required by types with interior mutability such as `Mutex`." msgstr "" -#: src/user-defined-types/static-and-const.md -#, fuzzy +#: src/user-defined-types/static.md msgid "" -"It isn't super common that one would need a runtime evaluated constant, but " -"it is helpful and safer than using a static." -msgstr "" -"Il n'est pas très courant d'avoir besoin d'une constante évaluée à " -"l'exécution, mais c'est utile et plus sûr que d'utiliser un statique." - -#: src/user-defined-types/static-and-const.md -msgid "Properties table:" +"Because `static` variables are accessible from any thread, they must be " +"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" +"lang.org/std/sync/struct.Mutex.html), atomic or similar." msgstr "" -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates.md -msgid "Property" +#: src/user-defined-types/static.md +msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/const.md #, fuzzy -msgid "Static" -msgstr "`statique`" - -#: src/user-defined-types/static-and-const.md -msgid "Constant" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Has an address in memory" -msgstr "" - -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "Yes" -msgstr "" +msgid "`const`" +msgstr "`const`" -#: src/user-defined-types/static-and-const.md -msgid "No (inlined)" +#: src/user-defined-types/const.md +msgid "" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/const.md #, fuzzy -msgid "Lives for the entire duration of the program" -msgstr "La fonction `main` est le point d'entrée du programme." - -#: src/user-defined-types/static-and-const.md -#: src/chromium/adding-third-party-crates/resolving-problems.md -msgid "No" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Can be mutable" +msgid "" +"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html) these are inlined upon use." msgstr "" +"Selon le \\[Rust RFC Book\\] [1](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html), ceux-ci sont intégrés lors de l'utilisation." -#: src/user-defined-types/static-and-const.md -msgid "Yes (unsafe)" +#: src/user-defined-types/const.md +msgid "" +"Only functions marked `const` can be called at compile time to generate " +"`const` values. `const` functions can however be called at runtime." msgstr "" -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/const.md #, fuzzy -msgid "Evaluated at compile time" -msgstr "Les valeurs ont des tailles fixes connues au moment de la compilation." - -#: src/user-defined-types/static-and-const.md -msgid "Yes (initialised at compile time)" -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Inlined wherever it is used" +msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "" +"Mentionnez que `const` se comporte sémantiquement de la même manière que " +"`constexpr` de C++." -#: src/user-defined-types/static-and-const.md +#: src/user-defined-types/const.md +#, fuzzy msgid "" -"Because `static` variables are accessible from any thread, they must be " -"`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" -"lang.org/std/sync/struct.Mutex.html), atomic or similar." -msgstr "" - -#: src/user-defined-types/static-and-const.md -msgid "Thread-local data can be created with the macro `std::thread_local`." +"It isn't super common that one would need a runtime evaluated constant, but " +"it is helpful and safer than using a static." msgstr "" +"Il n'est pas très courant d'avoir besoin d'une constante évaluée à " +"l'exécution, mais c'est utile et plus sûr que d'utiliser un statique." #: src/user-defined-types/aliases.md msgid "" @@ -5216,52 +4746,177 @@ msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "" -#: src/welcome-day-2.md -msgid "[Welcome](./welcome-day-2.md) (3 minutes)" +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"The `match` keyword lets you match a value against one or more _patterns_. " +"The comparisons are done from top to bottom and the first match wins." msgstr "" +"Le mot clé `match` vous permet de faire correspondre une valeur à un ou " +"plusieurs _patterns_. Le les comparaisons se font de haut en bas et le " +"premier match l'emporte." -#: src/welcome-day-2.md +#: src/pattern-matching/match.md #, fuzzy -msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" +msgid "The patterns can be simple values, similarly to `switch` in C and C++:" msgstr "" -"Voir [Filtrage par motif](../pattern-matching.md) pour plus de détails sur " -"les motifs avec Rust." +"Les modèles peuvent être des valeurs simples, de la même manière que " +"`switch` en C et C++ :" -#: src/welcome-day-2.md -msgid "[Methods and Traits](./methods-and-traits.md) (55 minutes)" +#: src/pattern-matching/match.md +msgid "'x'" msgstr "" -#: src/welcome-day-2.md -msgid "[Generics](./generics.md) (45 minutes)" +#: src/pattern-matching/match.md +msgid "'q'" msgstr "" -#: src/welcome-day-2.md src/welcome-day-4.md -msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 5 " -"minutes" +#: src/pattern-matching/match.md +msgid "\"Quitting\"" msgstr "" -#: src/pattern-matching.md -msgid "[Destructuring](./pattern-matching/destructuring.md) (10 minutes)" +#: src/pattern-matching/match.md src/generics/exercise.md +#: src/generics/solution.md src/std-traits/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "'a'" msgstr "" -#: src/pattern-matching.md -msgid "[Let Control Flow](./pattern-matching/let-control-flow.md) (10 minutes)" +#: src/pattern-matching/match.md +msgid "'s'" msgstr "" -#: src/pattern-matching.md -msgid "" -"[Exercise: Expression Evaluation](./pattern-matching/exercise.md) (30 " -"minutes)" +#: src/pattern-matching/match.md +msgid "'w'" msgstr "" -#: src/pattern-matching/destructuring.md -msgid "Like tuples, structs and enums can also be destructured by matching:" +#: src/pattern-matching/match.md +msgid "'d'" msgstr "" -#: src/pattern-matching/destructuring.md -msgid "Structs" -msgstr "Structures" +#: src/pattern-matching/match.md +msgid "\"Moving around\"" +msgstr "" + +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md +msgid "'0'" +msgstr "" + +#: src/pattern-matching/match.md src/error-handling/exercise.md +#: src/error-handling/solution.md +msgid "'9'" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Number input\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Lowercase: {key}\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Something else\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "" +"The `_` pattern is a wildcard pattern which matches any value. The " +"expressions _must_ be exhaustive, meaning that it covers every possibility, " +"so `_` is often used as the final catch-all case." +msgstr "" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"Match can be used as an expression. Just like `if`, each match arm must have " +"the same type. The type is the last expression of the block, if any. In the " +"example above, the type is `()`." +msgstr "" +"Comme `if let`, chaque bras de correspondance doit avoir le même type. Le " +"type est le dernier expression du bloc, le cas échéant. Dans l'exemple ci-" +"dessus, le type est `()`." + +#: src/pattern-matching/match.md +msgid "" +"A variable in the pattern (`key` in this example) will create a binding that " +"can be used within the match arm." +msgstr "" + +#: src/pattern-matching/match.md +msgid "A match guard causes the arm to match only if the condition is true." +msgstr "" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"You might point out how some specific characters are being used when in a " +"pattern" +msgstr "" +"Vous pouvez indiquer comment certains caractères spécifiques sont utilisés " +"dans un modèle" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "`|` as an `or`" +msgstr "`|` comme un `ou`" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "`..` can expand as much as it needs to be" +msgstr "`..` peut s'étendre autant que nécessaire" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "`1..=5` represents an inclusive range" +msgstr "`1..=5` représente une plage inclusive" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "`_` is a wild card" +msgstr "`_` est un joker" + +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"Match guards as a separate syntax feature are important and necessary when " +"we wish to concisely express more complex ideas than patterns alone would " +"allow." +msgstr "" +"Les gardes de correspondance en tant que fonctionnalité de syntaxe distincte " +"sont importants et nécessaires lorsque nous souhaitons exprimer de manière " +"concise des idées plus complexes que ne le permettraient les modèles seuls." + +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"They are not the same as separate `if` expression inside of the match arm. " +"An `if` expression inside of the branch block (after `=>`) happens after the " +"match arm is selected. Failing the `if` condition inside of that block won't " +"result in other arms of the original `match` expression being considered." +msgstr "" +"Ils ne sont pas identiques à une expression \"if\" séparée à l'intérieur du " +"bras de match. Une expression `if` à l'intérieur du bloc de branche (après " +"`=>`) se produit après la sélection du bras de correspondance. L'échec de la " +"condition \"si\" à l'intérieur de ce bloc n'entraînera pas d'autres bras de " +"l'expression \"match\" d'origine considérée." + +#: src/pattern-matching/match.md +#, fuzzy +msgid "" +"The condition defined in the guard applies to every expression in a pattern " +"with an `|`." +msgstr "" +"La condition définie dans la garde s'applique à chaque expression dans un " +"modèle avec un `|`." + +#: src/pattern-matching/destructuring.md +msgid "Like tuples, structs and enums can also be destructured by matching:" +msgstr "" + +#: src/pattern-matching/destructuring.md +msgid "Structs" +msgstr "Structures" #: src/pattern-matching/destructuring.md msgid "\"x.0 = 1, b = {b}, y = {y}\"" @@ -5437,8 +5092,8 @@ msgid "\"result: {:?}\"" msgstr "" #: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/googletest.md -#: src/testing/solution.md +#: src/smart-pointers/solution.md src/testing/solution.md +#: src/android/testing.md src/android/testing/googletest.md msgid "\"foo\"" msgstr "" @@ -5584,31 +5239,6 @@ msgstr "" msgid "\"expr: {:?}\"" msgstr "" -#: src/methods-and-traits.md -msgid "[Methods](./methods-and-traits/methods.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Traits](./methods-and-traits/traits.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Deriving](./methods-and-traits/deriving.md) (5 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "[Trait Objects](./methods-and-traits/trait-objects.md) (10 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "" -"[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" -msgstr "" - -#: src/methods-and-traits.md -msgid "This segment should take about 55 minutes" -msgstr "" - #: src/methods-and-traits/methods.md #, fuzzy msgid "" @@ -5800,203 +5430,148 @@ msgstr "" "aux interfaces :" #: src/methods-and-traits/traits.md -msgid "\"Oh you're a cutie! What's your name? {}\"" +msgid "/// Return a sentence from this pet.\n" msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md -msgid "\"Woof, my name is {}!\"" +#: src/methods-and-traits/traits.md +msgid "/// Print a string to the terminal greeting this pet.\n" msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md -msgid "\"Miau!\"" +#: src/methods-and-traits/traits.md +msgid "" +"A trait defines a number of methods that types must have in order to " +"implement the trait." +msgstr "" + +#: src/methods-and-traits/traits.md +msgid "" +"In the \"Generics\" segment, next, we will see how to build functionality " +"that is generic over all types implementing a trait." +msgstr "" + +#: src/methods-and-traits/traits/implementing.md +msgid "\"Oh you're a cutie! What's your name? {}\"" msgstr "" -#: src/methods-and-traits/traits.md src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/implementing.md +#: src/smart-pointers/trait-objects.md +msgid "\"Woof, my name is {}!\"" +msgstr "" + +#: src/methods-and-traits/traits/implementing.md +#: src/smart-pointers/trait-objects.md msgid "\"Fido\"" msgstr "" -#: src/methods-and-traits/traits.md +#: src/methods-and-traits/traits/implementing.md msgid "" -"A trait defines a number of methods that types must have in order to " -"implement the trait." +"To implement `Trait` for `Type`, you use an `impl Trait for Type { .. }` " +"block." msgstr "" -#: src/methods-and-traits/traits.md -msgid "Traits are implemented in an `impl for { .. }` block." +#: src/methods-and-traits/traits/implementing.md +msgid "" +"Unlike Go interfaces, just having matching methods is not enough: a `Cat` " +"type with a `talk()` method would not automatically satisfy `Pet` unless it " +"is in an `impl Pet` block." msgstr "" -#: src/methods-and-traits/traits.md +#: src/methods-and-traits/traits/implementing.md #, fuzzy msgid "" -"Traits may specify pre-implemented (provided) methods and methods that users " -"are required to implement themselves. Provided methods can rely on required " -"methods. In this case, `greet` is provided, and relies on `talk`." +"Traits may provide default implementations of some methods. Default " +"implementations can rely on all the methods of the trait. In this case, " +"`greet` is provided, and relies on `talk`." msgstr "" "Les caractéristiques peuvent spécifier des méthodes pré-implémentées (par " "défaut) et des méthodes que les utilisateurs sont tenus de suivre mettre en " "œuvre eux-mêmes. Les méthodes avec des implémentations par défaut peuvent " "s'appuyer sur les méthodes requises." -#: src/methods-and-traits/deriving.md +#: src/methods-and-traits/traits/supertraits.md msgid "" -"Supported traits can be automatically implemented for your custom types, as " -"follows:" +"A trait can require that types implementing it also implement other traits, " +"called _supertraits_. Here, any type implementing `Pet` must implement " +"`Animal`." msgstr "" -#: src/methods-and-traits/deriving.md -msgid "// Default trait adds `default` constructor.\n" -msgstr "" - -#: src/methods-and-traits/deriving.md -msgid "// Clone trait adds `clone` method.\n" -msgstr "" - -#: src/methods-and-traits/deriving.md -msgid "\"EldurScrollz\"" -msgstr "" - -#: src/methods-and-traits/deriving.md -msgid "// Debug trait adds support for printing with `{:?}`.\n" +#: src/methods-and-traits/traits/supertraits.md +#: src/async/control-flow/select.md +msgid "\"Rex\"" msgstr "" -#: src/methods-and-traits/deriving.md -msgid "\"{:?} vs. {:?}\"" +#: src/methods-and-traits/traits/supertraits.md +msgid "\"{} has {} legs\"" msgstr "" -#: src/methods-and-traits/deriving.md +#: src/methods-and-traits/traits/supertraits.md msgid "" -"Derivation is implemented with macros, and many crates provide useful derive " -"macros to add useful functionality. For example, `serde` can derive " -"serialization support for a struct using `#[derive(Serialize)]`." +"This is sometimes called \"trait inheritance\" but students should not " +"expect this to behave like OO inheritance. It just specifies an additional " +"requirement on implementations of a trait." msgstr "" -#: src/methods-and-traits/trait-objects.md -#, fuzzy +#: src/methods-and-traits/traits/associated-types.md msgid "" -"Trait objects allow for values of different types, for instance in a " -"collection:" +"Associated types are placeholder types which are supplied by the trait " +"implementation." msgstr "" -"Les objets de trait autorisent des valeurs de différents types, par exemple " -"dans une collection :" -#: src/methods-and-traits/trait-objects.md -msgid "\"Hello, who are you? {}\"" +#: src/methods-and-traits/traits/associated-types.md +#: src/async/control-flow/join.md +msgid "\"{:?}\"" msgstr "" -#: src/methods-and-traits/trait-objects.md -#, fuzzy -msgid "Memory layout after allocating `pets`:" -msgstr "Disposition de la mémoire après l'allocation de `pets` :" - -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/associated-types.md msgid "" -"```bob\n" -" Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" -": : : :\n" -": pets : : +----+----+----+----" -"+ :\n" -": +-----------+-------+ : : +-----+-----+ .->| F | i | d | o " -"| :\n" -": | ptr | o---+---+-----+-->| o o | o o | | +----+----+----+----" -"+ :\n" -": | len | 2 | : : +-|-|-+-|-|-+ " -"`---------. :\n" -": | capacity | 2 | : : | | | | data " -"| :\n" -": +-----------+-------+ : : | | | | +-------+--|-------" -"+ :\n" -": : : | | | '-->| name | o, 4, 4 " -"| :\n" -": : : | | | | age | 5 " -"| :\n" -"`- - - - - - - - - - - - - -' : | | | +-------+----------" -"+ :\n" -" : | | " -"| :\n" -" : | | | " -"vtable :\n" -" : | | | +----------------------" -"+ :\n" -" : | | '---->| \"::talk\" " -"| :\n" -" : | | +----------------------" -"+ :\n" -" : | " -"| :\n" -" : | | " -"data :\n" -" : | | +-------+-------" -"+ :\n" -" : | '-->| lives | 9 " -"| :\n" -" : | +-------+-------" -"+ :\n" -" : " -"| :\n" -" : | " -"vtable :\n" -" : | +----------------------" -"+ :\n" -" : '---->| \"::talk\" " -"| :\n" -" : +----------------------" -"+ :\n" -" : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" -"```" +"Associated types are sometimes also called \"output types\". The key " +"observation is that the implementer, not the caller, chooses this type." msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/traits/associated-types.md msgid "" -"Types that implement a given trait may be of different sizes. This makes it " -"impossible to have things like `Vec` in the example above." +"Many standard library traits have associated types, including arithmetic " +"operators and `Iterator`." msgstr "" -#: src/methods-and-traits/trait-objects.md +#: src/methods-and-traits/deriving.md msgid "" -"`dyn Pet` is a way to tell the compiler about a dynamically sized type that " -"implements `Pet`." +"Supported traits can be automatically implemented for your custom types, as " +"follows:" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"In the example, `pets` is allocated on the stack and the vector data is on " -"the heap. The two vector elements are _fat pointers_:" +#: src/methods-and-traits/deriving.md +msgid "// Default trait adds `default` constructor.\n" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"A fat pointer is a double-width pointer. It has two components: a pointer to " -"the actual object and a pointer to the [virtual method table](https://en." -"wikipedia.org/wiki/Virtual_method_table) (vtable) for the `Pet` " -"implementation of that particular object." +#: src/methods-and-traits/deriving.md +msgid "// Clone trait adds `clone` method.\n" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "" -"The data for the `Dog` named Fido is the `name` and `age` fields. The `Cat` " -"has a `lives` field." +#: src/methods-and-traits/deriving.md +msgid "\"EldurScrollz\"" msgstr "" -#: src/methods-and-traits/trait-objects.md -msgid "Compare these outputs in the above example:" +#: src/methods-and-traits/deriving.md +msgid "// Debug trait adds support for printing with `{:?}`.\n" msgstr "" -#: src/methods-and-traits/trait-objects.md src/std-traits/closures.md -msgid "\"{} {}\"" +#: src/methods-and-traits/deriving.md +msgid "\"{:?} vs. {:?}\"" msgstr "" -#: src/methods-and-traits/trait-objects.md src/std-traits/exercise.md -#: src/std-traits/solution.md src/modules/exercise.md src/modules/solution.md -#: src/android/build-rules/library.md -#: src/android/interoperability/cpp/rust-bridge.md -#: src/async/pitfalls/cancellation.md -msgid "\"{}\"" +#: src/methods-and-traits/deriving.md +msgid "" +"Derivation is implemented with macros, and many crates provide useful derive " +"macros to add useful functionality. For example, `serde` can derive " +"serialization support for a struct using `#[derive(Serialize)]`." msgstr "" +#: src/methods-and-traits/exercise.md +#, fuzzy +msgid "Exercise: Logger Trait" +msgstr "Exercices" + #: src/methods-and-traits/exercise.md msgid "" "Let's design a simple logging utility, using a trait `Logger` with a `log` " @@ -6043,30 +5618,6 @@ msgstr "" msgid "/// Only log messages up to the given verbosity level.\n" msgstr "" -#: src/generics.md -msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" -msgstr "" - -#: src/generics.md -msgid "[Generic Data Types](./generics/generic-data.md) (15 minutes)" -msgstr "" - -#: src/generics.md -msgid "[Trait Bounds](./generics/trait-bounds.md) (10 minutes)" -msgstr "" - -#: src/generics.md -msgid "[impl Trait](./generics/impl-trait.md) (5 minutes)" -msgstr "" - -#: src/generics.md -msgid "[Exercise: Generic min](./generics/exercise.md) (10 minutes)" -msgstr "" - -#: src/generics.md src/smart-pointers.md src/iterators.md src/error-handling.md -msgid "This segment should take about 45 minutes" -msgstr "" - #: src/generics/generic-functions.md #, fuzzy msgid "" @@ -6184,18 +5735,66 @@ msgid "" "type variables, e.g., `T` and `U`." msgstr "" -#: src/generics/trait-bounds.md -#, fuzzy +#: src/generics/generic-traits.md msgid "" -"When working with generics, you often want to require the types to implement " -"some trait, so that you can call this trait's methods." +"Traits can also be generic, just like types and functions. A trait's " +"parameters get concrete types when it is used." msgstr "" -"Lorsque vous travaillez avec des génériques, vous souhaitez souvent exiger " -"que les types implémentent un trait, afin que vous puissiez appeler les " -"méthodes de ce trait." -#: src/generics/trait-bounds.md -#, fuzzy +#: src/generics/generic-traits.md +msgid "\"Converted from integer: {from}\"" +msgstr "" + +#: src/generics/generic-traits.md +msgid "\"Converted from bool: {from}\"" +msgstr "" + +#: src/generics/generic-traits.md +msgid "\"{from_int:?}, {from_bool:?}\"" +msgstr "" + +#: src/generics/generic-traits.md +msgid "" +"The `From` trait will be covered later in the course, but its [definition in " +"the `std` docs](https://doc.rust-lang.org/std/convert/trait.From.html) is " +"simple." +msgstr "" + +#: src/generics/generic-traits.md +msgid "" +"Implementations of the trait do not need to cover all possible type " +"parameters. Here, `Foo::From(\"hello\")` would not compile because there is " +"no `From<&str>` implementation for `Foo`." +msgstr "" + +#: src/generics/generic-traits.md +msgid "" +"Generic traits take types as \"input\", while associated types are a kind of " +"\"output type. A trait can have multiple implementations for different input " +"types." +msgstr "" + +#: src/generics/generic-traits.md +msgid "" +"In fact, Rust requires that at most one implementation of a trait match for " +"any type T. Unlike some other languages, Rust has no heuristic for choosing " +"the \"most specific\" match. There is work on adding this support, called " +"[specialization](https://rust-lang.github.io/rfcs/1210-impl-specialization." +"html)." +msgstr "" + +#: src/generics/trait-bounds.md +#, fuzzy +msgid "" +"When working with generics, you often want to require the types to implement " +"some trait, so that you can call this trait's methods." +msgstr "" +"Lorsque vous travaillez avec des génériques, vous souhaitez souvent exiger " +"que les types implémentent un trait, afin que vous puissiez appeler les " +"méthodes de ce trait." + +#: src/generics/trait-bounds.md +#, fuzzy msgid "You can do this with `T: Trait` or `impl Trait`:" msgstr "Vous pouvez le faire avec `T: Trait` ou `impl Trait` :" @@ -6329,70 +5928,53 @@ msgid "" msgstr "" #: src/generics/exercise.md +#, fuzzy msgid "" "In this short exercise, you will implement a generic `min` function that " -"determines the minimum of two values, using a `LessThan` trait." -msgstr "" - -#: src/generics/exercise.md src/generics/solution.md -msgid "/// Return true if self is less than other.\n" +"determines the minimum of two values, using the [`Ord`](https://doc.rust-" +"lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" +"Vous pouvez implémenter le trait [`Iterator`](https://doc.rust-lang.org/std/" +"iter/trait.Iterator.html) sur vos propres types :" #: src/generics/exercise.md msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "" #: src/generics/exercise.md src/generics/solution.md -msgid "\"Shapiro\"" +#: src/error-handling/exercise.md src/error-handling/solution.md +msgid "'z'" msgstr "" #: src/generics/exercise.md src/generics/solution.md -msgid "\"Baumann\"" -msgstr "" - -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Types](./std-types.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Standard Library](./std-types/std.md) (3 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Documentation](./std-types/docs.md) (5 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Option](./std-types/option.md) (10 minutes)" -msgstr "" - -#: src/std-types.md -msgid "[Result](./std-types/result.md) (10 minutes)" +msgid "'7'" msgstr "" -#: src/std-types.md -msgid "[String](./std-types/string.md) (10 minutes)" +#: src/generics/exercise.md src/generics/solution.md +msgid "'1'" msgstr "" -#: src/std-types.md -msgid "[Vec](./std-types/vec.md) (10 minutes)" +#: src/generics/exercise.md src/generics/solution.md +msgid "\"goodbye\"" msgstr "" -#: src/std-types.md -msgid "[HashMap](./std-types/hashmap.md) (10 minutes)" +#: src/generics/exercise.md src/generics/solution.md +msgid "\"bat\"" msgstr "" -#: src/std-types.md -msgid "[Exercise: Counter](./std-types/exercise.md) (10 minutes)" +#: src/generics/exercise.md src/generics/solution.md +msgid "\"armadillo\"" msgstr "" -#: src/std-types.md src/memory-management.md src/slices-and-lifetimes.md -msgid "This segment should take about 1 hour and 10 minutes" +#: src/generics/exercise.md +#, fuzzy +msgid "" +"Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." +"html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." +"Ordering.html) enum." msgstr "" +"[`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) et [`Write`]" +"(https://doc.rust-lang.org/std/io/trait.Write.html) utilisés pour IO," #: src/std-types.md msgid "" @@ -6643,7 +6225,7 @@ msgstr "" #, fuzzy msgid "" "`Result` is the standard type to implement error handling as we will see on " -"Day 3." +"Day 4." msgstr "" "`Result` est le type standard pour implémenter la gestion des erreurs, comme " "nous le verrons le jour 3." @@ -6769,6 +6351,15 @@ msgid "" "boundaries or not." msgstr "" +#: src/std-types/string.md +msgid "" +"Many types can be converted to a string with the [`to_string`](https://doc." +"rust-lang.org/std/string/trait.ToString.html#tymethod.to_string) method. " +"This trait is automatically implemented for all types that implement " +"`Display`, so anything that can be formatted can also be converted to a " +"string." +msgstr "" + #: src/std-types/vec.md #, fuzzy msgid "" @@ -7006,42 +6597,6 @@ msgstr "" msgid "\"got {} apples\"" msgstr "" -#: src/std-traits.md -msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Operators](./std-traits/operators.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[From and Into](./std-traits/from-and-into.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Casting](./std-traits/casting.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Read and Write](./std-traits/read-and-write.md) (10 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Default, struct update syntax](./std-traits/default.md) (5 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Closures](./std-traits/closures.md) (20 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "[Exercise: ROT13](./std-traits/exercise.md) (30 minutes)" -msgstr "" - -#: src/std-traits.md -msgid "This segment should take about 1 hour and 40 minutes" -msgstr "" - #: src/std-traits.md msgid "" "As with the standard-library types, spend time reviewing the documentation " @@ -7306,10 +6861,6 @@ msgstr "" msgid "\"\\n\"" msgstr "" -#: src/std-traits/read-and-write.md src/slices-and-lifetimes/str.md -msgid "\"World\"" -msgstr "" - #: src/std-traits/read-and-write.md msgid "\"Logged: {:?}\"" msgstr "" @@ -7344,8 +6895,8 @@ msgstr "" msgid "\"{almost_default_struct:#?}\"" msgstr "" -#: src/std-traits/default.md src/slices-and-lifetimes/exercise.md -#: src/slices-and-lifetimes/solution.md +#: src/std-traits/default.md src/lifetimes/exercise.md +#: src/lifetimes/solution.md msgid "\"{:#?}\"" msgstr "" @@ -7500,12 +7051,16 @@ msgid "" "keyword makes them capture by value." msgstr "" +#: src/std-traits/closures.md src/smart-pointers/trait-objects.md +msgid "\"{} {}\"" +msgstr "" + #: src/std-traits/closures.md msgid "\"Hi\"" msgstr "" #: src/std-traits/closures.md -msgid "\"there\"" +msgid "\"Greg\"" msgstr "" #: src/std-traits/exercise.md @@ -7557,58 +7112,6 @@ msgstr "" msgid "Smart pointers: standard library pointer types." msgstr "" -#: src/welcome-day-3.md -msgid "[Welcome](./welcome-day-3.md) (3 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Memory Management](./memory-management.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Smart Pointers](./smart-pointers.md) (45 minutes)" -msgstr "" - -#: src/welcome-day-3.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 15 " -"minutes" -msgstr "" - -#: src/memory-management.md -msgid "[Review of Program Memory](./memory-management/review.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "" -"[Approaches to Memory Management](./memory-management/approaches.md) (10 " -"minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Ownership](./memory-management/ownership.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Move Semantics](./memory-management/move.md) (10 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Clone](./memory-management/clone.md) (2 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Copy Types](./memory-management/copy-types.md) (5 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Drop](./memory-management/drop.md) (10 minutes)" -msgstr "" - -#: src/memory-management.md -msgid "[Exercise: Builder Type](./memory-management/exercise.md) (20 minutes)" -msgstr "" - #: src/memory-management/review.md msgid "Programs allocate memory in two ways:" msgstr "" @@ -7706,7 +7209,7 @@ msgid "" msgstr "" #: src/memory-management/review.md -msgid "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" +msgid "\"capacity = {capacity}, ptr = {ptr:#x}, len = {len}\"" msgstr "" #: src/memory-management/approaches.md @@ -7853,10 +7356,6 @@ msgstr "Une affectation transférera la propriété entre les variables :" msgid "\"Hello!\"" msgstr "Bonjour le monde!" -#: src/memory-management/move.md src/slices-and-lifetimes/str.md -msgid "\"s2: {s2}\"" -msgstr "" - #: src/memory-management/move.md msgid "// println!(\"s1: {s1}\");\n" msgstr "" @@ -7892,20 +7391,20 @@ msgstr "Après le passage à `s2` :" msgid "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n" -": : : :\n" -": s1 \"(inaccessible)\" : : :\n" -": +-----------+-------+ : : +----+----+----+----+ :\n" -": | ptr | o---+---+--+--+-->| R | u | s | t | :\n" -": | len | 4 | : | : +----+----+----+----+ :\n" -": | capacity | 4 | : | : :\n" -": +-----------+-------+ : | : :\n" -": : | `- - - - - - - - - - - - - -'\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - -.\n" +": : : :\n" +": s1 \"(inaccessible)\" : : :\n" +": +-----------+-------+ : : +----+----+----+----+----+----+ :\n" +": | ptr | o---+---+--+--+-->| H | e | l | l | o | ! | :\n" +": | len | 6 | : | : +----+----+----+----+----+----+ :\n" +": | capacity | 6 | : | : :\n" +": +-----------+-------+ : | : :\n" +": : | `- - - - - - - - - - - - - - - - - - -'\n" ": s2 : |\n" ": +-----------+-------+ : |\n" ": | ptr | o---+---+--'\n" -": | len | 4 | :\n" -": | capacity | 4 | :\n" +": | len | 6 | :\n" +": | capacity | 6 | :\n" ": +-----------+-------+ :\n" ": :\n" "`- - - - - - - - - - - - - -'\n" @@ -8219,7 +7718,7 @@ msgstr "" msgid "\"a\"" msgstr "" -#: src/memory-management/drop.md src/testing/googletest.md +#: src/memory-management/drop.md src/android/testing/googletest.md msgid "\"b\"" msgstr "" @@ -8402,22 +7901,6 @@ msgstr "" msgid "\"0.1\"" msgstr "" -#: src/smart-pointers.md -msgid "[Box" -msgstr "" - -#: src/smart-pointers.md -msgid "](./smart-pointers/box.md) (10 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Rc](./smart-pointers/rc.md) (5 minutes)" -msgstr "" - -#: src/smart-pointers.md -msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" -msgstr "" - #: src/smart-pointers/box.md #, fuzzy msgid "" @@ -8522,8 +8005,8 @@ msgstr "" #, fuzzy msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " -"`List`, the compiler would not compute a fixed size of the struct in memory " -"(`List` would be of infinite size)." +"`List`, the compiler would not be able to compute a fixed size for the " +"struct in memory (the `List` would be of infinite size)." msgstr "" "Si la `Box` n'a pas été utilisée ici et que nous avons essayé d'intégrer une " "`List` directement dans la `List`, le compilateur ne calculerait pas une " @@ -8541,9 +8024,10 @@ msgstr "" #: src/smart-pointers/box.md #, fuzzy msgid "" -"Remove the `Box` in the List definition and show the compiler error. " -"\"Recursive with indirection\" is a hint you might want to use a Box or " -"reference of some kind, instead of storing a value directly." +"Remove the `Box` in the List definition and show the compiler error. We get " +"the message \"recursive without indirection\", because for data recursion, " +"we have to use indirection, a `Box` or reference of some kind, instead of " +"storing the value directly." msgstr "" "Supprimez la `Box` dans la définition de la liste et affichez l'erreur du " "compilateur. \"Récursif avec indirection\" est un indice que vous voudrez " @@ -8555,28 +8039,39 @@ msgid "Niche Optimization" msgstr "Optimisation niche" #: src/smart-pointers/box.md -#, fuzzy msgid "" -"A `Box` cannot be empty, so the pointer is always valid and non-`null`. This " -"allows the compiler to optimize the memory layout:" +"Though `Box` looks like `std::unique_ptr` in C++, it cannot be empty/null. " +"This makes `Box` one of the types that allow the compiler to optimize " +"storage of some enums." msgstr "" -"Une `Box` ne peut pas être vide, donc le pointeur est toujours valide et non " -"`null`. Ce permet au compilateur d'optimiser la disposition de la mémoire :" #: src/smart-pointers/box.md msgid "" -"```bob\n" -" Stack Heap\n" -".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - -.\n" -": : : :\n" -": list : : :\n" -": +---------+----+----+ : : +---------+----+----+ :\n" -": | Element | 1 | o--+----+-----+--->| Element | 2 | // | :\n" -": +---------+----+----+ : : +---------+----+----+ :\n" -": : : :\n" -": : : :\n" -"'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - -'\n" -"```" +"For example, `Option>` has the same size, as just `Box`, because " +"compiler uses NULL-value to discriminate variants instead of using explicit " +"tag ([\"Null Pointer Optimization\"](https://doc.rust-lang.org/std/option/" +"#representation)):" +msgstr "" + +#: src/smart-pointers/box.md +msgid "\"Just box\"" +msgstr "" + +#: src/smart-pointers/box.md +#, fuzzy +msgid "\"Optional box\"" +msgstr "Exceptions" + +#: src/smart-pointers/box.md +msgid "\"Size of just_box: {}\"" +msgstr "" + +#: src/smart-pointers/box.md +msgid "\"Size of optional_box: {}\"" +msgstr "" + +#: src/smart-pointers/box.md +msgid "\"Size of none: {}\"" msgstr "" #: src/smart-pointers/rc.md @@ -8668,6 +8163,124 @@ msgstr "" "référence_ pour créer des cycles qui seront supprimés correctement " "(probablement en combinaison avec `RefCell`)." +#: src/smart-pointers/trait-objects.md +#, fuzzy +msgid "" +"Trait objects allow for values of different types, for instance in a " +"collection:" +msgstr "" +"Les objets de trait autorisent des valeurs de différents types, par exemple " +"dans une collection :" + +#: src/smart-pointers/trait-objects.md +msgid "\"Miau!\"" +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "\"Hello, who are you? {}\"" +msgstr "" + +#: src/smart-pointers/trait-objects.md +#, fuzzy +msgid "Memory layout after allocating `pets`:" +msgstr "Disposition de la mémoire après l'allocation de `pets` :" + +#: src/smart-pointers/trait-objects.md +msgid "" +"```bob\n" +" Stack Heap\n" +".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " +"- -.\n" +": : : :\n" +": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +"+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d | " +"o | :\n" +": | ptr | o---+---+--. : | lives | 9 | +----+----+----" +"+----+ :\n" +": | len | 2 | : | : +-------+-------+ " +"^ :\n" +": | capacity | 2 | : | : ^ " +"| :\n" +": +-----------+-------+ : | : | " +"'-------. :\n" +": : | : | data:" +"\"Dog\"| :\n" +": : | : | +-------+--|-------" +"+ :\n" +"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " +"| :\n" +" `--+-->| o o | o o-|----->| age | 5 " +"| :\n" +" : +-|---+-|---+ +-------+----------" +"+ :\n" +" : | " +"| :\n" +" `- - -| - - |- - - - - - - - - - - - - - - " +"- -'\n" +" | |\n" +" | | " +"\"Program text\"\n" +" .- - -| - - |- - - - - - - - - - - - - - - " +"- -.\n" +" : | | " +"vtable :\n" +" : | | +----------------------" +"+ :\n" +" : | `----->| \"::" +"talk\" | :\n" +" : | +----------------------" +"+ :\n" +" : | " +"vtable :\n" +" : | +----------------------" +"+ :\n" +" : '----------->| \"::" +"talk\" | :\n" +" : +----------------------" +"+ :\n" +" : :\n" +" '- - - - - - - - - - - - - - - - - - - - - " +"- -'\n" +"```" +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "" +"Types that implement a given trait may be of different sizes. This makes it " +"impossible to have things like `Vec` in the example above." +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "" +"`dyn Pet` is a way to tell the compiler about a dynamically sized type that " +"implements `Pet`." +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "" +"In the example, `pets` is allocated on the stack and the vector data is on " +"the heap. The two vector elements are _fat pointers_:" +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "" +"A fat pointer is a double-width pointer. It has two components: a pointer to " +"the actual object and a pointer to the [virtual method table](https://en." +"wikipedia.org/wiki/Virtual_method_table) (vtable) for the `Pet` " +"implementation of that particular object." +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "" +"The data for the `Dog` named Fido is the `name` and `age` fields. The `Cat` " +"has a `lives` field." +msgstr "" + +#: src/smart-pointers/trait-objects.md +msgid "Compare these outputs in the above example:" +msgstr "" + #: src/smart-pointers/exercise.md msgid "" "A binary tree is a tree-type data structure where every node has two " @@ -8709,41 +8322,10 @@ msgstr "" msgid "// not a unique item\n" msgstr "" -#: src/smart-pointers/solution.md src/testing/googletest.md +#: src/smart-pointers/solution.md src/android/testing/googletest.md msgid "\"bar\"" msgstr "" -#: src/welcome-day-3-afternoon.md -msgid "[Borrowing](./borrowing.md) (1 hour)" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "" -"[Slices and Lifetimes](./slices-and-lifetimes.md) (1 hour and 10 minutes)" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 20 " -"minutes" -msgstr "" - -#: src/borrowing.md -msgid "[Borrowing a Value](./borrowing/shared.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Borrow Checking](./borrowing/borrowck.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Interior Mutability](./borrowing/interior-mutability.md) (10 minutes)" -msgstr "" - -#: src/borrowing.md -msgid "[Exercise: Health Statistics](./borrowing/exercise.md) (30 minutes)" -msgstr "" - #: src/borrowing/shared.md #, fuzzy msgid "" @@ -8987,7 +8569,8 @@ msgid "" msgstr "" #: src/borrowing/exercise.md src/borrowing/solution.md -#: src/android/build-rules/library.md src/android/aidl/client.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "" @@ -8995,215 +8578,13 @@ msgstr "" msgid "\"I'm {} and my age is {}\"" msgstr "" -#: src/slices-and-lifetimes.md -msgid "[Slices: &\\[T\\]](./slices-and-lifetimes/slices.md) (10 minutes)" -msgstr "" - -#: src/slices-and-lifetimes.md -msgid "[String References](./slices-and-lifetimes/str.md) (10 minutes)" -msgstr "" - -#: src/slices-and-lifetimes.md -msgid "" -"[Lifetime Annotations](./slices-and-lifetimes/lifetime-annotations.md) (10 " -"minutes)" -msgstr "" - -#: src/slices-and-lifetimes.md -msgid "" -"[Lifetime Elision](./slices-and-lifetimes/lifetime-elision.md) (5 minutes)" -msgstr "" - -#: src/slices-and-lifetimes.md -msgid "" -"[Struct Lifetimes](./slices-and-lifetimes/struct-lifetimes.md) (5 minutes)" -msgstr "" - -#: src/slices-and-lifetimes.md -msgid "" -"[Exercise: Protobuf Parsing](./slices-and-lifetimes/exercise.md) (30 minutes)" -msgstr "" - -#: src/slices-and-lifetimes/slices.md -msgid "Slices" -msgstr "Tranches" - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "A slice gives you a view into a larger collection:" -msgstr "Une tranche vous donne une vue dans une plus grande collection :" - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "Slices borrow data from the sliced type." -msgstr "" -"Les tranches empruntent des données au type en tranches. \\* Question : Que " -"se passe-t-il si vous modifiez `a[3]` ?" - -#: src/slices-and-lifetimes/slices.md -msgid "Question: What happens if you modify `a[3]` right before printing `s`?" -msgstr "" - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"We create a slice by borrowing `a` and specifying the starting and ending " -"indexes in brackets." -msgstr "" -"Nous créons une tranche en empruntant `a` et en spécifiant les index de " -"début et de fin entre parenthèses." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"If the slice starts at index 0, Rust’s range syntax allows us to drop the " -"starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " -"identical." -msgstr "" -"Si la tranche commence à l'index 0, la syntaxe de plage de Rust nous permet " -"de supprimer l'index de départ, ce qui signifie que `&a[0..a.len()]` et " -"`&a[..a.len()]` sont identiques ." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " -"identical." -msgstr "" -"Il en va de même pour le dernier index, donc `&a[2..a.len()]` et `&a[2..]` " -"sont identiques." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"To easily create a slice of the full array, we can therefore use `&a[..]`." -msgstr "" -"Pour créer facilement une tranche du tableau complet, on peut donc utiliser " -"`&a[..]`." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"`s` is a reference to a slice of `i32`s. Notice that the type of `s` " -"(`&[i32]`) no longer mentions the array length. This allows us to perform " -"computation on slices of different sizes." -msgstr "" -"`s` est une référence à une tranche de `i32`s. Notez que le type de `s` " -"(`&[i32]`) ne mentionne plus la longueur du tableau. Cela nous permet " -"d'effectuer des calculs sur des tranches de tailles différentes." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"Slices always borrow from another object. In this example, `a` has to remain " -"'alive' (in scope) for at least as long as our slice." -msgstr "" -"Les tranches empruntent toujours à un autre objet. Dans cet exemple, \"a\" " -"doit rester \"vivant\" (dans la portée) au moins aussi longtemps que notre " -"tranche." - -#: src/slices-and-lifetimes/slices.md -#, fuzzy -msgid "" -"The question about modifying `a[3]` can spark an interesting discussion, but " -"the answer is that for memory safety reasons you cannot do it through `a` at " -"this point in the execution, but you can read the data from both `a` and `s` " -"safely. It works before you created the slice, and again after the " -"`println`, when the slice is no longer used." -msgstr "" -"La question sur la modification de `a[3]` peut susciter une discussion " -"intéressante, mais la réponse est que pour des raisons de sécurité de la " -"mémoire vous ne pouvez pas le faire via `a` après avoir créé une tranche, " -"mais vous pouvez lire les données de `a` et `s` en toute sécurité. Plus de " -"détails seront expliqués dans la section Vérificateur d'emprunt." - -#: src/slices-and-lifetimes/str.md -msgid "" -"We can now understand the two string types in Rust: `&str` is almost like " -"`&[char]`, but with its data stored in a variable-length encoding (UTF-8)." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "\"s1: {s1}\"" -msgstr "" - -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "\"Hello \"" -msgstr "Bonjour le monde!" - -#: src/slices-and-lifetimes/str.md -msgid "\"s3: {s3}\"" -msgstr "" - -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "Rust terminology:" -msgstr "Terminologie de Rust :" - -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "`&str` an immutable reference to a string slice." -msgstr "`&str` une référence immuable à une tranche de chaîne." - -#: src/slices-and-lifetimes/str.md -#, fuzzy -msgid "`String` a mutable string buffer." -msgstr "`String` un tampon de chaîne mutable." - -#: src/slices-and-lifetimes/str.md -msgid "" -"`&str` introduces a string slice, which is an immutable reference to UTF-8 " -"encoded string data stored in a block of memory. String literals " -"(`”Hello”`), are stored in the program’s binary." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "" -"Rust’s `String` type is a wrapper around a vector of bytes. As with a " -"`Vec`, it is owned." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "" -"As with many other types `String::from()` creates a string from a string " -"literal; `String::new()` creates a new empty string, to which string data " -"can be added using the `push()` and `push_str()` methods." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "" -"The `format!()` macro is a convenient way to generate an owned string from " -"dynamic values. It accepts the same format specification as `println!()`." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "" -"You can borrow `&str` slices from `String` via `&` and optionally range " -"selection. If you select a byte range that is not aligned to character " -"boundaries, the expression will panic. The `chars` iterator iterates over " -"characters and is preferred over trying to get character boundaries right." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "" -"For C++ programmers: think of `&str` as `std::string_view` from C++, but the " -"one that always points to a valid string in memory. Rust `String` is a rough " -"equivalent of `std::string` from C++ (main difference: it can only contain " -"UTF-8 encoded bytes and will never use a small-string optimization)." -msgstr "" - -#: src/slices-and-lifetimes/str.md -msgid "Byte strings literals allow you to create a `&[u8]` value directly:" -msgstr "" - -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "A reference has a _lifetime_, which must not \"outlive\" the value it refers " "to. This is verified by the borrow checker." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "The lifetime can be implicit - this is what we have seen so far. Lifetimes " "can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " @@ -9211,56 +8592,56 @@ msgid "" "`Point` which is valid for at least the lifetime `a`\"." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes are always inferred by the compiler: you cannot assign a lifetime " "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes become more complicated when considering passing values to and " "returning values from functions." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "\"p3: {p3:?}\"" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" -"In this example, the the compiler does not know what lifetime to infer for " -"`p3`. Looking inside the function body shows that it can only safely assume " -"that `p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, " -"Rust requires explicit annotations of lifetimes on function arguments and " -"return values." +"In this example, the compiler does not know what lifetime to infer for `p3`. " +"Looking inside the function body shows that it can only safely assume that " +"`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " +"requires explicit annotations of lifetimes on function arguments and return " +"values." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "This says, \"given p1 and p2 which both outlive `'a`, the return value lives " "for at least `'a`." msgstr "" -#: src/slices-and-lifetimes/lifetime-annotations.md +#: src/lifetimes/lifetime-annotations.md msgid "" "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" msgstr "Durées de vie dans les appels de fonction" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "Lifetimes for function arguments and return values must be fully specified, " "but Rust allows lifetimes to be elided in most cases with [a few simple " @@ -9268,44 +8649,44 @@ msgid "" "inference -- it is just a syntactic shorthand." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "If there is only one argument lifetime, it is given to all un-annotated " "return values." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "If there are multiple argument lifetimes, but the first one is for `self`, " "that lifetime is given to all un-annotated return values." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "This won't compile, demonstrating that the annotations are checked for " "validity by the compiler. Note that this is not the case for raw pointers " "(unsafe), and this is a common source of errors with unsafe Rust." msgstr "" -#: src/slices-and-lifetimes/lifetime-elision.md +#: src/lifetimes/lifetime-elision.md msgid "" "Students may ask when to use lifetimes. Rust borrows _always_ have " "lifetimes. Most of the time, elision and type inference mean these don't " @@ -9314,11 +8695,11 @@ msgid "" "just work with owned data by cloning values where necessary." msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "Durées de vie dans les structures de données" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "" "If a data type stores borrowed data, it must be annotated with a lifetime:" @@ -9326,27 +8707,27 @@ msgstr "" "Si un type de données stocke des données empruntées, il doit être annoté " "avec une durée de vie :" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "\"Bye {text}!\"" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "// erase(text);\n" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "\"{fox:?}\"" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md msgid "\"{dog:?}\"" msgstr "" -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "" "In the above example, the annotation on `Highlight` enforces that the data " @@ -9357,7 +8738,7 @@ msgstr "" "données sous-jacentes au `&str` contenu vivent au moins aussi longtemps que " "toute instance de `Highlight` qui utilise ces données." -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "" "If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " @@ -9366,7 +8747,7 @@ msgstr "" "Si `text` est consommé avant la fin de la durée de vie de `fox` (ou `dog`), " "le vérificateur d'emprunt génère une erreur." -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "" "Types with borrowed data force users to hold on to the original data. This " @@ -9377,14 +8758,14 @@ msgstr "" "les données d'origine. Cela peut être utile pour créer des vues légères, " "mais cela les rend généralement un peu plus difficiles à utiliser." -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "When possible, make data structures own their data directly." msgstr "" "Dans la mesure du possible, faites en sorte que les structures de données " "soient directement propriétaires de leurs données." -#: src/slices-and-lifetimes/struct-lifetimes.md +#: src/lifetimes/struct-lifetimes.md #, fuzzy msgid "" "Some structs with multiple references inside can have more than one lifetime " @@ -9398,7 +8779,7 @@ msgstr "" "en plus de la durée de vie de la structure elle-même. Ce sont des cas " "d'utilisation très avancés." -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" "(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " @@ -9406,7 +8787,7 @@ msgid "" "slices of data. The underlying data itself is never copied." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " "indexed by their field numbers. That is typically provided in a `proto` " @@ -9414,12 +8795,12 @@ msgid "" "statements in functions that get called for each field." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md #, fuzzy msgid "We'll use the following proto:" msgstr "Vous pouvez utiliser le fichier `Cargo.toml` suivant :" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "A proto message is encoded as a series of fields, one after the next. Each " "is implemented as a \"tag\" followed by the value. The tag contains a field " @@ -9427,7 +8808,7 @@ msgid "" "defining how the payload should be determined from the byte stream." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "Integers, including the tag, are represented with a variable-length encoding " "called VARINT. Luckily, `parse_varint` is defined for you below. The given " @@ -9435,45 +8816,45 @@ msgid "" "to parse a message into a series of calls to those callbacks." msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "What remains for you is to implement the `parse_field` function and the " "`ProtoMessage` trait for `Person` and `PhoneNumber`." msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid varint\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid wire-type\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Unexpected EOF\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid length\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Unexpected wire-type)\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "\"Invalid string (not UTF-8)\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// The Varint WireType indicates the value is a single VARINT.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "//I64, -- not needed for this exercise\n" " /// The Len WireType indicates that the value is a length represented as " @@ -9481,62 +8862,62 @@ msgid "" " /// VARINT followed by exactly that number of bytes.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// The I32 WireType indicates that the value is precisely 4 bytes in\n" " /// little-endian order containing a 32-bit signed integer.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field's value, typed based on the wire type.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//I64(i64), -- not needed for this exercise\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field, containing the field number and its value.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//1 => WireType::I64, -- not needed for this exercise\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// This is the last byte of the VARINT, so convert it to\n" " // a u64 and return it.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "// More than 7 bytes is invalid.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Convert a tag into a field number and a WireType.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Parse a field, returning the remaining bytes\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "" "\"Based on the wire type, build a Field, consuming as many bytes as " "necessary.\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" msgstr "" -#: src/slices-and-lifetimes/exercise.md src/slices-and-lifetimes/solution.md +#: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a message in the given data, calling `T::add_field` for each field " "in\n" @@ -9545,19 +8926,19 @@ msgid "" "/// The entire input is consumed.\n" msgstr "" -#: src/slices-and-lifetimes/exercise.md +#: src/lifetimes/exercise.md msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" msgstr "" -#: src/slices-and-lifetimes/solution.md +#: src/lifetimes/solution.md msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" msgstr "" -#: src/slices-and-lifetimes/solution.md +#: src/lifetimes/solution.md msgid "// skip everything else\n" msgstr "" -#: src/slices-and-lifetimes/solution.md +#: src/lifetimes/solution.md msgid "b\"hello\"" msgstr "" @@ -9596,39 +8977,6 @@ msgid "" "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "" -#: src/welcome-day-4.md -msgid "[Welcome](./welcome-day-4.md) (3 minutes)" -msgstr "" - -#: src/welcome-day-4.md -msgid "[Iterators](./iterators.md) (45 minutes)" -msgstr "" - -#: src/welcome-day-4.md -msgid "[Modules](./modules.md) (40 minutes)" -msgstr "" - -#: src/welcome-day-4.md -msgid "[Testing](./testing.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "[Iterator](./iterators/iterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "[IntoIterator](./iterators/intoiterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "[FromIterator](./iterators/fromiterator.md) (5 minutes)" -msgstr "" - -#: src/iterators.md -msgid "" -"[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" -msgstr "" - #: src/iterators/iterator.md msgid "" "The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " @@ -9820,31 +9168,6 @@ msgid "" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -#: src/modules.md -msgid "[Modules](./modules/modules.md) (5 minutes)" -msgstr "" - -#: src/modules.md -msgid "[Filesystem Hierarchy](./modules/filesystem.md) (5 minutes)" -msgstr "" - -#: src/modules.md -msgid "[Visibility](./modules/visibility.md) (5 minutes)" -msgstr "" - -#: src/modules.md -msgid "[use, super, self](./modules/paths.md) (10 minutes)" -msgstr "" - -#: src/modules.md -msgid "" -"[Exercise: Modules for a GUI Library](./modules/exercise.md) (15 minutes)" -msgstr "" - -#: src/modules.md -msgid "This segment should take about 40 minutes" -msgstr "" - #: src/modules/modules.md #, fuzzy msgid "We have seen how `impl` blocks let us namespace functions to a type." @@ -10326,34 +9649,6 @@ msgstr "" msgid "// ---- src/main.rs ----\n" msgstr "" -#: src/testing.md -msgid "[Test Modules](./testing/unit-tests.md) (5 minutes)" -msgstr "" - -#: src/testing.md -msgid "[Other Types of Tests](./testing/other.md) (10 minutes)" -msgstr "" - -#: src/testing.md -msgid "[Useful Crates](./testing/useful-crates.md) (3 minutes)" -msgstr "" - -#: src/testing.md -msgid "[GoogleTest](./testing/googletest.md) (5 minutes)" -msgstr "" - -#: src/testing.md -msgid "[Mocking](./testing/mocking.md) (5 minutes)" -msgstr "" - -#: src/testing.md -msgid "[Compiler Lints and Clippy](./testing/lints.md) (5 minutes)" -msgstr "" - -#: src/testing.md -msgid "[Exercise: Luhn Algorithm](./testing/exercise.md) (30 minutes)" -msgstr "" - #: src/testing/unit-tests.md msgid "Unit Tests" msgstr "Tests unitaires" @@ -10473,218 +9768,61 @@ msgstr "" "Testez le code ci-dessus sur [Rust Playground](https://play.rust-lang.org/?" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." -#: src/testing/useful-crates.md -#, fuzzy -msgid "Rust comes with only basic support for writing tests." -msgstr "Rust a un support intégré pour les tests de documentation :" - -#: src/testing/useful-crates.md -msgid "Here are some additional crates which we recommend for writing tests:" -msgstr "" - -#: src/testing/useful-crates.md +#: src/testing/lints.md msgid "" -"[googletest](https://docs.rs/googletest): Comprehensive test assertion " -"library in the tradition of GoogleTest for C++." +"The Rust compiler produces fantastic error messages, as well as helpful " +"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " +"more lints, organized into groups that can be enabled per-project." msgstr "" -#: src/testing/useful-crates.md -msgid "[proptest](https://docs.rs/proptest): Property-based testing for Rust." +#: src/testing/lints.md +msgid "\"X probably fits in a u16, right? {}\"" msgstr "" -#: src/testing/useful-crates.md +#: src/testing/lints.md msgid "" -"[rstest](https://docs.rs/rstest): Support for fixtures and parameterised " -"tests." +"Run the code sample and examine the error message. There are also lints " +"visible here, but those will not be shown once the code compiles. Switch to " +"the Playground site to show those lints." msgstr "" -#: src/testing/googletest.md +#: src/testing/lints.md msgid "" -"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " -"assertions using _matchers_:" +"After resolving the lints, run `clippy` on the playground site to show " +"clippy warnings. Clippy has extensive documentation of its lints, and adds " +"new lints (including default-deny lints) all the time." msgstr "" -#: src/testing/googletest.md -msgid "\"baz\"" +#: src/testing/lints.md +msgid "" +"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " +"or via your editor." msgstr "" -#: src/testing/googletest.md -msgid "\"xyz\"" -msgstr "" +#: src/testing/exercise.md +msgid "Luhn Algorithm" +msgstr "Algorithme de Luhn" -#: src/testing/googletest.md +#: src/testing/exercise.md +#, fuzzy msgid "" -"If we change the last element to `\"!\"`, the test fails with a structured " -"error message pin-pointing the error:" +"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " +"to validate credit card numbers. The algorithm takes a string as input and " +"does the following to validate the credit card number:" msgstr "" +"L'[algorithme de Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) est " +"utilisé pour valider les numéros de carte de crédit. L'algorithme prend une " +"chaîne en entrée et fait le suivant pour valider le numéro de carte " +"bancaire :" -#: src/testing/googletest.md -msgid "" -"GoogleTest is not part of the Rust Playground, so you need to run this " -"example in a local environment. Use `cargo add googletest` to quickly add it " -"to an existing Cargo project." +#: src/testing/exercise.md +#, fuzzy +msgid "Ignore all spaces. Reject number with fewer than two digits." msgstr "" +"Ignorer tous les espaces. Numéro de rejet comportant moins de deux chiffres." -#: src/testing/googletest.md -msgid "" -"The `use googletest::prelude::*;` line imports a number of [commonly used " -"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." -"html)." -msgstr "" - -#: src/testing/googletest.md -msgid "This just scratches the surface, there are many builtin matchers." -msgstr "" - -#: src/testing/googletest.md -msgid "" -"A particularly nice feature is that mismatches in multi-line strings strings " -"are shown as a diff:" -msgstr "" - -#: src/testing/googletest.md -msgid "" -"\"Memory safety found,\\n\\\n" -" Rust's strong typing guides the way,\\n\\\n" -" Secure code you'll write.\"" -msgstr "" - -#: src/testing/googletest.md -msgid "" -"\"Memory safety found,\\n\\\n" -" Rust's silly humor guides the way,\\n\\\n" -" Secure code you'll write.\"" -msgstr "" - -#: src/testing/googletest.md -msgid "shows a color-coded diff (colors not shown here):" -msgstr "" - -#: src/testing/googletest.md -msgid "" -"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" -"googletest/)." -msgstr "" - -#: src/testing/googletest.md -msgid "GoogleTest is available for use in AOSP." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " -"You need to refactor your code to use traits, which you can then quickly " -"mock:" -msgstr "" - -#: src/testing/mocking.md -msgid "" -"The advice here is for Android (AOSP) where Mockall is the recommended " -"mocking library. There are other [mocking libraries available on crates.io]" -"(https://crates.io/keywords/mock), in particular in the area of mocking HTTP " -"services. The other mocking libraries work in a similar fashion as Mockall, " -"meaning that they make it easy to get a mock implementation of a given trait." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"Note that mocking is somewhat _controversial_: mocks allow you to completely " -"isolate a test from its dependencies. The immediate result is faster and " -"more stable test execution. On the other hand, the mocks can be configured " -"wrongly and return output different from what the real dependencies would do." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"If at all possible, it is recommended that you use the real dependencies. As " -"an example, many databases allow you to configure an in-memory backend. This " -"means that you get the correct behavior in your tests, plus they are fast " -"and will automatically clean up after themselves." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"Similarly, many web frameworks allow you to start an in-process server which " -"binds to a random port on `localhost`. Always prefer this over mocking away " -"the framework since it helps you test your code in the real environment." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"Mockall is not part of the Rust Playground, so you need to run this example " -"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " -"existing Cargo project." -msgstr "" - -#: src/testing/mocking.md -msgid "" -"Mockall has a lot more functionality. In particular, you can set up " -"expectations which depend on the arguments passed. Here we use this to mock " -"a cat which becomes hungry 3 hours after the last time it was fed:" -msgstr "" - -#: src/testing/mocking.md -msgid "" -"You can use `.times(n)` to limit the number of times a mock method can be " -"called to `n` --- the mock will automatically panic when dropped if this " -"isn't satisfied." -msgstr "" - -#: src/testing/lints.md -msgid "" -"The Rust compiler produces fantastic error messages, as well as helpful " -"built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " -"more lints, organized into groups that can be enabled per-project." -msgstr "" - -#: src/testing/lints.md -msgid "\"X probably fits in a u16, right? {}\"" -msgstr "" - -#: src/testing/lints.md -msgid "" -"Run the code sample and examine the error message. There are also lints " -"visible here, but those will not be shown once the code compiles. Switch to " -"the Playground site to show those lints." -msgstr "" - -#: src/testing/lints.md -msgid "" -"After resolving the lints, run `clippy` on the playground site to show " -"clippy warnings. Clippy has extensive documentation of its lints, and adds " -"new lints (including default-deny lints) all the time." -msgstr "" - -#: src/testing/lints.md -msgid "" -"Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " -"or via your editor." -msgstr "" - -#: src/testing/exercise.md -msgid "Luhn Algorithm" -msgstr "Algorithme de Luhn" - -#: src/testing/exercise.md -#, fuzzy -msgid "" -"The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " -"to validate credit card numbers. The algorithm takes a string as input and " -"does the following to validate the credit card number:" -msgstr "" -"L'[algorithme de Luhn](https://en.wikipedia.org/wiki/Luhn_algorithm) est " -"utilisé pour valider les numéros de carte de crédit. L'algorithme prend une " -"chaîne en entrée et fait le suivant pour valider le numéro de carte " -"bancaire :" - -#: src/testing/exercise.md -#, fuzzy -msgid "Ignore all spaces. Reject number with less than two digits." -msgstr "" -"Ignorer tous les espaces. Numéro de rejet comportant moins de deux chiffres." - -#: src/testing/exercise.md -#, fuzzy +#: src/testing/exercise.md +#, fuzzy msgid "" "Moving from **right to left**, double every second digit: for the number " "`1234`, we double `3` and `1`. For the number `98765`, we double `6` and `8`." @@ -10801,44 +9939,6 @@ msgstr "" msgid "\" 0 0 \"" msgstr "" -#: src/welcome-day-4-afternoon.md -msgid "[Error Handling](./error-handling.md) (45 minutes)" -msgstr "" - -#: src/welcome-day-4-afternoon.md -msgid "[Unsafe Rust](./unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "" - -#: src/welcome-day-4-afternoon.md -msgid "Including 10 minute breaks, this session should take about 2 hours" -msgstr "" - -#: src/error-handling.md -msgid "[Panics](./error-handling/panics.md) (3 minutes)" -msgstr "" - -#: src/error-handling.md -msgid "[Try Operator](./error-handling/try.md) (5 minutes)" -msgstr "" - -#: src/error-handling.md -msgid "[Try Conversions](./error-handling/try-conversions.md) (5 minutes)" -msgstr "" - -#: src/error-handling.md -msgid "[Error Trait](./error-handling/error.md) (5 minutes)" -msgstr "" - -#: src/error-handling.md -msgid "" -"[thiserror and anyhow](./error-handling/thiserror-and-anyhow.md) (5 minutes)" -msgstr "" - -#: src/error-handling.md -msgid "" -"[Exercise: Rewriting with Result](./error-handling/exercise.md) (20 minutes)" -msgstr "" - #: src/error-handling/panics.md msgid "Rust handles fatal errors with a \"panic\"." msgstr "" @@ -10986,7 +10086,7 @@ msgstr "" #: src/error-handling/try.md msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" -"process:Termination`. In practice, this means that `E` implements `Debug`. " +"process::Termination`. In practice, this means that `E` implements `Debug`. " "The executable will print the `Err` variant and return a nonzero exit status " "on error." msgstr "" @@ -11270,10 +10370,6 @@ msgstr "" msgid "/// A binary operation.\n" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'z'" -msgstr "" - #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'_'" msgstr "" @@ -11330,35 +10426,6 @@ msgstr "" msgid "\"Invalid number\"" msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe](./unsafe-rust/unsafe.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "" -"[Dereferencing Raw Pointers](./unsafe-rust/dereferencing.md) (10 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Mutable Static Variables](./unsafe-rust/mutable-static.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unions](./unsafe-rust/unions.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unsafe Functions](./unsafe-rust/unsafe-functions.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Unsafe Traits](./unsafe-rust/unsafe-traits.md) (5 minutes)" -msgstr "" - -#: src/unsafe-rust.md -msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" -msgstr "" - #: src/unsafe-rust/unsafe.md #, fuzzy msgid "The Rust language has two parts:" @@ -11676,7 +10743,6 @@ msgstr "" #: src/android/interoperability/cpp/cpp-bridge.md #: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"C\"" msgstr "" @@ -12484,7 +11550,8 @@ msgstr "" msgid "\"greetings\"" msgstr "" -#: src/android/build-rules/library.md src/android/aidl/implementation.md +#: src/android/build-rules/library.md +#: src/android/aidl/example-service/service.md src/android/testing.md #: src/android/interoperability/java.md #, fuzzy msgid "\"src/lib.rs\"" @@ -12541,17 +11608,25 @@ msgstr "Le code Rust peut appeler des serveurs AIDL existants," msgid "You can create new AIDL servers in Rust." msgstr "Vous pouvez créer de nouveaux serveurs AIDL dans Rust." -#: src/android/aidl/interface.md +#: src/android/aidl/birthday-service.md +msgid "" +"To illustrate how to use Rust with Binder, we're going to walk through the " +"process of creating a Binder interface. We're then going to both implement " +"the described service and write client code that talks to that service." +msgstr "" + +#: src/android/aidl/example-service/interface.md #, fuzzy msgid "AIDL Interfaces" msgstr "Interfaces AIDL" -#: src/android/aidl/interface.md +#: src/android/aidl/example-service/interface.md #, fuzzy msgid "You declare the API of your service using an AIDL interface:" msgstr "Vous déclarez l'API de votre service à l'aide d'une interface AIDL :" -#: src/android/aidl/interface.md +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md #, fuzzy msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" @@ -12559,234 +11634,915 @@ msgstr "" "_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." "aidl_ :" -#: src/android/aidl/interface.md src/android/aidl/changing.md +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/example-service/changing-definition.md msgid "/** Birthday service interface. */" msgstr "" -#: src/android/aidl/interface.md src/android/aidl/changing.md +#: src/android/aidl/example-service/interface.md +#: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/example-service/changing-definition.md msgid "/** Generate a Happy Birthday message. */" msgstr "" -#: src/android/aidl/interface.md +#: src/android/aidl/example-service/interface.md #, fuzzy msgid "_birthday_service/aidl/Android.bp_:" msgstr "_service_anniversaire/aidl/Android.bp_ :" -#: src/android/aidl/interface.md +#: src/android/aidl/example-service/interface.md msgid "\"com.example.birthdayservice\"" msgstr "" -#: src/android/aidl/interface.md +#: src/android/aidl/example-service/interface.md #, fuzzy msgid "\"com/example/birthdayservice/*.aidl\"" msgstr "" -"_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." -"aidl_ :" +"_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." +"aidl_ :" + +#: src/android/aidl/example-service/interface.md +msgid "// Rust is not enabled by default\n" +msgstr "" + +#: src/android/aidl/example-service/interface.md +msgid "" +"Note that the directory structure under the `aidl/` directory needs to match " +"the package name used in the AIDL file, i.e. the package is `com.example." +"birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +msgid "Generated Service API" +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +msgid "" +"Binder generates a trait corresponding to the interface definition. trait to " +"talk to the service." +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +#, fuzzy +msgid "_Generated trait_:" +msgstr "Rust non sécurisé (_unsafe_)" + +#: src/android/aidl/example-service/service-bindings.md +msgid "" +"Your service will need to implement this trait, and your client will use " +"this trait to talk to the service." +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +msgid "" +"The generated bindings can be found at `out/soong/.intermediates//`." +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +msgid "" +"Point out how the generated function signature, specifically the argument " +"and return types, correspond the interface definition." +msgstr "" + +#: src/android/aidl/example-service/service-bindings.md +msgid "" +"`String` for an argument results in a different Rust type than `String` as a " +"return type." +msgstr "" + +#: src/android/aidl/example-service/service.md +#, fuzzy +msgid "Service Implementation" +msgstr "Mise en œuvre des services" + +#: src/android/aidl/example-service/service.md +#, fuzzy +msgid "We can now implement the AIDL service:" +msgstr "Nous pouvons maintenant implémenter le service AIDL :" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/changing-implementation.md +#, fuzzy +msgid "_birthday_service/src/lib.rs_:" +msgstr "_service_anniversaire/src/lib.rs_ :" + +#: src/android/aidl/example-service/service.md +#, fuzzy +msgid "/// The `IBirthdayService` implementation.\n" +msgstr "Mise en œuvre des services" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/file-descriptor.md +msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" +msgstr "" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "_birthday_service/Android.bp_:" +msgstr "_service_anniversaire/Android.bp_ :" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "\"libbirthdayservice\"" +msgstr "_service_anniversaire/src/lib.rs_ :" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "\"birthdayservice\"" +msgstr "_service_anniversaire/src/lib.rs_ :" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md +msgid "\"com.example.birthdayservice-rust\"" +msgstr "" + +#: src/android/aidl/example-service/service.md +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md +msgid "\"libbinder_rs\"" +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"Point out the path to the generated `IBirthdayService` trait, and explain " +"why each of the segments is necessary." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"TODO: What does the `binder::Interface` trait do? Are there methods to " +"override? Where source?" +msgstr "" + +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "AIDL Server" +msgstr "Serveur AIDL" + +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "Finally, we can create a server which exposes the service:" +msgstr "Enfin, nous pouvons créer un serveur qui expose le service :" + +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "_birthday_service/src/server.rs_:" +msgstr "_service_anniversaire/src/server.rs_ :" + +#: src/android/aidl/example-service/server.md +msgid "//! Birthday service.\n" +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "/// Entry point for birthday service.\n" +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "\"Failed to register service\"" +msgstr "" + +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "\"birthday_server\"" +msgstr "_service_anniversaire/src/lib.rs_ :" + +#: src/android/aidl/example-service/server.md +#, fuzzy +msgid "\"src/server.rs\"" +msgstr "`src/main.rs` :" + +#: src/android/aidl/example-service/server.md +#: src/android/aidl/example-service/client.md +msgid "// To avoid dynamic link error.\n" +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "" +"The process for taking a user-defined service implementation (in this case " +"the `BirthdayService` type, which implements the `IBirthdayService`) and " +"starting it as a Binder service has multiple steps, and may appear more " +"complicated than students are used to if they've used Binder from C++ or " +"another language. Explain to students why each step is necessary." +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "Create an instance of your service type (`BirthdayService`)." +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "" +"Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " +"this case). This type is generated by Binder and provides the common Binder " +"functionality that would be provided by the `BnBinder` base class in C++. We " +"don't have inheritance in Rust, so instead we use composition, putting our " +"`BirthdayService` within the generated `BnBinderService`." +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "" +"Call `add_service`, giving it a service identifier and your service object " +"(the `BnBirthdayService` object in the example)." +msgstr "" + +#: src/android/aidl/example-service/server.md +msgid "" +"Call `join_thread_pool` to add the current thread to Binder's thread pool " +"and start listening for connections." +msgstr "" + +#: src/android/aidl/example-service/deploy.md +#, fuzzy +msgid "We can now build, push, and start the service:" +msgstr "Nous pouvons maintenant créer, pousser et démarrer le service :" + +#: src/android/aidl/example-service/deploy.md +msgid "" +"```shell\n" +"m birthday_server\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" +"tmp\n" +"adb root\n" +"adb shell /data/local/tmp/birthday_server\n" +"```" +msgstr "" + +#: src/android/aidl/example-service/deploy.md +#, fuzzy +msgid "In another terminal, check that the service runs:" +msgstr "Dans un autre terminal, vérifiez que le service s'exécute :" + +#: src/android/aidl/example-service/deploy.md +#, fuzzy +msgid "You can also call the service with `service call`:" +msgstr "Vous pouvez également appeler le service avec `service call` :" + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "AIDL Client" +msgstr "Client AIDL" + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "Finally, we can create a Rust client for our new service." +msgstr "Enfin, nous pouvons créer un client Rust pour notre nouveau service." + +#: src/android/aidl/example-service/client.md +#: src/android/aidl/example-service/changing-implementation.md +#, fuzzy +msgid "_birthday_service/src/client.rs_:" +msgstr "_service_anniversaire/src/client.rs_ :" + +#: src/android/aidl/example-service/client.md +msgid "/// Call the birthday service.\n" +msgstr "" + +#: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md +#: src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md +msgid "\"Failed to connect to BirthdayService\"" +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "// Call the service.\n" +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "\"{msg}\"" +msgstr "" + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "\"birthday_client\"" +msgstr "_service_anniversaire/src/client.rs_ :" + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "\"src/client.rs\"" +msgstr "`src/main.rs` :" + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "Notice that the client does not depend on `libbirthdayservice`." +msgstr "Notez que le client ne dépend pas de `libbirthdayservice`." + +#: src/android/aidl/example-service/client.md +#, fuzzy +msgid "Build, push, and run the client on your device:" +msgstr "Créez, transférez et exécutez le client sur votre appareil :" + +#: src/android/aidl/example-service/client.md +msgid "" +"```shell\n" +"m birthday_client\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" +"tmp\n" +"adb shell /data/local/tmp/birthday_client Charlie 60\n" +"```" +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "" +"`Strong` is the trait object representing the service " +"that the client has connected to." +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "" +"`Strong` is a custom smart pointer type for Binder. It handles both an in-" +"process ref count for the service trait object, and the global Binder ref " +"count that tracks how many processes have a reference to the object." +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "" +"Note that the trait object that the client uses to talk to the service uses " +"the exact same trait that the server implements. For a given Binder " +"interface, there is a single Rust trait generated that both client and " +"server use." +msgstr "" + +#: src/android/aidl/example-service/client.md +msgid "" +"Use the same service identifier used when registering the service. This " +"should ideally be defined in a common crate that both the client and server " +"can depend on." +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md +#, fuzzy +msgid "" +"Let us extend the API with more functionality: we want to let clients " +"specify a list of lines for the birthday card:" +msgstr "" +"Étendons l'API avec plus de fonctionnalités : nous voulons laisser les " +"clients spécifier un liste des lignes pour la carte d'anniversaire :" + +#: src/android/aidl/example-service/changing-definition.md +msgid "This results in an updated trait definition for `IBirthdayService`:" +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md +msgid "" +"Note how the `String[]` in the AIDL definition is translated as a " +"`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " +"generated bindings wherever possible:" +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md +msgid "`in` array arguments are translated to slices." +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md +msgid "`out` and `inout` args are translated to `&mut Vec`." +msgstr "" + +#: src/android/aidl/example-service/changing-definition.md +msgid "Return values are translated to returning a `Vec`." +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "Updating Client and Service" +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "Update the client and server code to account for the new API." +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "'\\n'" +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "\"Habby birfday to yuuuuu\"" +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "\"And also: many more\"" +msgstr "" + +#: src/android/aidl/example-service/changing-implementation.md +msgid "" +"TODO: Move code snippets into project files where they'll actually be built?" +msgstr "" + +#: src/android/aidl/types.md +msgid "Working With AIDL Types" +msgstr "" + +#: src/android/aidl/types.md +msgid "AIDL types translate into the appropriate idiomatic Rust type:" +msgstr "" + +#: src/android/aidl/types.md +msgid "Primitive types map (mostly) to idiomatic Rust types." +msgstr "" + +#: src/android/aidl/types.md +msgid "Collection types like slices, `Vec`s and string types are supported." +msgstr "" + +#: src/android/aidl/types.md +msgid "" +"References to AIDL objects and file handles can be sent between clients and " +"services." +msgstr "" + +#: src/android/aidl/types.md +msgid "File handles and parcelables are fully supported." +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "Primitive types map (mostly) idiomatically:" +msgstr "" + +#: src/android/aidl/types/primitives.md +#, fuzzy +msgid "AIDL Type" +msgstr "AIDL" + +#: src/android/aidl/types/primitives.md src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md +#, fuzzy +msgid "Rust Type" +msgstr "Rust by Example" + +#: src/android/aidl/types/primitives.md +msgid "Note" +msgstr "" + +#: src/android/aidl/types/primitives.md +#, fuzzy +msgid "`boolean`" +msgstr "`&[u8]`" + +#: src/android/aidl/types/primitives.md +msgid "`byte`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`i8`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "Note that bytes are signed." +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`u16`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "Note the usage of `u16`, NOT `u32`." +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`int`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`i32`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`long`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`i64`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`float`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`f32`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`double`" +msgstr "" + +#: src/android/aidl/types/primitives.md +msgid "`f64`" +msgstr "" + +#: src/android/aidl/types/arrays.md +msgid "" +"The array types (`T[]`, `byte[]`, and `List`) get translated to the " +"appropriate Rust array type depending on how they are used in the function " +"signature:" +msgstr "" + +#: src/android/aidl/types/arrays.md +#, fuzzy +msgid "Position" +msgstr "Descriptif" + +#: src/android/aidl/types/arrays.md +msgid "`in` argument" +msgstr "" + +#: src/android/aidl/types/arrays.md +#, fuzzy +msgid "`&[T]`" +msgstr "Tranches" + +#: src/android/aidl/types/arrays.md +msgid "`out`/`inout` argument" +msgstr "" + +#: src/android/aidl/types/arrays.md +#, fuzzy +msgid "`&mut Vec`" +msgstr "`Vec`" + +#: src/android/aidl/types/arrays.md +msgid "Return" +msgstr "" + +#: src/android/aidl/types/arrays.md +#: src/android/interoperability/cpp/type-mapping.md +#, fuzzy +msgid "`Vec`" +msgstr "`Vec`" + +#: src/android/aidl/types/arrays.md +msgid "" +"In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " +"becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " +"int\\[3\\]\\[4\\]). In the Java backend, fixed-size arrays are represented " +"as array types." +msgstr "" + +#: src/android/aidl/types/arrays.md +msgid "Arrays in parcelable fields always get translated to `Vec`." +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "" +"AIDL objects can be sent either as a concrete AIDL type or as the type-" +"erased `IBinder` interface:" +msgstr "" + +#: src/android/aidl/types/objects.md +#, fuzzy +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl**:" +msgstr "" +"_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." +"aidl_ :" + +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md +#, fuzzy +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +msgstr "" +"_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." +"aidl_ :" + +#: src/android/aidl/types/objects.md +msgid "/** The same thing, but using a binder object. */" +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "/** The same thing, but using `IBinder`. */" +msgstr "" + +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md +#, fuzzy +msgid "**birthday_service/src/client.rs**:" +msgstr "_service_anniversaire/src/client.rs_ :" + +#: src/android/aidl/types/objects.md +msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "// Send the binder object to the service.\n" +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "" +"// Perform the same operation but passing the provider as an `SpIBinder`.\n" +msgstr "" + +#: src/android/aidl/types/objects.md +msgid "" +"Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " +"`BnBirthdayService` that we saw previously." +msgstr "" + +#: src/android/aidl/types/parcelables.md +msgid "Binder for Rust supports sending parcelables directly:" +msgstr "" + +#: src/android/aidl/types/parcelables.md +#, fuzzy +msgid "" +"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgstr "" +"_service_anniversaire/aidl/com/exemple/serviceanniversaire/IBirthdayService." +"aidl_ :" + +#: src/android/aidl/types/parcelables.md +msgid "/** The same thing, but with a parcelable. */" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "" +"Files can be sent between Binder clients/servers using the " +"`ParcelFileDescriptor` type:" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "/** The same thing, but loads info from a file. */" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "// Open a file and put the birthday info in it.\n" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "\"/data/local/tmp/birthday.info\"" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "\"{name}\"" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "\"{years}\"" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +#, fuzzy +msgid "**birthday_service/src/lib.rs**:" +msgstr "_service_anniversaire/src/lib.rs_ :" + +#: src/android/aidl/types/file-descriptor.md +msgid "" +"// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" +" // an `OwnedFd`, which can be cloned and then used to create a " +"`File`\n" +" // object.\n" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "\"Invalid file handle\"" +msgstr "" + +#: src/android/aidl/types/file-descriptor.md +msgid "" +"`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " +"`File` (or any other type that wraps an `OwnedFd`), and can be used to " +"create a new `File` handle on the other side." +msgstr "" -#: src/android/aidl/interface.md -msgid "// Rust is not enabled by default\n" +#: src/android/aidl/types/file-descriptor.md +msgid "" +"Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " +"UNIX sockets." msgstr "" -#: src/android/aidl/interface.md +#: src/android/testing.md #, fuzzy +msgid "Testing in Android" +msgstr "Rust pour Android" + +#: src/android/testing.md msgid "" -"Add `vendor_available: true` if your AIDL file is used by a binary in the " -"vendor partition." +"Building on [Testing](../testing.md), we will now look at how unit tests " +"work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" -"Ajoutez `vendor_available : true` si votre fichier AIDL est utilisé par un " -"binaire dans le fournisseur cloison." -#: src/android/aidl/implementation.md +#: src/android/testing.md #, fuzzy -msgid "Service Implementation" -msgstr "Mise en œuvre des services" +msgid "_testing/Android.bp_:" +msgstr "_hello_rust/Android.bp_ :" -#: src/android/aidl/implementation.md -#, fuzzy -msgid "We can now implement the AIDL service:" -msgstr "Nous pouvons maintenant implémenter le service AIDL :" +#: src/android/testing.md +msgid "\"libleftpad\"" +msgstr "" -#: src/android/aidl/implementation.md -#, fuzzy -msgid "_birthday_service/src/lib.rs_:" -msgstr "_service_anniversaire/src/lib.rs_ :" +#: src/android/testing.md +msgid "\"leftpad\"" +msgstr "" -#: src/android/aidl/implementation.md -msgid "//! Implementation of the `IBirthdayService` AIDL interface.\n" +#: src/android/testing.md +msgid "\"libleftpad_test\"" msgstr "" -#: src/android/aidl/implementation.md -#, fuzzy -msgid "/// The `IBirthdayService` implementation.\n" -msgstr "Mise en œuvre des services" +#: src/android/testing.md +msgid "\"leftpad_test\"" +msgstr "" -#: src/android/aidl/implementation.md -msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" +#: src/android/testing.md src/android/interoperability/with-c/bindgen.md +msgid "\"general-tests\"" msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md +#: src/android/testing.md #, fuzzy -msgid "_birthday_service/Android.bp_:" -msgstr "_service_anniversaire/Android.bp_ :" +msgid "_testing/src/lib.rs_:" +msgstr "_hello_rust/src/lib.rs_ :" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#, fuzzy -msgid "\"libbirthdayservice\"" -msgstr "_service_anniversaire/src/lib.rs_ :" +#: src/android/testing.md +msgid "//! Left-padding library.\n" +msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -#, fuzzy -msgid "\"birthdayservice\"" -msgstr "_service_anniversaire/src/lib.rs_ :" +#: src/android/testing.md +msgid "/// Left-pad `s` to `width`.\n" +msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "\"com.example.birthdayservice-rust\"" +#: src/android/testing.md +msgid "\"{s:>width$}\"" msgstr "" -#: src/android/aidl/implementation.md src/android/aidl/server.md -#: src/android/aidl/client.md -msgid "\"libbinder_rs\"" +#: src/android/testing.md +msgid "\" foo\"" msgstr "" -#: src/android/aidl/server.md -#, fuzzy -msgid "AIDL Server" -msgstr "Serveur AIDL" +#: src/android/testing.md +msgid "\"foobar\"" +msgstr "" -#: src/android/aidl/server.md +#: src/android/testing.md #, fuzzy -msgid "Finally, we can create a server which exposes the service:" -msgstr "Enfin, nous pouvons créer un serveur qui expose le service :" +msgid "You can now run the test with" +msgstr "Vous pouvez maintenant générer automatiquement les liaisons :" -#: src/android/aidl/server.md +#: src/android/testing.md #, fuzzy -msgid "_birthday_service/src/server.rs_:" -msgstr "_service_anniversaire/src/server.rs_ :" +msgid "The output looks like this:" +msgstr "L'approche globale ressemble à ceci:" -#: src/android/aidl/server.md src/android/aidl/client.md -msgid "//! Birthday service.\n" +#: src/android/testing.md +msgid "" +"```text\n" +"INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" +"INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" +"INFO: Build completed successfully, 3 total actions\n" +"//comprehensive-rust-android/testing:libleftpad_test_host PASSED " +"in 2.3s\n" +" PASSED libleftpad_test.tests::long_string (0.0s)\n" +" PASSED libleftpad_test.tests::short_string (0.0s)\n" +"Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" +"```" msgstr "" -#: src/android/aidl/server.md -msgid "/// Entry point for birthday service.\n" +#: src/android/testing.md +msgid "" +"Notice how you only mention the root of the library crate. Tests are found " +"recursively in nested modules." msgstr "" -#: src/android/aidl/server.md -msgid "\"Failed to register service\"" +#: src/android/testing/googletest.md +msgid "" +"The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " +"assertions using _matchers_:" msgstr "" -#: src/android/aidl/server.md -#, fuzzy -msgid "\"birthday_server\"" -msgstr "_service_anniversaire/src/lib.rs_ :" - -#: src/android/aidl/server.md -#, fuzzy -msgid "\"src/server.rs\"" -msgstr "`src/main.rs` :" +#: src/android/testing/googletest.md +msgid "\"baz\"" +msgstr "" -#: src/android/aidl/server.md src/android/aidl/client.md -msgid "// To avoid dynamic link error.\n" +#: src/android/testing/googletest.md +msgid "\"xyz\"" msgstr "" -#: src/android/aidl/deploy.md -#, fuzzy -msgid "We can now build, push, and start the service:" -msgstr "Nous pouvons maintenant créer, pousser et démarrer le service :" +#: src/android/testing/googletest.md +msgid "" +"If we change the last element to `\"!\"`, the test fails with a structured " +"error message pin-pointing the error:" +msgstr "" -#: src/android/aidl/deploy.md +#: src/android/testing/googletest.md msgid "" -"```shell\n" -"m birthday_server\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" -"tmp\n" -"adb root\n" -"adb shell /data/local/tmp/birthday_server\n" -"```" +"GoogleTest is not part of the Rust Playground, so you need to run this " +"example in a local environment. Use `cargo add googletest` to quickly add it " +"to an existing Cargo project." msgstr "" -#: src/android/aidl/deploy.md -#, fuzzy -msgid "In another terminal, check that the service runs:" -msgstr "Dans un autre terminal, vérifiez que le service s'exécute :" +#: src/android/testing/googletest.md +msgid "" +"The `use googletest::prelude::*;` line imports a number of [commonly used " +"macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." +"html)." +msgstr "" -#: src/android/aidl/deploy.md -#, fuzzy -msgid "You can also call the service with `service call`:" -msgstr "Vous pouvez également appeler le service avec `service call` :" +#: src/android/testing/googletest.md +msgid "This just scratches the surface, there are many builtin matchers." +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "AIDL Client" -msgstr "Client AIDL" +#: src/android/testing/googletest.md +msgid "" +"A particularly nice feature is that mismatches in multi-line strings are " +"shown as a diff:" +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "Finally, we can create a Rust client for our new service." -msgstr "Enfin, nous pouvons créer un client Rust pour notre nouveau service." +#: src/android/testing/googletest.md +msgid "" +"\"Memory safety found,\\n\\\n" +" Rust's strong typing guides the way,\\n\\\n" +" Secure code you'll write.\"" +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "_birthday_service/src/client.rs_:" -msgstr "_service_anniversaire/src/client.rs_ :" +#: src/android/testing/googletest.md +msgid "" +"\"Memory safety found,\\n\\\n" +" Rust's silly humor guides the way,\\n\\\n" +" Secure code you'll write.\"" +msgstr "" -#: src/android/aidl/client.md -msgid "/// Connect to the BirthdayService.\n" +#: src/android/testing/googletest.md +msgid "shows a color-coded diff (colors not shown here):" msgstr "" -#: src/android/aidl/client.md -msgid "/// Call the birthday service.\n" +#: src/android/testing/googletest.md +msgid "" +"The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" +"googletest/)." msgstr "" -#: src/android/aidl/client.md -msgid "\"Failed to connect to BirthdayService\"" +#: src/android/testing/mocking.md +msgid "" +"For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " +"You need to refactor your code to use traits, which you can then quickly " +"mock:" msgstr "" -#: src/android/aidl/client.md -msgid "\"{msg}\"" +#: src/android/testing/mocking.md +msgid "" +"Mockall is the recommended mocking library in Android (AOSP). There are " +"other [mocking libraries available on crates.io](https://crates.io/keywords/" +"mock), in particular in the area of mocking HTTP services. The other mocking " +"libraries work in a similar fashion as Mockall, meaning that they make it " +"easy to get a mock implementation of a given trait." msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "\"birthday_client\"" -msgstr "_service_anniversaire/src/client.rs_ :" +#: src/android/testing/mocking.md +msgid "" +"Note that mocking is somewhat _controversial_: mocks allow you to completely " +"isolate a test from its dependencies. The immediate result is faster and " +"more stable test execution. On the other hand, the mocks can be configured " +"wrongly and return output different from what the real dependencies would do." +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "\"src/client.rs\"" -msgstr "`src/main.rs` :" +#: src/android/testing/mocking.md +msgid "" +"If at all possible, it is recommended that you use the real dependencies. As " +"an example, many databases allow you to configure an in-memory backend. This " +"means that you get the correct behavior in your tests, plus they are fast " +"and will automatically clean up after themselves." +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "Notice that the client does not depend on `libbirthdayservice`." -msgstr "Notez que le client ne dépend pas de `libbirthdayservice`." +#: src/android/testing/mocking.md +msgid "" +"Similarly, many web frameworks allow you to start an in-process server which " +"binds to a random port on `localhost`. Always prefer this over mocking away " +"the framework since it helps you test your code in the real environment." +msgstr "" -#: src/android/aidl/client.md -#, fuzzy -msgid "Build, push, and run the client on your device:" -msgstr "Créez, transférez et exécutez le client sur votre appareil :" +#: src/android/testing/mocking.md +msgid "" +"Mockall is not part of the Rust Playground, so you need to run this example " +"in a local environment. Use `cargo add mockall` to quickly add Mockall to an " +"existing Cargo project." +msgstr "" -#: src/android/aidl/client.md +#: src/android/testing/mocking.md msgid "" -"```shell\n" -"m birthday_client\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" -"tmp\n" -"adb shell /data/local/tmp/birthday_client Charlie 60\n" -"```" +"Mockall has a lot more functionality. In particular, you can set up " +"expectations which depend on the arguments passed. Here we use this to mock " +"a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" -#: src/android/aidl/changing.md -#, fuzzy +#: src/android/testing/mocking.md msgid "" -"Let us extend the API with more functionality: we want to let clients " -"specify a list of lines for the birthday card:" +"You can use `.times(n)` to limit the number of times a mock method can be " +"called to `n` --- the mock will automatically panic when dropped if this " +"isn't satisfied." msgstr "" -"Étendons l'API avec plus de fonctionnalités : nous voulons laisser les " -"clients spécifier un liste des lignes pour la carte d'anniversaire :" #: src/android/logging.md #, fuzzy @@ -13097,10 +12853,6 @@ msgstr "" msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "\"general-tests\"" -msgstr "" - #: src/android/interoperability/with-c/bindgen.md msgid "\"none\"" msgstr "" @@ -13441,11 +13193,6 @@ msgid "" "through a `noexcept` C++ function." msgstr "" -#: src/android/interoperability/cpp/type-mapping.md -#, fuzzy -msgid "Rust Type" -msgstr "Rust by Example" - #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "C++ Type" @@ -13497,11 +13244,6 @@ msgstr "" msgid "`std::unique_ptr`" msgstr "" -#: src/android/interoperability/cpp/type-mapping.md -#, fuzzy -msgid "`Vec`" -msgstr "`Vec`" - #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "`rust::Vec`" @@ -13846,9 +13588,9 @@ msgstr "" #: src/chromium/cargo.md msgid "" -"Rust community typically uses `cargo` and libraries from [crates.io](https://" -"crates.io/). Chromium is built using `gn` and `ninja` and a curated set of " -"dependencies." +"The Rust community typically uses `cargo` and libraries from [crates.io]" +"(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " +"set of dependencies." msgstr "" #: src/chromium/cargo.md @@ -14002,13 +13744,13 @@ msgstr "" msgid "" "Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " "when building and bootstrapping Rust standard library when building Rust " -"toolchain.)" +"toolchain." msgstr "" #: src/chromium/cargo.md msgid "" "`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " -"third-party libraries downloaded from the internet, by `run_gnrt.py` asks " +"third-party libraries downloaded from the internet, but `run_gnrt.py` asks " "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" @@ -14333,7 +14075,7 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " -"by the Rust compiler, so you'll need to to allow unsafe code in your `gn` " +"by the Rust compiler, so you'll need to allow unsafe code in your `gn` " "target." msgstr "" @@ -15160,6 +14902,10 @@ msgid "" "they do!" msgstr "" +#: src/chromium/adding-third-party-crates.md +msgid "Property" +msgstr "" + #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "C++ library" @@ -15422,6 +15168,10 @@ msgstr "" msgid "Checking rustc version to configure features on and off" msgstr "" +#: src/chromium/adding-third-party-crates/resolving-problems.md +msgid "Yes" +msgstr "" + #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "None" msgstr "" @@ -15443,6 +15193,10 @@ msgstr "" msgid "Building C/C++" msgstr "" +#: src/chromium/adding-third-party-crates/resolving-problems.md +msgid "No" +msgstr "" + #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Patch around it" msgstr "" @@ -16852,33 +16606,6 @@ msgstr "" msgid "_src/main.rs_:" msgstr "`src/main.rs` :" -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Configure serial port.\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "// Use the system timer as a delay provider.\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -msgid "" -"// Set up the I2C controller and Inertial Measurement Unit.\n" -" // TODO\n" -msgstr "" - -#: src/exercises/bare-metal/compass.md -#: src/exercises/bare-metal/solutions-morning.md -msgid "\"Ready.\"" -msgstr "" - -#: src/exercises/bare-metal/compass.md -msgid "" -"// Read compass data and log it to the serial port.\n" -" // TODO\n" -msgstr "" - #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md #, fuzzy msgid "_Cargo.toml_ (you shouldn't need to change this):" @@ -16922,6 +16649,14 @@ msgstr "Exercice du matin avec Rust sur bare metal" msgid "([back to exercise](compass.md))" msgstr "([retour à l'exercice](compass.md))" +#: src/exercises/bare-metal/solutions-morning.md +msgid "// Configure serial port.\n" +msgstr "" + +#: src/exercises/bare-metal/solutions-morning.md +msgid "// Use the system timer as a delay provider.\n" +msgstr "" + #: src/exercises/bare-metal/solutions-morning.md msgid "// Set up the I2C controller and Inertial Measurement Unit.\n" msgstr "" @@ -16934,6 +16669,10 @@ msgstr "" msgid "// Set up display and timer.\n" msgstr "" +#: src/exercises/bare-metal/solutions-morning.md +msgid "\"Ready.\"" +msgstr "" + #: src/exercises/bare-metal/solutions-morning.md msgid "// Read compass data and log it to the serial port.\n" msgstr "" @@ -17363,12 +17102,10 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md msgid "/// Writes a single byte to the UART.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md msgid "// Wait until there is room in the TX buffer.\n" msgstr "" @@ -17379,12 +17116,10 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md msgid "// Write to the TX buffer.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md -#: src/exercises/bare-metal/rtc.md msgid "// Wait until the UART is no longer busy.\n" msgstr "" @@ -17441,7 +17176,7 @@ msgstr "" "Nous avons dérivé le trait `Debug`. Il serait également utile de mettre en " "œuvre quelques traits supplémentaires." -#: src/bare-metal/aps/uart/traits.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/uart/traits.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "// Safe because it just contains a pointer to device memory, which can be\n" @@ -17678,43 +17413,43 @@ msgstr "" "Le crate [`bitflags`](https://crates.io/crates/bitflags) est utile pour " "travailler avec les bitflags." -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Flags from the UART flag register.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Clear to send.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Data set ready.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Data carrier detect.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// UART busy transmitting data.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Receive FIFO is empty.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Transmit FIFO is full.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Receive FIFO is full.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Transmit FIFO is empty.\n" msgstr "" -#: src/bare-metal/aps/better-uart/bitflags.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Ring indicator.\n" msgstr "" @@ -17766,19 +17501,19 @@ msgstr "" msgid "/// Driver for a PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/driver.md msgid "" "// Safe because we know that self.registers points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/driver.md msgid "" "/// Reads and returns a pending byte, or `None` if nothing has been\n" " /// received.\n" msgstr "" -#: src/bare-metal/aps/better-uart/driver.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/better-uart/driver.md msgid "// TODO: Check for error conditions in bits 8-11.\n" msgstr "" @@ -17807,13 +17542,11 @@ msgstr "" "console série et écho entrant octets." #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Base address of the primary PL011 UART.\n" msgstr "" #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/rtc.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "// Safe because `PL011_BASE_ADDRESS` is the base address of a PL011 device,\n" @@ -17870,11 +17603,11 @@ msgstr "" "[`log`](https://crates.io/crates/log). Nous pouvons le faire en implémentant " "le trait `Log`." -#: src/bare-metal/aps/logging.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" msgstr "" -#: src/bare-metal/aps/logging.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/logging.md msgid "/// Initialises UART logger.\n" msgstr "" @@ -17892,7 +17625,7 @@ msgstr "" msgid "We need to initialise the logger before we use it." msgstr "Nous devons initialiser l'enregistreur avant de l'utiliser." -#: src/bare-metal/aps/logging/using.md src/exercises/bare-metal/rtc.md +#: src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"{info}\"" msgstr "" @@ -18397,32 +18130,6 @@ msgstr "" "Téléchargez le \\[modèle d'exercice\\] (../../comprehensive-rust-exercises." "zip) et regardez dans le `rtc` répertoire pour les fichiers suivants." -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base addresses of the GICv3.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"// Safe because `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" -" // addresses of a GICv3 distributor and redistributor respectively, and\n" -" // nothing else accesses those address ranges.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// TODO: Create instance of RTC driver and print current time.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// TODO: Wait for 3 seconds.\n" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "" @@ -18431,739 +18138,46 @@ msgid "" msgstr "" "`src/exceptions.rs` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "" -"// Copyright 2023 Google LLC\n" -"//\n" -"// Licensed under the Apache License, Version 2.0 (the \"License\");\n" -"// you may not use this file except in compliance with the License.\n" -"// You may obtain a copy of the License at\n" -"//\n" -"// http://www.apache.org/licenses/LICENSE-2.0\n" -"//\n" -"// Unless required by applicable law or agreed to in writing, software\n" -"// distributed under the License is distributed on an \"AS IS\" BASIS,\n" -"// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -"// See the License for the specific language governing permissions and\n" -"// limitations under the License.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"sync_exception_current\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"irq_current\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"No pending interrupt\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"IRQ {intid:?}\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"fiq_current\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"serr_current\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"sync_lower\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"irq_lower\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"fiq_lower\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"serr_lower\"" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "`src/logger.rs` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: main\n" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_src/pl011.rs_ (you shouldn't need to change this):" msgstr "`src/pl011.rs` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: Flags\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Flags\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "" -"/// Flags from the UART Receive Status Register / Error Clear Register.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "/// Framing error.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "/// Parity error.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "/// Break error.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "/// Overrun error.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR: Registers\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Registers\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "" -"// ANCHOR: Uart\n" -"/// Driver for a PL011 UART.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "" -"/// Constructs a new instance of the UART driver for a PL011 device at the\n" -" /// given base address.\n" -" ///\n" -" /// # Safety\n" -" ///\n" -" /// The given base address must point to the MMIO control registers of " -"a\n" -" /// PL011 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "// ANCHOR_END: Uart\n" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_build.rs_ (you shouldn't need to change this):" msgstr "`build.rs` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "\"linux\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"CROSS_COMPILE\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "\"aarch64-linux-gnu\"" -msgstr "aarch64-paging" - -#: src/exercises/bare-metal/rtc.md -msgid "\"aarch64-none-elf\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"entry.S\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "\"exceptions.S\"" -msgstr "Exceptions" - -#: src/exercises/bare-metal/rtc.md -msgid "\"idmap.S\"" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "\"empty\"" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_entry.S_ (you shouldn't need to change this):" msgstr "`entry.S` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -".macro adr_l, reg:req, sym:req\n" -"\tadrp \\reg, \\sym\n" -"\tadd \\reg, \\reg, :lo12:\\sym\n" -".endm\n" -"\n" -".macro mov_i, reg:req, imm:req\n" -"\tmovz \\reg, :abs_g3:\\imm\n" -"\tmovk \\reg, :abs_g2_nc:\\imm\n" -"\tmovk \\reg, :abs_g1_nc:\\imm\n" -"\tmovk \\reg, :abs_g0_nc:\\imm\n" -".endm\n" -"\n" -".set .L_MAIR_DEV_nGnRE,\t0x04\n" -".set .L_MAIR_MEM_WBWA,\t0xff\n" -".set .Lmairval, .L_MAIR_DEV_nGnRE | (.L_MAIR_MEM_WBWA << 8)\n" -"\n" -"/* 4 KiB granule size for TTBR0_EL1. */\n" -".set .L_TCR_TG0_4KB, 0x0 << 14\n" -"/* 4 KiB granule size for TTBR1_EL1. */\n" -".set .L_TCR_TG1_4KB, 0x2 << 30\n" -"/* Disable translation table walk for TTBR1_EL1, generating a translation " -"fault instead. */\n" -".set .L_TCR_EPD1, 0x1 << 23\n" -"/* Translation table walks for TTBR0_EL1 are inner sharable. */\n" -".set .L_TCR_SH_INNER, 0x3 << 12\n" -"/*\n" -" * Translation table walks for TTBR0_EL1 are outer write-back read-allocate " -"write-allocate\n" -" * cacheable.\n" -" */\n" -".set .L_TCR_RGN_OWB, 0x1 << 10\n" -"/*\n" -" * Translation table walks for TTBR0_EL1 are inner write-back read-allocate " -"write-allocate\n" -" * cacheable.\n" -" */\n" -".set .L_TCR_RGN_IWB, 0x1 << 8\n" -"/* Size offset for TTBR0_EL1 is 2**39 bytes (512 GiB). */\n" -".set .L_TCR_T0SZ_512, 64 - 39\n" -".set .Ltcrval, .L_TCR_TG0_4KB | .L_TCR_TG1_4KB | .L_TCR_EPD1 | ." -"L_TCR_RGN_OWB\n" -".set .Ltcrval, .Ltcrval | .L_TCR_RGN_IWB | .L_TCR_SH_INNER | ." -"L_TCR_T0SZ_512\n" -"\n" -"/* Stage 1 instruction access cacheability is unaffected. */\n" -".set .L_SCTLR_ELx_I, 0x1 << 12\n" -"/* SP alignment fault if SP is not aligned to a 16 byte boundary. */\n" -".set .L_SCTLR_ELx_SA, 0x1 << 3\n" -"/* Stage 1 data access cacheability is unaffected. */\n" -".set .L_SCTLR_ELx_C, 0x1 << 2\n" -"/* EL0 and EL1 stage 1 MMU enabled. */\n" -".set .L_SCTLR_ELx_M, 0x1 << 0\n" -"/* Privileged Access Never is unchanged on taking an exception to EL1. */\n" -".set .L_SCTLR_EL1_SPAN, 0x1 << 23\n" -"/* SETEND instruction disabled at EL0 in aarch32 mode. */\n" -".set .L_SCTLR_EL1_SED, 0x1 << 8\n" -"/* Various IT instructions are disabled at EL0 in aarch32 mode. */\n" -".set .L_SCTLR_EL1_ITD, 0x1 << 7\n" -".set .L_SCTLR_EL1_RES1, (0x1 << 11) | (0x1 << 20) | (0x1 << 22) | (0x1 << " -"28) | (0x1 << 29)\n" -".set .Lsctlrval, .L_SCTLR_ELx_M | .L_SCTLR_ELx_C | .L_SCTLR_ELx_SA | ." -"L_SCTLR_EL1_ITD | .L_SCTLR_EL1_SED\n" -".set .Lsctlrval, .Lsctlrval | .L_SCTLR_ELx_I | .L_SCTLR_EL1_SPAN | ." -"L_SCTLR_EL1_RES1\n" -"\n" -"/**\n" -" * This is a generic entry point for an image. It carries out the operations " -"required to prepare the\n" -" * loaded image to be run. Specifically, it zeroes the bss section using " -"registers x25 and above,\n" -" * prepares the stack, enables floating point, and sets up the exception " -"vector. It preserves x0-x3\n" -" * for the Rust entry point, as these may contain boot parameters.\n" -" */\n" -".section .init.entry, \"ax\"\n" -".global entry\n" -"entry:\n" -"\t/* Load and apply the memory management configuration, ready to enable MMU " -"and caches. */\n" -"\tadrp x30, idmap\n" -"\tmsr ttbr0_el1, x30\n" -"\n" -"\tmov_i x30, .Lmairval\n" -"\tmsr mair_el1, x30\n" -"\n" -"\tmov_i x30, .Ltcrval\n" -"\t/* Copy the supported PA range into TCR_EL1.IPS. */\n" -"\tmrs x29, id_aa64mmfr0_el1\n" -"\tbfi x30, x29, #32, #4\n" -"\n" -"\tmsr tcr_el1, x30\n" -"\n" -"\tmov_i x30, .Lsctlrval\n" -"\n" -"\t/*\n" -"\t * Ensure everything before this point has completed, then invalidate any " -"potentially stale\n" -"\t * local TLB entries before they start being used.\n" -"\t */\n" -"\tisb\n" -"\ttlbi vmalle1\n" -"\tic iallu\n" -"\tdsb nsh\n" -"\tisb\n" -"\n" -"\t/*\n" -"\t * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this has completed.\n" -"\t */\n" -"\tmsr sctlr_el1, x30\n" -"\tisb\n" -"\n" -"\t/* Disable trapping floating point access in EL1. */\n" -"\tmrs x30, cpacr_el1\n" -"\torr x30, x30, #(0x3 << 20)\n" -"\tmsr cpacr_el1, x30\n" -"\tisb\n" -"\n" -"\t/* Zero out the bss section. */\n" -"\tadr_l x29, bss_begin\n" -"\tadr_l x30, bss_end\n" -"0:\tcmp x29, x30\n" -"\tb.hs 1f\n" -"\tstp xzr, xzr, [x29], #16\n" -"\tb 0b\n" -"\n" -"1:\t/* Prepare the stack. */\n" -"\tadr_l x30, boot_stack_end\n" -"\tmov sp, x30\n" -"\n" -"\t/* Set up exception vector. */\n" -"\tadr x30, vector_table_el1\n" -"\tmsr vbar_el1, x30\n" -"\n" -"\t/* Call into Rust code. */\n" -"\tbl main\n" -"\n" -"\t/* Loop forever waiting for interrupts. */\n" -"2:\twfi\n" -"\tb 2b\n" -"```" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_exceptions.S_ (you shouldn't need to change this):" msgstr "`exceptions.S` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -"/**\n" -" * Saves the volatile registers onto the stack. This currently takes 14\n" -" * instructions, so it can be used in exception handlers with 18 " -"instructions\n" -" * left.\n" -" *\n" -" * On return, x0 and x1 are initialised to elr_el2 and spsr_el2 " -"respectively,\n" -" * which can be used as the first and second arguments of a subsequent " -"call.\n" -" */\n" -".macro save_volatile_to_stack\n" -"\t/* Reserve stack space and save registers x0-x18, x29 & x30. */\n" -"\tstp x0, x1, [sp, #-(8 * 24)]!\n" -"\tstp x2, x3, [sp, #8 * 2]\n" -"\tstp x4, x5, [sp, #8 * 4]\n" -"\tstp x6, x7, [sp, #8 * 6]\n" -"\tstp x8, x9, [sp, #8 * 8]\n" -"\tstp x10, x11, [sp, #8 * 10]\n" -"\tstp x12, x13, [sp, #8 * 12]\n" -"\tstp x14, x15, [sp, #8 * 14]\n" -"\tstp x16, x17, [sp, #8 * 16]\n" -"\tstr x18, [sp, #8 * 18]\n" -"\tstp x29, x30, [sp, #8 * 20]\n" -"\n" -"\t/*\n" -"\t * Save elr_el1 & spsr_el1. This such that we can take nested exception\n" -"\t * and still be able to unwind.\n" -"\t */\n" -"\tmrs x0, elr_el1\n" -"\tmrs x1, spsr_el1\n" -"\tstp x0, x1, [sp, #8 * 22]\n" -".endm\n" -"\n" -"/**\n" -" * Restores the volatile registers from the stack. This currently takes 14\n" -" * instructions, so it can be used in exception handlers while still leaving " -"18\n" -" * instructions left; if paired with save_volatile_to_stack, there are 4\n" -" * instructions to spare.\n" -" */\n" -".macro restore_volatile_from_stack\n" -"\t/* Restore registers x2-x18, x29 & x30. */\n" -"\tldp x2, x3, [sp, #8 * 2]\n" -"\tldp x4, x5, [sp, #8 * 4]\n" -"\tldp x6, x7, [sp, #8 * 6]\n" -"\tldp x8, x9, [sp, #8 * 8]\n" -"\tldp x10, x11, [sp, #8 * 10]\n" -"\tldp x12, x13, [sp, #8 * 12]\n" -"\tldp x14, x15, [sp, #8 * 14]\n" -"\tldp x16, x17, [sp, #8 * 16]\n" -"\tldr x18, [sp, #8 * 18]\n" -"\tldp x29, x30, [sp, #8 * 20]\n" -"\n" -"\t/* Restore registers elr_el1 & spsr_el1, using x0 & x1 as scratch. */\n" -"\tldp x0, x1, [sp, #8 * 22]\n" -"\tmsr elr_el1, x0\n" -"\tmsr spsr_el1, x1\n" -"\n" -"\t/* Restore x0 & x1, and release stack space. */\n" -"\tldp x0, x1, [sp], #8 * 24\n" -".endm\n" -"\n" -"/**\n" -" * This is a generic handler for exceptions taken at the current EL while " -"using\n" -" * SP0. It behaves similarly to the SPx case by first switching to SPx, " -"doing\n" -" * the work, then switching back to SP0 before returning.\n" -" *\n" -" * Switching to SPx and calling the Rust handler takes 16 instructions. To\n" -" * restore and return we need an additional 16 instructions, so we can " -"implement\n" -" * the whole handler within the allotted 32 instructions.\n" -" */\n" -".macro current_exception_sp0 handler:req\n" -"\tmsr spsel, #1\n" -"\tsave_volatile_to_stack\n" -"\tbl \\handler\n" -"\trestore_volatile_from_stack\n" -"\tmsr spsel, #0\n" -"\teret\n" -".endm\n" -"\n" -"/**\n" -" * This is a generic handler for exceptions taken at the current EL while " -"using\n" -" * SPx. It saves volatile registers, calls the Rust handler, restores " -"volatile\n" -" * registers, then returns.\n" -" *\n" -" * This also works for exceptions taken from EL0, if we don't care about\n" -" * non-volatile registers.\n" -" *\n" -" * Saving state and jumping to the Rust handler takes 15 instructions, and\n" -" * restoring and returning also takes 15 instructions, so we can fit the " -"whole\n" -" * handler in 30 instructions, under the limit of 32.\n" -" */\n" -".macro current_exception_spx handler:req\n" -"\tsave_volatile_to_stack\n" -"\tbl \\handler\n" -"\trestore_volatile_from_stack\n" -"\teret\n" -".endm\n" -"\n" -".section .text.vector_table_el1, \"ax\"\n" -".global vector_table_el1\n" -".balign 0x800\n" -"vector_table_el1:\n" -"sync_cur_sp0:\n" -"\tcurrent_exception_sp0 sync_exception_current\n" -"\n" -".balign 0x80\n" -"irq_cur_sp0:\n" -"\tcurrent_exception_sp0 irq_current\n" -"\n" -".balign 0x80\n" -"fiq_cur_sp0:\n" -"\tcurrent_exception_sp0 fiq_current\n" -"\n" -".balign 0x80\n" -"serr_cur_sp0:\n" -"\tcurrent_exception_sp0 serr_current\n" -"\n" -".balign 0x80\n" -"sync_cur_spx:\n" -"\tcurrent_exception_spx sync_exception_current\n" -"\n" -".balign 0x80\n" -"irq_cur_spx:\n" -"\tcurrent_exception_spx irq_current\n" -"\n" -".balign 0x80\n" -"fiq_cur_spx:\n" -"\tcurrent_exception_spx fiq_current\n" -"\n" -".balign 0x80\n" -"serr_cur_spx:\n" -"\tcurrent_exception_spx serr_current\n" -"\n" -".balign 0x80\n" -"sync_lower_64:\n" -"\tcurrent_exception_spx sync_lower\n" -"\n" -".balign 0x80\n" -"irq_lower_64:\n" -"\tcurrent_exception_spx irq_lower\n" -"\n" -".balign 0x80\n" -"fiq_lower_64:\n" -"\tcurrent_exception_spx fiq_lower\n" -"\n" -".balign 0x80\n" -"serr_lower_64:\n" -"\tcurrent_exception_spx serr_lower\n" -"\n" -".balign 0x80\n" -"sync_lower_32:\n" -"\tcurrent_exception_spx sync_lower\n" -"\n" -".balign 0x80\n" -"irq_lower_32:\n" -"\tcurrent_exception_spx irq_lower\n" -"\n" -".balign 0x80\n" -"fiq_lower_32:\n" -"\tcurrent_exception_spx fiq_lower\n" -"\n" -".balign 0x80\n" -"serr_lower_32:\n" -"\tcurrent_exception_spx serr_lower\n" -"```" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_idmap.S_ (you shouldn't need to change this):" msgstr "`idmap.S` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "" -"```armasm\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -".set .L_TT_TYPE_BLOCK, 0x1\n" -".set .L_TT_TYPE_PAGE, 0x3\n" -".set .L_TT_TYPE_TABLE, 0x3\n" -"\n" -"/* Access flag. */\n" -".set .L_TT_AF, 0x1 << 10\n" -"/* Not global. */\n" -".set .L_TT_NG, 0x1 << 11\n" -".set .L_TT_XN, 0x3 << 53\n" -"\n" -".set .L_TT_MT_DEV, 0x0 << 2\t\t\t// MAIR #0 (DEV_nGnRE)\n" -".set .L_TT_MT_MEM, (0x1 << 2) | (0x3 << 8)\t// MAIR #1 (MEM_WBWA), inner " -"shareable\n" -"\n" -".set .L_BLOCK_DEV, .L_TT_TYPE_BLOCK | .L_TT_MT_DEV | .L_TT_AF | .L_TT_XN\n" -".set .L_BLOCK_MEM, .L_TT_TYPE_BLOCK | .L_TT_MT_MEM | .L_TT_AF | .L_TT_NG\n" -"\n" -".section \".rodata.idmap\", \"a\", %progbits\n" -".global idmap\n" -".align 12\n" -"idmap:\n" -"\t/* level 1 */\n" -"\t.quad\t\t.L_BLOCK_DEV | 0x0\t\t // 1 GiB of device mappings\n" -"\t.quad\t\t.L_BLOCK_MEM | 0x40000000\t// 1 GiB of DRAM\n" -"\t.fill\t\t254, 8, 0x0\t\t\t// 254 GiB of unmapped VA space\n" -"\t.quad\t\t.L_BLOCK_DEV | 0x4000000000 // 1 GiB of device mappings\n" -"\t.fill\t\t255, 8, 0x0\t\t\t// 255 GiB of remaining VA space\n" -"```" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_image.ld_ (you shouldn't need to change this):" msgstr "`image.ld` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "" -"```ld\n" -"/*\n" -" * Copyright 2023 Google LLC\n" -" *\n" -" * Licensed under the Apache License, Version 2.0 (the \"License\");\n" -" * you may not use this file except in compliance with the License.\n" -" * You may obtain a copy of the License at\n" -" *\n" -" * https://www.apache.org/licenses/LICENSE-2.0\n" -" *\n" -" * Unless required by applicable law or agreed to in writing, software\n" -" * distributed under the License is distributed on an \"AS IS\" BASIS,\n" -" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n" -" * See the License for the specific language governing permissions and\n" -" * limitations under the License.\n" -" */\n" -"\n" -"/*\n" -" * Code will start running at this symbol which is placed at the start of " -"the\n" -" * image.\n" -" */\n" -"ENTRY(entry)\n" -"\n" -"MEMORY\n" -"{\n" -"\timage : ORIGIN = 0x40080000, LENGTH = 2M\n" -"}\n" -"\n" -"SECTIONS\n" -"{\n" -"\t/*\n" -"\t * Collect together the code.\n" -"\t */\n" -"\t.init : ALIGN(4096) {\n" -"\t\ttext_begin = .;\n" -"\t\t*(.init.entry)\n" -"\t\t*(.init.*)\n" -"\t} >image\n" -"\t.text : {\n" -"\t\t*(.text.*)\n" -"\t} >image\n" -"\ttext_end = .;\n" -"\n" -"\t/*\n" -"\t * Collect together read-only data.\n" -"\t */\n" -"\t.rodata : ALIGN(4096) {\n" -"\t\trodata_begin = .;\n" -"\t\t*(.rodata.*)\n" -"\t} >image\n" -"\t.got : {\n" -"\t\t*(.got)\n" -"\t} >image\n" -"\trodata_end = .;\n" -"\n" -"\t/*\n" -"\t * Collect together the read-write data including .bss at the end which\n" -"\t * will be zero'd by the entry code.\n" -"\t */\n" -"\t.data : ALIGN(4096) {\n" -"\t\tdata_begin = .;\n" -"\t\t*(.data.*)\n" -"\t\t/*\n" -"\t\t * The entry point code assumes that .data is a multiple of 32\n" -"\t\t * bytes long.\n" -"\t\t */\n" -"\t\t. = ALIGN(32);\n" -"\t\tdata_end = .;\n" -"\t} >image\n" -"\n" -"\t/* Everything beyond this point will not be included in the binary. */\n" -"\tbin_end = .;\n" -"\n" -"\t/* The entry point code assumes that .bss is 16-byte aligned. */\n" -"\t.bss : ALIGN(16) {\n" -"\t\tbss_begin = .;\n" -"\t\t*(.bss.*)\n" -"\t\t*(COMMON)\n" -"\t\t. = ALIGN(16);\n" -"\t\tbss_end = .;\n" -"\t} >image\n" -"\n" -"\t.stack (NOLOAD) : ALIGN(4096) {\n" -"\t\tboot_stack_begin = .;\n" -"\t\t. += 40 * 4096;\n" -"\t\t. = ALIGN(4096);\n" -"\t\tboot_stack_end = .;\n" -"\t} >image\n" -"\n" -"\t. = ALIGN(4K);\n" -"\tPROVIDE(dma_region = .);\n" -"\n" -"\t/*\n" -"\t * Remove unused sections from the image.\n" -"\t */\n" -"\t/DISCARD/ : {\n" -"\t\t/* The image loads itself so doesn't need these sections. */\n" -"\t\t*(.gnu.hash)\n" -"\t\t*(.hash)\n" -"\t\t*(.interp)\n" -"\t\t*(.eh_frame_hdr)\n" -"\t\t*(.eh_frame)\n" -"\t\t*(.note.gnu.build-id)\n" -"\t}\n" -"}\n" -"```" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_Makefile_ (you shouldn't need to change this):" msgstr "`Makefile` (vous ne devriez pas avoir besoin de le modifier) :" -#: src/exercises/bare-metal/rtc.md -msgid "# Copyright 2023 Google LLC" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "$(shell uname -s)" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -#, fuzzy -msgid "aarch64-linux-gnu" -msgstr "aarch64-paging" - -#: src/exercises/bare-metal/rtc.md -msgid "stdio -display none -kernel $< -s" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "cargo clean" -msgstr "" - #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "Run the code in QEMU with `make qemu`." @@ -19184,11 +18198,26 @@ msgid "_main.rs_:" msgstr "`main.rs` :" #: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base address of the PL031 RTC.\n" +msgid "/// Base addresses of the GICv3.\n" +msgstr "" + +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Base address of the PL031 RTC.\n" +msgstr "" + +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// The IRQ used by the PL031 RTC.\n" +msgstr "" + +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// The IRQ used by the PL031 RTC.\n" +msgid "" +"// Safe because `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" +" // addresses of a GICv3 distributor and redistributor respectively, and\n" +" // nothing else accesses those address ranges.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md @@ -19349,6 +18378,23 @@ msgstr "" "_concurrence sans peur_ puisque vous peut compter sur le compilateur pour " "assurer l'exactitude au moment de l'exécution." +#: src/concurrency.md +msgid "" +"Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." +msgstr "" + +#: src/concurrency.md +msgid "" +"The type system gives us safety for concurrency without any special features." +msgstr "" + +#: src/concurrency.md +msgid "" +"The same tools that help with \"concurrent\" access in a single thread (e." +"g., a called function that might mutate an argument or save references to it " +"to read later) save us from multi-threading issues." +msgstr "" + #: src/concurrency/threads.md #, fuzzy msgid "Rust threads work similarly to threads in other languages:" @@ -19383,40 +18429,148 @@ msgstr "" "Les paniques peuvent transporter une charge utile, qui peut être " "décompressée avec `downcast_ref`." +#: src/concurrency/threads.md +msgid "Rust thread APIs look not too different from e.g. C++ ones." +msgstr "" + +#: src/concurrency/threads.md +#, fuzzy +msgid "Run the example." +msgstr "Exécutez l'exemple avec :" + +#: src/concurrency/threads.md +msgid "" +"5ms timing is loose enough that main and spawned threads stay mostly in " +"lockstep." +msgstr "" + +#: src/concurrency/threads.md +msgid "Notice that the program ends before the spawned thread reaches 10!" +msgstr "" + +#: src/concurrency/threads.md +msgid "" +"This is because main ends the program and spawned threads do not make it " +"persist." +msgstr "" + +#: src/concurrency/threads.md +msgid "Compare to pthreads/C++ std::thread/boost::thread if desired." +msgstr "" + +#: src/concurrency/threads.md +msgid "How do we wait around for the spawned thread to complete?" +msgstr "" + #: src/concurrency/threads.md #, fuzzy msgid "" -"Notice that the thread is stopped before it reaches 10 --- the main thread " -"is not waiting." +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " +"returns a `JoinHandle`. Look at the docs." +msgstr "" +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"utilisé pour construire une instance par défaut d'un type." + +#: src/concurrency/threads.md +msgid "" +"`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) method that blocks." msgstr "" -"Notez que le thread est arrêté avant d'atteindre 10 — le thread principal " -"est pas attendre." #: src/concurrency/threads.md #, fuzzy msgid "" "Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " -"the thread to finish." +"the thread to finish and have the program count all the way to 10." msgstr "" "Utilisez `let handle = thread::spawn(...)` et plus tard `handle.join()` pour " "attendre le fil pour finir." +#: src/concurrency/threads.md +msgid "Now what if we want to return a value?" +msgstr "" + +#: src/concurrency/threads.md +msgid "Look at docs again:" +msgstr "" + #: src/concurrency/threads.md #, fuzzy -msgid "Trigger a panic in the thread, notice how this doesn't affect `main`." +msgid "" +"[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " +"closure returns `T`" +msgstr "" +"Cependant, vous pouvez utiliser un [fil de discussion de portée](https://doc." +"rust-lang.org/std/thread/fn.scope.html) pour cela :" + +#: src/concurrency/threads.md +msgid "" +"`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." +"JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -"Déclenchez une panique dans le fil, notez que cela n'affecte pas `main`." #: src/concurrency/threads.md #, fuzzy msgid "" "Use the `Result` return value from `handle.join()` to get access to the " -"panic payload. This is a good time to talk about [`Any`](https://doc.rust-" -"lang.org/std/any/index.html)." +"returned value." +msgstr "" +"Utilisez la valeur de retour `Result` de `handle.join()` pour accéder à la " +"panique charge utile. C'est le bon moment pour parler de \\[`Tous`\\]." + +#: src/concurrency/threads.md +msgid "Ok, what about the other case?" +msgstr "" + +#: src/concurrency/threads.md +#, fuzzy +msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." +msgstr "" +"Déclenchez une panique dans le fil, notez que cela n'affecte pas `main`." + +#: src/concurrency/threads.md +#, fuzzy +msgid "" +"Access the panic payload. This is a good time to talk about [`Any`](https://" +"doc.rust-lang.org/std/any/index.html)." msgstr "" "Utilisez la valeur de retour `Result` de `handle.join()` pour accéder à la " "panique charge utile. C'est le bon moment pour parler de \\[`Tous`\\]." +#: src/concurrency/threads.md +msgid "Now we can return values from threads! What about taking inputs?" +msgstr "" + +#: src/concurrency/threads.md +msgid "Capture something by reference in the thread closure." +msgstr "" + +#: src/concurrency/threads.md +msgid "An error message indicates we must move it." +msgstr "" + +#: src/concurrency/threads.md +msgid "Move it in, see we can compute and then return a derived value." +msgstr "" + +#: src/concurrency/threads.md +msgid "If we want to borrow?" +msgstr "" + +#: src/concurrency/threads.md +msgid "" +"Main kills child threads when it returns, but another function would just " +"return and leave them running." +msgstr "" + +#: src/concurrency/threads.md +msgid "That would be stack use-after-return, which violates memory safety!" +msgstr "" + +#: src/concurrency/threads.md +msgid "How do we avoid this? see next slide." +msgstr "" + #: src/concurrency/scoped-threads.md #, fuzzy msgid "Normal threads cannot borrow from their environment:" @@ -19530,7 +18684,7 @@ msgstr "" #: src/concurrency/channels/bounded.md msgid "" "A bounded channel with a size of zero is called a \"rendezvous channel\". " -"Every send will block the current thread until another thread calls `read`." +"Every send will block the current thread until another thread calls `recv`." msgstr "" #: src/concurrency/send-sync.md @@ -19693,6 +18847,11 @@ msgstr "" msgid "`Mutex`: Explicitly thread-safe via internal locking." msgstr "" +#: src/concurrency/send-sync/examples.md +#, fuzzy +msgid "`mpsc::Sender`: As of 1.72.0." +msgstr "`mpsc::Expéditeur`" + #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "" @@ -19720,11 +18879,6 @@ msgstr "" "Ces types peuvent être déplacés vers d'autres threads, mais ils ne sont pas " "thread-safe. Typiquement à cause de la mutabilité intérieure :" -#: src/concurrency/send-sync/examples.md -#, fuzzy -msgid "`mpsc::Sender`" -msgstr "`mpsc::Expéditeur`" - #: src/concurrency/send-sync/examples.md #, fuzzy msgid "`mpsc::Receiver`" @@ -20101,7 +19255,6 @@ msgid "\"Eureka! {} has a new idea!\"" msgstr "" #: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md #: src/exercises/concurrency/solutions-afternoon.md msgid "// Pick up forks...\n" msgstr "" @@ -20201,10 +19354,16 @@ msgstr "" "pages ont été validées." #: src/exercises/concurrency/link-checker.md -#, fuzzy msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" -"reqwest/). Create a new Cargo project and `reqwest` it as a dependency with:" +"reqwest/). You will also need a way to find links, we can use [`scraper`]" +"(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " +"we will use [`thiserror`](https://docs.rs/thiserror/)." +msgstr "" + +#: src/exercises/concurrency/link-checker.md +#, fuzzy +msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" "Pour cela, vous aurez besoin d'un client HTTP tel que [`reqwest`](https://" "docs.rs/reqwest/). Créer un nouveau Projet Cargo et `reqwest` comme " @@ -20220,24 +19379,6 @@ msgstr "" "Fichier `Cargo.toml` à la main. Ajoutez les dépendances répertoriées ci-" "dessous." -#: src/exercises/concurrency/link-checker.md -#, fuzzy -msgid "" -"You will also need a way to find links. We can use [`scraper`](https://docs." -"rs/scraper/) for that:" -msgstr "" -"Vous aurez également besoin d'un moyen de trouver des liens. Nous pouvons " -"utiliser [`scraper`](https://docs.rs/scraper/) pour cela :" - -#: src/exercises/concurrency/link-checker.md -#, fuzzy -msgid "" -"Finally, we'll need some way of handling errors. We use [`thiserror`]" -"(https://docs.rs/thiserror/) for that:" -msgstr "" -"Enfin, nous aurons besoin d'un moyen de gérer les erreurs. Nous utilisons " -"[`thiserror`](https://docs.rs/thiserror/) pour ce:" - #: src/exercises/concurrency/link-checker.md #, fuzzy msgid "" @@ -20854,10 +19995,6 @@ msgstr "" msgid "\"Failed to send cat.\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Rex\"" -msgstr "" - #: src/async/control-flow/select.md msgid "\"Failed to send dog.\"" msgstr "" @@ -21125,16 +20262,35 @@ msgstr "" #: src/async/pitfalls/async-traits.md msgid "" -"Async methods in traits are not yet supported in the stable channel ([An " -"experimental feature exists in nightly and should be stabilized in the mid " -"term.](https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-" -"nightly.html))" +"Async methods in traits are were stabilized only recently, in the 1.75 " +"release. This required support for using return-position `impl Trait` (RPIT) " +"in traits, as the desugaring for `async fn` includes `-> impl Future`." +msgstr "" + +#: src/async/pitfalls/async-traits.md +msgid "" +"However, even with the native support today there are some pitfalls around " +"`async fn` and RPIT in traits:" +msgstr "" + +#: src/async/pitfalls/async-traits.md +msgid "" +"Return-position impl Trait captures all in-scope lifetimes (so some patterns " +"of borrowing cannot be expressed)" +msgstr "" + +#: src/async/pitfalls/async-traits.md +msgid "" +"Traits whose methods use return-position `impl trait` or `async` are not " +"`dyn` compatible." msgstr "" #: src/async/pitfalls/async-traits.md msgid "" -"The crate [async_trait](https://docs.rs/async-trait/latest/async_trait/) " -"provides a workaround through a macro:" +"If we do need `dyn` support, the crate [async_trait](https://docs.rs/async-" +"trait/latest/async_trait/) provides a workaround through a macro, with some " +"caveats:" msgstr "" #: src/async/pitfalls/async-traits.md @@ -21280,6 +20436,11 @@ msgstr "" "`src/main.rs`, remplissez le vides, et testez que `cargo run` ne se bloque " "pas :" +#: src/exercises/concurrency/dining-philosophers-async.md +#: src/exercises/concurrency/solutions-afternoon.md +msgid "// Keep trying until we have both forks\n" +msgstr "" + #: src/exercises/concurrency/dining-philosophers-async.md #: src/exercises/concurrency/solutions-afternoon.md msgid "// Make them think and eat\n" @@ -21350,9 +20511,9 @@ msgid "" "\n" "[dependencies]\n" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" -"http = \"1.0.0\"\n" -"tokio = { version = \"1.28.1\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.5.1\", features = [\"client\", " +"http = \"1.1.0\"\n" +"tokio = { version = \"1.36.0\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.7.0\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" @@ -21514,19 +20675,18 @@ msgstr "([retour à l'exercice](dining-philosophers.md))" #: src/exercises/concurrency/solutions-afternoon.md msgid "" -"// Add a delay before picking the second fork to allow the execution\n" -" // to transfer to another task\n" +"// If we didn't get the left fork, drop the right fork if we\n" +" // have it and let other tasks make progress.\n" msgstr "" #: src/exercises/concurrency/solutions-afternoon.md -msgid "// The locks are dropped here\n" +msgid "" +"// If we didn't get the right fork, drop the left fork and let\n" +" // other tasks make progress.\n" msgstr "" #: src/exercises/concurrency/solutions-afternoon.md -msgid "" -"// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" -" // either of them.\n" +msgid "// The locks are dropped here\n" msgstr "" #: src/exercises/concurrency/solutions-afternoon.md @@ -21895,7 +21055,7 @@ msgstr "" #: src/glossary.md msgid "" "Rust Fundamentals: \n" -"Days 1 to 3 of this course." +"Days 1 to 4 of this course." msgstr "" #: src/glossary.md @@ -22316,12 +21476,201 @@ msgstr "" "`third_party/cxx/` pour plus de détails, y compris les termes de la licence." #, fuzzy -#~ msgid "With C++)" -#~ msgstr "Avec C++" +#~ msgid "Static and Const" +#~ msgstr "static & const" + +#, fuzzy +#~ msgid "Slices and Lifetimes" +#~ msgstr "Durées de vie" + +#, fuzzy +#~ msgid "String References" +#~ msgstr "Références invalides" + +#~ msgid "Course schedule:" +#~ msgstr "Structure du cours:" + +#, fuzzy +#~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" +#~ msgstr "" +#~ "Voir [Filtrage par motif](../pattern-matching.md) pour plus de détails " +#~ "sur les motifs avec Rust." + +#, fuzzy +#~ msgid "Day 2 Afternoon (3 hours, including breaks)" +#~ msgstr "Exercices de l'après-midi du jour 2" + +#, fuzzy +#~ msgid "`String` - a modifiable, owned string." +#~ msgstr "`String` un tampon de chaîne mutable." + +#, fuzzy +#~ msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" +#~ msgstr "" +#~ "Une grande partie de la syntaxe de Rust vous sera familière en C, C++ ou " +#~ "Java :" + +#, fuzzy +#~ msgid "Blocks are delimited by curly braces." +#~ msgstr "Les blocs et les portées sont délimités par des accolades." + +#, fuzzy +#~ msgid "" +#~ "Line comments are started with `//`, block comments are delimited by `/" +#~ "* ... */`." +#~ msgstr "" +#~ "Les commentaires de ligne commencent par `//`, les commentaires de bloc " +#~ "sont délimités par `/* ... */`." + +#, fuzzy +#~ msgid "Keywords like `if` and `while` work the same." +#~ msgstr "" +#~ "Des mots-clés comme `if` et `while` fonctionnent de la même manière." + +#, fuzzy +#~ msgid "Variable assignment is done with `=`, comparison is done with `==`." +#~ msgstr "" +#~ "L'affectation des variables se fait avec `=`, la comparaison se fait avec " +#~ "`==`." + +#, fuzzy +#~ msgid "" +#~ "In this case we break the outer loop after 3 iterations of the inner loop." +#~ msgstr "" +#~ "Dans ce cas, nous cassons la boucle externe après 3 itérations de la " +#~ "boucle interne." + +#, fuzzy +#~ msgid "Array assignment and access:" +#~ msgstr "Affectation et accès aux baies :" + +#, fuzzy +#~ msgid "Tuple assignment and access:" +#~ msgstr "Affectation et accès aux tuples :" + +#, fuzzy +#~ msgid "Arrays:" +#~ msgstr "Tableaux :" + +#, fuzzy +#~ msgid "Tuples:" +#~ msgstr "Tuples :" #, fuzzy -#~ msgid "{{%course outline Fundamentals}}" -#~ msgstr "Fondamentaux de Rust" +#~ msgid "" +#~ "The empty tuple `()` is also known as the \"unit type\". It is both a " +#~ "type, and the only valid value of that type --- that is to say both the " +#~ "type and its value are expressed as `()`. It is used to indicate, for " +#~ "example, that a function or expression has no return value, as we'll see " +#~ "in a future slide." +#~ msgstr "" +#~ "Le tuple vide `()` est également appelé \"type d'unité\". C'est à la fois " +#~ "un type et la seule valeur valide de ce type - c'est-à-dire à la fois le " +#~ "type et sa valeur sont exprimés par `()`. Il est utilisé pour indiquer, " +#~ "par exemple, qu'une fonction ou expression n'a pas de valeur de retour, " +#~ "comme nous le verrons dans une prochaine diapositive." + +#, fuzzy +#~ msgid "" +#~ "You can think of it as `void` that can be familiar to you from other " +#~ "programming languages." +#~ msgstr "" +#~ "Vous pouvez le considérer comme un \"vide\" qui peut vous être familier " +#~ "d'autres langages de programmation." + +#, fuzzy +#~ msgid "You can destructure tuples and arrays by matching on their elements:" +#~ msgstr "" +#~ "Vous pouvez déstructurer des tableaux, des tuples et des tranches en " +#~ "faisant correspondre leurs éléments :" + +#, fuzzy +#~ msgid "Lives for the entire duration of the program" +#~ msgstr "La fonction `main` est le point d'entrée du programme." + +#, fuzzy +#~ msgid "Evaluated at compile time" +#~ msgstr "" +#~ "Les valeurs ont des tailles fixes connues au moment de la compilation." + +#, fuzzy +#~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" +#~ msgstr "" +#~ "Voir [Filtrage par motif](../pattern-matching.md) pour plus de détails " +#~ "sur les motifs avec Rust." + +#, fuzzy +#~ msgid "" +#~ "A `Box` cannot be empty, so the pointer is always valid and non-`null`. " +#~ "This allows the compiler to optimize the memory layout:" +#~ msgstr "" +#~ "Une `Box` ne peut pas être vide, donc le pointeur est toujours valide et " +#~ "non `null`. Ce permet au compilateur d'optimiser la disposition de la " +#~ "mémoire :" + +#, fuzzy +#~ msgid "Rust terminology:" +#~ msgstr "Terminologie de Rust :" + +#, fuzzy +#~ msgid "`&str` an immutable reference to a string slice." +#~ msgstr "`&str` une référence immuable à une tranche de chaîne." + +#, fuzzy +#~ msgid "`String` a mutable string buffer." +#~ msgstr "`String` un tampon de chaîne mutable." + +#, fuzzy +#~ msgid "Rust comes with only basic support for writing tests." +#~ msgstr "Rust a un support intégré pour les tests de documentation :" + +#, fuzzy +#~ msgid "" +#~ "Add `vendor_available: true` if your AIDL file is used by a binary in the " +#~ "vendor partition." +#~ msgstr "" +#~ "Ajoutez `vendor_available : true` si votre fichier AIDL est utilisé par " +#~ "un binaire dans le fournisseur cloison." + +#, fuzzy +#~ msgid "\"aarch64-linux-gnu\"" +#~ msgstr "aarch64-paging" + +#, fuzzy +#~ msgid "\"exceptions.S\"" +#~ msgstr "Exceptions" + +#, fuzzy +#~ msgid "aarch64-linux-gnu" +#~ msgstr "aarch64-paging" + +#, fuzzy +#~ msgid "" +#~ "Notice that the thread is stopped before it reaches 10 --- the main " +#~ "thread is not waiting." +#~ msgstr "" +#~ "Notez que le thread est arrêté avant d'atteindre 10 — le thread principal " +#~ "est pas attendre." + +#, fuzzy +#~ msgid "" +#~ "You will also need a way to find links. We can use [`scraper`](https://" +#~ "docs.rs/scraper/) for that:" +#~ msgstr "" +#~ "Vous aurez également besoin d'un moyen de trouver des liens. Nous pouvons " +#~ "utiliser [`scraper`](https://docs.rs/scraper/) pour cela :" + +#, fuzzy +#~ msgid "" +#~ "Finally, we'll need some way of handling errors. We use [`thiserror`]" +#~ "(https://docs.rs/thiserror/) for that:" +#~ msgstr "" +#~ "Enfin, nous aurons besoin d'un moyen de gérer les erreurs. Nous utilisons " +#~ "[`thiserror`](https://docs.rs/thiserror/) pour ce:" + +#, fuzzy +#~ msgid "With C++)" +#~ msgstr "Avec C++" #, fuzzy #~ msgid "" @@ -22402,9 +21751,6 @@ msgstr "" #~ "et [`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), vous " #~ "pouvez résumer les sources `u8` :" -#~ msgid "Lifetimes" -#~ msgstr "Durées de vie" - #, fuzzy #~ msgid "" #~ "It's generally helpful for them to implement `Clone` and `Eq` too where " @@ -23098,11 +22444,6 @@ msgstr "" #~ msgid "`String` vs `str`" #~ msgstr "`Chaîne` vs `chaîne`" -#, fuzzy -#~ msgid "We can now understand the two string types in Rust:" -#~ msgstr "" -#~ "Nous pouvons maintenant comprendre les deux types de string avec Rust :" - #, fuzzy #~ msgid "" #~ "A Rust version of the famous [FizzBuzz](https://en.wikipedia.org/wiki/" @@ -24347,14 +23688,6 @@ msgstr "" #~ "(https://doc.rust-lang.org/std/ops/trait.Mul.html), ... utilisé pour la " #~ "surcharge de l'opérateur, et" -#, fuzzy -#~ msgid "" -#~ "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -#~ "used to construct a default instance of a type." -#~ msgstr "" -#~ "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " -#~ "utilisé pour construire une instance par défaut d'un type." - #, fuzzy #~ msgid "" #~ "`Iterator` implements `fn collect(self) -> B where B: "