diff --git a/po/tr.po b/po/tr.po index ffd561f29584..2c9e12366530 100644 --- a/po/tr.po +++ b/po/tr.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🦀\n" -"POT-Creation-Date: 2024-04-07T05:11:51+03:00\n" -"PO-Revision-Date: 2024-04-09 12:31+0300\n" +"POT-Creation-Date: 2025-07-04T11:43:49+03:00\n" +"PO-Revision-Date: 2025-07-04 23:59+0300\n" "Last-Translator: akerem@protonmail.com\n" "Language-Team: Turkish \n" "Language: tr\n" @@ -10,7 +10,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.6\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🦀" @@ -34,7 +34,7 @@ msgstr "Çeviriler" #: src/SUMMARY.md src/cargo.md msgid "Using Cargo" -msgstr "Cargo Kullanımı" +msgstr "Cargo'yu Kullanmak" #: src/SUMMARY.md msgid "Rust Ecosystem" @@ -52,47 +52,52 @@ msgstr "Cargo'nun Yerel (Local) Olarak Çalıştırılması" msgid "Day 1: Morning" msgstr "Gün 1: Sabah" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md +#: src/welcome-day-4.md src/concurrency/welcome-async.md msgid "Welcome" msgstr "Hoş Geldiniz" -#: src/SUMMARY.md src/hello-world.md src/types-and-values/hello-world.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/hello-world.md src/types-and-values.md +#: src/types-and-values/hello-world.md msgid "Hello, World" msgstr "Merhaba, Dünya" -#: src/SUMMARY.md src/hello-world/what-is-rust.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md msgid "What is Rust?" msgstr "Rust Nedir?" -#: src/SUMMARY.md src/hello-world/benefits.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md msgid "Benefits of Rust" msgstr "Rust'ın Faydaları" -#: src/SUMMARY.md src/hello-world/playground.md +#: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md msgid "Playground" msgstr "Deneme Alanı (Playground)" -#: src/SUMMARY.md src/types-and-values.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/types-and-values.md msgid "Types and Values" msgstr "Türler ve Değerler" -#: src/SUMMARY.md src/types-and-values/variables.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md msgid "Variables" msgstr "Değişkenler" -#: src/SUMMARY.md src/types-and-values/values.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md msgid "Values" msgstr "Değerler" -#: src/SUMMARY.md src/types-and-values/arithmetic.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md msgid "Arithmetic" msgstr "Aritmetik" -#: src/SUMMARY.md src/types-and-values/inference.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md msgid "Type Inference" -msgstr "Tür Çıkarımı" +msgstr "Tür Çıkarımı (Type Inference)" -#: src/SUMMARY.md src/types-and-values/exercise.md +#: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md msgid "Exercise: Fibonacci" msgstr "Alıştırma: Fibonacci" @@ -100,7 +105,7 @@ msgstr "Alıştırma: Fibonacci" #: src/control-flow-basics/solution.md src/tuples-and-arrays/solution.md #: src/references/solution.md src/user-defined-types/solution.md #: src/pattern-matching/solution.md src/methods-and-traits/solution.md -#: src/generics/solution.md src/std-types/solution.md +#: src/generics/solution.md src/std-types/solution.md src/closures/solution.md #: src/std-traits/solution.md src/memory-management/solution.md #: src/smart-pointers/solution.md src/borrowing/solution.md #: src/lifetimes/solution.md src/iterators/solution.md src/modules/solution.md @@ -109,15 +114,25 @@ msgstr "Alıştırma: Fibonacci" msgid "Solution" msgstr "Çözüm" -#: src/SUMMARY.md src/control-flow-basics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1.md src/control-flow-basics.md msgid "Control Flow Basics" msgstr "Kontrol Akışı Temelleri" +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md +msgid "Blocks and Scopes" +msgstr "Bloklar ve Kapsamlar" + #: src/SUMMARY.md msgid "`if` Expressions" msgstr "`if` İfadeleri" -#: src/SUMMARY.md src/control-flow-basics/loops.md +#: src/SUMMARY.md src/control-flow-basics/match.md +msgid "`match` Expressions" +msgstr "`match` İfadeleri" + +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md msgid "Loops" msgstr "Döngüler" @@ -137,23 +152,17 @@ msgstr "`break` ve `continue`" msgid "Labels" msgstr "Etiketler" -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes.md -msgid "Blocks and Scopes" -msgstr "Bloklar ve Kapsamlar" - -#: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "Scopes and Shadowing" -msgstr "Kapsamlar (Scopes) ve Gölgeleme (Shadowing)" - -#: src/SUMMARY.md src/control-flow-basics/functions.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/functions.md msgid "Functions" msgstr "Fonksiyonlar" -#: src/SUMMARY.md src/control-flow-basics/macros.md +#: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/macros.md msgid "Macros" msgstr "Makrolar" -#: src/SUMMARY.md src/control-flow-basics/exercise.md +#: src/SUMMARY.md src/control-flow-basics.md +#: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "Alıştırma: Collatz Sekansı" @@ -161,120 +170,153 @@ msgstr "Alıştırma: Collatz Sekansı" msgid "Day 1: Afternoon" msgstr "Gün 1: Öğleden Sonra" -#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md msgid "Tuples and Arrays" msgstr "Demetler (Tuples) ve Diziler (Arrays)" -#: src/SUMMARY.md src/tuples-and-arrays/arrays.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md msgid "Arrays" msgstr "Diziler" -#: src/SUMMARY.md src/tuples-and-arrays/tuples.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md msgid "Tuples" msgstr "Demetler" -#: src/SUMMARY.md src/tuples-and-arrays/iteration.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md msgid "Array Iteration" -msgstr "Dizi İterasyonu" +msgstr "Dizi Adımlama (Iteration)" -#: src/SUMMARY.md src/tuples-and-arrays/destructuring.md +#: src/SUMMARY.md src/tuples-and-arrays.md +#: src/tuples-and-arrays/destructuring.md msgid "Patterns and Destructuring" msgstr "Desenler ve Çözümlenme (Destructuring)" -#: src/SUMMARY.md src/tuples-and-arrays/exercise.md +#: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md msgid "Exercise: Nested Arrays" msgstr "Alıştırma: İçiçe Diziler" -#: src/SUMMARY.md src/references.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "Referanslar" -#: src/SUMMARY.md src/references/shared.md +#: src/SUMMARY.md src/references.md src/references/shared.md msgid "Shared References" -msgstr "Paylaşılan Referanslar" +msgstr "Paylaşılan (Shared) Referanslar" -#: src/SUMMARY.md src/references/exclusive.md +#: src/SUMMARY.md src/references.md src/references/exclusive.md msgid "Exclusive References" msgstr "Özel (Exclusive) Referanslar" -#: src/SUMMARY.md -msgid "Slices: `&[T]`" -msgstr "Dilimler: `&[T]`" +#: src/SUMMARY.md src/references.md src/references/slices.md +msgid "Slices" +msgstr "Dilimler (Slices)" -#: src/SUMMARY.md src/references/strings.md +#: src/SUMMARY.md src/references.md src/references/strings.md msgid "Strings" msgstr "Dizeler (Strings)" -#: src/SUMMARY.md src/references/exercise.md +#: src/SUMMARY.md src/references.md src/references/dangling.md +msgid "Reference Validity" +msgstr "Referans Geçerliliği (Validity)" + +#: src/SUMMARY.md src/references.md src/references/exercise.md msgid "Exercise: Geometry" msgstr "Alıştırma: Geometri" -#: src/SUMMARY.md src/user-defined-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-1-afternoon.md src/user-defined-types.md msgid "User-Defined Types" msgstr "Kullanıcı Tanımlı Türler" -#: src/SUMMARY.md src/user-defined-types/named-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/named-structs.md msgid "Named Structs" -msgstr "İsimli Yapılar" +msgstr "İsimli Yapılar (Named Structs)" -#: src/SUMMARY.md src/user-defined-types/tuple-structs.md +#: src/SUMMARY.md src/user-defined-types.md +#: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "Demet Yapıları (Tuple Structs)" -#: src/SUMMARY.md src/user-defined-types/enums.md -#: src/pattern-matching/destructuring.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md +#: src/pattern-matching/destructuring-enums.md msgid "Enums" msgstr "Enumlar" -#: src/SUMMARY.md -msgid "Static" -msgstr "Static" +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md +msgid "Type Aliases" +msgstr "Tür Eş İsimleri (Type Aliases)" -#: src/SUMMARY.md +#: src/SUMMARY.md src/user-defined-types.md msgid "Const" msgstr "Const" -#: src/SUMMARY.md src/user-defined-types/aliases.md -msgid "Type Aliases" -msgstr "Tür Eş İsimleri (Type Aliases)" +#: src/SUMMARY.md src/user-defined-types.md +msgid "Static" +msgstr "Static" -#: src/SUMMARY.md src/user-defined-types/exercise.md +#: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/exercise.md msgid "Exercise: Elevator Events" -msgstr "Alıştırma: Asansör Etkinlikleri" +msgstr "Alıştırma: Asansör Olayları" #: src/SUMMARY.md msgid "Day 2: Morning" msgstr "Gün 2: Sabah" -#: src/SUMMARY.md src/pattern-matching.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "Desen Eşleştirme" -#: src/SUMMARY.md src/pattern-matching/match.md +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/infallible.md +msgid "Irrefutable Patterns" +msgstr "Reddedilemez Desenler (Irrefutable Patterns)" + +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md msgid "Matching Values" -msgstr "Değerleri Eşleştirme" +msgstr "Değerleri Eşleştirmek" -#: src/SUMMARY.md src/pattern-matching/destructuring.md -msgid "Destructuring" -msgstr "Çözümlenme" +#: src/SUMMARY.md src/pattern-matching.md +msgid "Destructuring Structs" +msgstr "Yapıların (Struct) Çözümlenmesi" + +#: src/SUMMARY.md src/pattern-matching.md +msgid "Destructuring Enums" +msgstr "Enum'ların (Struct) Çözümlenmesi" -#: src/SUMMARY.md src/pattern-matching/let-control-flow.md +#: src/SUMMARY.md src/pattern-matching.md +#: src/pattern-matching/let-control-flow.md msgid "Let Control Flow" msgstr "Let'li Kontrol Akışı" -#: src/SUMMARY.md src/pattern-matching/exercise.md +#: src/SUMMARY.md src/pattern-matching/let-control-flow/if-let.md +msgid "`if let` Expressions" +msgstr "`if let` İfadeleri" + +#: src/SUMMARY.md src/pattern-matching/let-control-flow/while-let.md +msgid "`while let` Statements" +msgstr "`while let` Deyimleri" + +#: src/SUMMARY.md +msgid "`let else`" +msgstr "`let else`" + +#: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md msgid "Exercise: Expression Evaluation" msgstr "Alıştırma: İfade Değerlendirmesi" -#: src/SUMMARY.md src/methods-and-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/methods-and-traits.md msgid "Methods and Traits" msgstr "Metotlar ve Özellikler (Traits)" -#: src/SUMMARY.md src/methods-and-traits/methods.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md msgid "Methods" msgstr "Metotlar" -#: src/SUMMARY.md src/methods-and-traits/traits.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md msgid "Traits" msgstr "Özellikler (Traits)" @@ -283,7 +325,6 @@ msgid "Implementing Traits" msgstr "Özelliklerin (Traits) Gerçekleştirimi" #: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md -#, fuzzy msgid "Supertraits" msgstr "Üstözellikler (Supertraits)" @@ -291,55 +332,61 @@ msgstr "Üstözellikler (Supertraits)" msgid "Associated Types" msgstr "İlişkili Türler" -#: src/SUMMARY.md src/methods-and-traits/deriving.md +#: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/deriving.md msgid "Deriving" msgstr "Türetme" -#: src/SUMMARY.md +#: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" msgstr "Alıştırma: Genel Kaydedici" -#: src/SUMMARY.md src/generics.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2.md src/generics.md msgid "Generics" -msgstr "Jenerikler" +msgstr "Genelleştirmeler (Generics)" -#: src/SUMMARY.md src/generics/generic-functions.md +#: src/SUMMARY.md src/generics.md src/generics/generic-functions.md msgid "Generic Functions" -msgstr "Jenerik Fonksiyonlar" +msgstr "Genelleştirilmiş (Generic) Fonksiyonlar" + +#: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md +msgid "Trait Bounds" +msgstr "Özellik (Trait) Sınırları" -#: src/SUMMARY.md src/generics/generic-data.md +#: src/SUMMARY.md src/generics.md src/generics/generic-data.md msgid "Generic Data Types" -msgstr "Jenerik Veri Türleri" +msgstr "Genelleştirilmiş (Generic) Veri Türleri" #: src/SUMMARY.md src/generics/generic-traits.md msgid "Generic Traits" -msgstr "Jenerik Özellikler (Traits)" - -#: src/SUMMARY.md src/generics/trait-bounds.md -msgid "Trait Bounds" -msgstr "Özellik (Trait) Sınırları" +msgstr "Genelleştirilmiş (Generic) Özellikler (Traits)" #: src/SUMMARY.md src/generics/impl-trait.md msgid "`impl Trait`" msgstr "`impl Trait`" +#: src/SUMMARY.md src/generics/dyn-trait.md +msgid "`dyn Trait`" +msgstr "`dyn Trait`" + #: src/SUMMARY.md src/generics/exercise.md msgid "Exercise: Generic `min`" -msgstr "Alıştırma: Jenerik `min`" +msgstr "Alıştırma: Genelleştirilmiş (Generic) `min`" #: src/SUMMARY.md msgid "Day 2: Afternoon" msgstr "Gün 2: Öğleden Sonra" -#: src/SUMMARY.md src/std-types.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-types.md msgid "Standard Library Types" msgstr "Standart Kütüphane Türleri" -#: src/SUMMARY.md src/std-types/std.md +#: src/SUMMARY.md src/std-types.md src/std-types/std.md msgid "Standard Library" msgstr "Standart Kütüphane" -#: src/SUMMARY.md src/std-types/docs.md +#: src/SUMMARY.md src/std-types.md src/std-types/docs.md msgid "Documentation" msgstr "Dokümantasyon" @@ -347,7 +394,7 @@ msgstr "Dokümantasyon" msgid "`Option`" msgstr "`Option`" -#: src/SUMMARY.md +#: src/SUMMARY.md src/error-handling/result.md msgid "`Result`" msgstr "`Result`" @@ -364,19 +411,42 @@ msgstr "`Vec`" msgid "`HashMap`" msgstr "`HashMap`" -#: src/SUMMARY.md src/std-types/exercise.md +#: src/SUMMARY.md src/std-types.md src/std-types/exercise.md msgid "Exercise: Counter" msgstr "Alıştırma: Sayıcı" -#: src/SUMMARY.md src/std-traits.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/closures.md +msgid "Closures" +msgstr "Çevreleyiciler (Closures)" + +#: src/SUMMARY.md src/closures.md src/closures/syntax.md +msgid "Closure Syntax" +msgstr "Çevreleyici Sözdizimi (Closure Syntax)" + +#: src/SUMMARY.md src/closures.md src/closures/capturing.md +msgid "Capturing" +msgstr "Yakalama (Capturing)" + +#: src/SUMMARY.md src/closures.md +msgid "Closure Traits" +msgstr "Çevreleyici Özellikler (Closure Traits)" + +#: src/SUMMARY.md src/closures.md src/closures/exercise.md +msgid "Exercise: Log Filter" +msgstr "Alıştırma: Kaydedici (Log) Filtresi" + +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-2-afternoon.md src/std-traits.md msgid "Standard Library Traits" msgstr "Standart Kütüphanedeki Özellikler (Traits)" -#: src/SUMMARY.md src/std-traits/comparisons.md src/async.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md +#: src/concurrency/welcome-async.md msgid "Comparisons" msgstr "Karşılaştırmalar" -#: src/SUMMARY.md src/std-traits/operators.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md msgid "Operators" msgstr "Operatörler" @@ -384,9 +454,9 @@ msgstr "Operatörler" msgid "`From` and `Into`" msgstr "`From` ve `Into`" -#: src/SUMMARY.md src/std-traits/casting.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md msgid "Casting" -msgstr "Casting" +msgstr "Tür Çevirimi" #: src/SUMMARY.md src/std-traits/read-and-write.md msgid "`Read` and `Write`" @@ -396,11 +466,7 @@ msgstr "`Read` ve `Write`" msgid "`Default`, struct update syntax" msgstr "`Default`, yapı (struct) güncelleme sözdizimi" -#: src/SUMMARY.md src/std-traits/closures.md -msgid "Closures" -msgstr "Kapanışlar (Closures)" - -#: src/SUMMARY.md src/std-traits/exercise.md +#: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md msgid "Exercise: ROT13" msgstr "Alıştırma: ROT13" @@ -408,23 +474,24 @@ msgstr "Alıştırma: ROT13" msgid "Day 3: Morning" msgstr "Gün 3: Sabah" -#: src/SUMMARY.md src/memory-management.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "Bellek Yönetimi" -#: src/SUMMARY.md src/memory-management/review.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/review.md msgid "Review of Program Memory" msgstr "Program Belleğinin Gözden Geçirilmesi" -#: src/SUMMARY.md src/memory-management/approaches.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/approaches.md msgid "Approaches to Memory Management" msgstr "Bellek Yönetimine Yaklaşımlar" -#: src/SUMMARY.md src/memory-management/ownership.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md msgid "Ownership" msgstr "Sahiplik" -#: src/SUMMARY.md src/memory-management/move.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/move.md msgid "Move Semantics" msgstr "Taşıma Semantiği" @@ -432,7 +499,7 @@ msgstr "Taşıma Semantiği" msgid "`Clone`" msgstr "`Clone`" -#: src/SUMMARY.md src/memory-management/copy-types.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/copy-types.md msgid "Copy Types" msgstr "Kopyalanan Türler" @@ -440,11 +507,12 @@ msgstr "Kopyalanan Türler" msgid "`Drop`" msgstr "`Drop`" -#: src/SUMMARY.md src/memory-management/exercise.md +#: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md msgid "Exercise: Builder Type" msgstr "Alıştırma: İnşa Edici / Yapıcı Tür (Builder Type)" -#: src/SUMMARY.md src/smart-pointers.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "Akıllı Göstericiler" @@ -457,11 +525,11 @@ msgstr "`Box`" msgid "`Rc`" msgstr "`Rc`" -#: src/SUMMARY.md src/smart-pointers/trait-objects.md -msgid "Trait Objects" -msgstr "Özellik Nesneleri" +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/trait-objects.md +msgid "Owned Trait Objects" +msgstr "Sahipli Özellik Nesneleri (Owned Trait Objects)" -#: src/SUMMARY.md src/smart-pointers/exercise.md +#: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/exercise.md msgid "Exercise: Binary Tree" msgstr "Alıştırma: İkili Ağaç" @@ -469,43 +537,57 @@ msgstr "Alıştırma: İkili Ağaç" msgid "Day 3: Afternoon" msgstr "Gün 3: Öğleden Sonra" -#: src/SUMMARY.md src/borrowing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3-afternoon.md src/borrowing.md msgid "Borrowing" msgstr "Ödünç Alma" -#: src/SUMMARY.md src/borrowing/shared.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/shared.md msgid "Borrowing a Value" msgstr "Bir Değeri Ödünç Alma" -#: src/SUMMARY.md src/borrowing/borrowck.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/borrowck.md msgid "Borrow Checking" msgstr "Ödünç Alma Kontrolü" -#: src/SUMMARY.md src/borrowing/interior-mutability.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/examples.md +msgid "Borrow Errors" +msgstr "Ödünç Alma Hataları" + +#: src/SUMMARY.md src/borrowing.md src/borrowing/interior-mutability.md msgid "Interior Mutability" -msgstr "İç (Interior) Değiştirilebilirlik" +msgstr "İç Değişebilirlik (Interior Mutability)" + +#: src/SUMMARY.md src/borrowing/interior-mutability/cell.md +msgid "`Cell`" +msgstr "`Cell`" + +#: src/SUMMARY.md src/borrowing/interior-mutability/refcell.md +msgid "`RefCell`" +msgstr "`RefCell`" -#: src/SUMMARY.md src/borrowing/exercise.md +#: src/SUMMARY.md src/borrowing.md src/borrowing/exercise.md msgid "Exercise: Health Statistics" msgstr "Alıştırma: Sağlık İstatistikleri" -#: src/SUMMARY.md src/lifetimes.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-3-afternoon.md src/lifetimes.md msgid "Lifetimes" msgstr "Ömürler (Lifetimes)" -#: src/SUMMARY.md src/lifetimes/lifetime-annotations.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/lifetime-annotations.md msgid "Lifetime Annotations" msgstr "Ömür için Ek Açıklamalar (Annotations)" -#: src/SUMMARY.md +#: src/SUMMARY.md src/lifetimes.md msgid "Lifetime Elision" msgstr "Ömür Atlaması (Elision)" -#: src/SUMMARY.md -msgid "Struct Lifetimes" -msgstr "Yapıların Ömürleri" +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/struct-lifetimes.md +msgid "Lifetimes in Data Structures" +msgstr "Veri Yapılarında Ömürler" -#: src/SUMMARY.md src/lifetimes/exercise.md +#: src/SUMMARY.md src/lifetimes.md src/lifetimes/exercise.md msgid "Exercise: Protobuf Parsing" msgstr "Alıştırma: Protobuf Ayrıştırma" @@ -513,63 +595,78 @@ msgstr "Alıştırma: Protobuf Ayrıştırma" msgid "Day 4: Morning" msgstr "Gün 4: Sabah" -#: src/SUMMARY.md src/iterators.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/iterators.md msgid "Iterators" -msgstr "Adımlayıcıyılar (Iterators)" +msgstr "Adımlayıcılar (Iterators)" -#: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md -msgid "`Iterator`" -msgstr "`Iterator`" +#: src/SUMMARY.md src/iterators.md +msgid "Motivation" +msgstr "Motivasyon" + +#: src/SUMMARY.md src/iterators/iterator.md +msgid "`Iterator` Trait" +msgstr "`Iterator` Özelliği (Trait)" + +#: src/SUMMARY.md src/iterators/helpers.md +msgid "`Iterator` Helper Methods" +msgstr "`Iterator` Yardımcı Metotları" + +#: src/SUMMARY.md src/iterators/collect.md +msgid "`collect`" +msgstr "`collect`" #: src/SUMMARY.md src/iterators/intoiterator.md msgid "`IntoIterator`" msgstr "`IntoIterator`" -#: src/SUMMARY.md -msgid "`FromIterator`" -msgstr "`FromIterator`" - -#: src/SUMMARY.md src/iterators/exercise.md +#: src/SUMMARY.md src/iterators.md src/iterators/exercise.md msgid "Exercise: Iterator Method Chaining" msgstr "Alıştırma: Adımlayıcı Metot Zincirleme" -#: src/SUMMARY.md src/modules.md src/modules/modules.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/modules.md src/modules/modules.md msgid "Modules" msgstr "Modüller" -#: src/SUMMARY.md src/modules/filesystem.md +#: src/SUMMARY.md src/modules.md src/modules/filesystem.md msgid "Filesystem Hierarchy" msgstr "Dosya Sistemi Hiyerarşisi" -#: src/SUMMARY.md src/modules/visibility.md +#: src/SUMMARY.md src/modules.md src/modules/visibility.md msgid "Visibility" msgstr "Görünürlük" +#: src/SUMMARY.md src/modules.md +msgid "Encapsulation" +msgstr "Kapsülleme (Encapsulation)" + #: src/SUMMARY.md msgid "`use`, `super`, `self`" msgstr "`use`, `super`, `self`" -#: src/SUMMARY.md src/modules/exercise.md +#: src/SUMMARY.md src/modules.md src/modules/exercise.md msgid "Exercise: Modules for a GUI Library" msgstr "Alıştırma: Bir GUI Kütüphanesi için Modüller" -#: src/SUMMARY.md src/testing.md src/chromium/testing.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4.md src/testing.md src/chromium/testing.md msgid "Testing" msgstr "Test Etme" -#: src/SUMMARY.md -msgid "Test Modules" -msgstr "Test Modülleri" +#: src/SUMMARY.md src/testing.md src/testing/unit-tests.md +msgid "Unit Tests" +msgstr "Birim Testleri" -#: src/SUMMARY.md src/testing/other.md +#: src/SUMMARY.md src/testing.md src/testing/other.md msgid "Other Types of Tests" msgstr "Diğer Test Türleri" -#: src/SUMMARY.md src/testing/lints.md +#: src/SUMMARY.md src/testing.md src/testing/lints.md msgid "Compiler Lints and Clippy" -msgstr "Derleyicinin Tüyleri ve Clippy Aracı" +msgstr "Derleyici Tüyleri (Lint) ve Clippy Aracı" -#: src/SUMMARY.md src/testing/exercise.md +#: src/SUMMARY.md src/testing.md src/testing/exercise.md msgid "Exercise: Luhn Algorithm" msgstr "Alıştırma: Luhn Algrotiması" @@ -577,19 +674,20 @@ msgstr "Alıştırma: Luhn Algrotiması" msgid "Day 4: Afternoon" msgstr "Gün 4: Öğleden Sonra" -#: src/SUMMARY.md src/error-handling.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4-afternoon.md src/error-handling.md msgid "Error Handling" msgstr "Hata İşleme" -#: src/SUMMARY.md src/error-handling/panics.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/panics.md msgid "Panics" -msgstr "Panic'ler" +msgstr "Panikler (Panics)" -#: src/SUMMARY.md src/error-handling/try.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try.md msgid "Try Operator" msgstr "Try Operatörü" -#: src/SUMMARY.md src/error-handling/try-conversions.md +#: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md msgid "Try Conversions" msgstr "Try Dönüşümleri" @@ -597,47 +695,64 @@ msgstr "Try Dönüşümleri" msgid "`Error` Trait" msgstr "`Error` Özelliği (Trait)" -#: src/SUMMARY.md src/error-handling/thiserror-and-anyhow.md -msgid "`thiserror` and `anyhow`" -msgstr "`thiserror` ve `anyhow`" +#: src/SUMMARY.md src/error-handling/thiserror.md +msgid "`thiserror`" +msgstr "`thiserror`" + +#: src/SUMMARY.md src/error-handling/anyhow.md +msgid "`anyhow`" +msgstr "`anyhow`" #: src/SUMMARY.md msgid "Exercise: Rewriting with `Result`" msgstr "Alıştırma: `Result` ile Yeniden Yazma" -#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/welcome-day-4-afternoon.md src/unsafe-rust.md src/unsafe-rust/unsafe.md msgid "Unsafe Rust" msgstr "Emniyetsiz (Unsafe) Rust" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md msgid "Unsafe" msgstr "Emniyetsiz" -#: src/SUMMARY.md src/unsafe-rust/dereferencing.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/dereferencing.md msgid "Dereferencing Raw Pointers" msgstr "Ham Göstericilerinin İçeriği (Dereferencing)" -#: src/SUMMARY.md src/unsafe-rust/mutable-static.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/mutable-static.md msgid "Mutable Static Variables" -msgstr "Değiştirilebilir Statik Değişkenler" +msgstr "Değişebilir Statik Değişkenler" -#: src/SUMMARY.md src/unsafe-rust/unions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unions.md msgid "Unions" msgstr "Birlikler (Unions)" -#: src/SUMMARY.md src/unsafe-rust/unsafe-functions.md +#: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe-functions.md msgid "Unsafe Functions" -msgstr "Emniyetsiz Fonksiyonlar" +msgstr "Emniyetsiz (Unsafe) Fonksiyonlar" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/rust.md +msgid "Unsafe Rust Functions" +msgstr "Emniyetsiz (Unsafe) Rust Fonksiyonlar" + +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/extern-c.md +msgid "Unsafe External Functions" +msgstr "Emniyetsiz (Unsafe) Harici Fonksiyonlar" + +#: src/SUMMARY.md src/unsafe-rust/unsafe-functions/calling.md +msgid "Calling Unsafe Functions" +msgstr "Emniyetsiz (Unsafe) Fonksiyonları Çağırma" + +#: src/SUMMARY.md src/unsafe-rust.md msgid "Unsafe Traits" -msgstr "Emniyetsiz Özellikler (Traits)" +msgstr "Emniyetsiz Özellikler (Unsafe Traits)" -#: src/SUMMARY.md +#: src/SUMMARY.md src/unsafe-rust.md msgid "Exercise: FFI Wrapper" -msgstr "Alıştırma: FFI Sarıcı" +msgstr "Alıştırma: FFI Sarmalayıcı" -#: src/SUMMARY.md src/bare-metal/android.md +#: src/SUMMARY.md msgid "Android" msgstr "Android" @@ -735,15 +850,27 @@ msgstr "Kayıt Tutma (Logging)" #: src/SUMMARY.md src/android/interoperability.md msgid "Interoperability" -msgstr "Birlikte Çalışabilirlik" +msgstr "Birlikte Çalışabilirlik (Interoperability)" #: src/SUMMARY.md msgid "With C" msgstr "C ile" +#: src/SUMMARY.md src/android/interoperability/with-c/c-library.md +msgid "A Simple C Library" +msgstr "Basit bir C Kütüphanesi" + #: src/SUMMARY.md -msgid "Calling C with Bindgen" -msgstr "Bindgen ile Rust Tarafından C'yi Kullanma" +msgid "Bindgen" +msgstr "Bindgen" + +#: src/SUMMARY.md src/android/interoperability/with-c/run-our-binary.md +msgid "Running Our Binary" +msgstr "İkili Dosyamızı Çalıştırmak" + +#: src/SUMMARY.md src/android/interoperability/with-c/rust-library.md +msgid "A Simple Rust Library" +msgstr "Basit bir Rust Kütüphanesi" #: src/SUMMARY.md msgid "Calling Rust from C" @@ -789,14 +916,14 @@ msgstr "C++ Hata İşleme" msgid "Additional Types" msgstr "Ek Türler" -#: src/SUMMARY.md -msgid "Building for Android: C++" -msgstr "Android için inşa: C++" - #: src/SUMMARY.md msgid "Building for Android: Genrules" msgstr "Android için inşa: Genrules" +#: src/SUMMARY.md +msgid "Building for Android: C++" +msgstr "Android için inşa: C++" + #: src/SUMMARY.md msgid "Building for Android: Rust" msgstr "Android için inşa: Rust" @@ -805,12 +932,6 @@ msgstr "Android için inşa: Rust" msgid "With Java" msgstr "Java ile" -#: src/SUMMARY.md src/exercises/android/morning.md -#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md -#: src/exercises/concurrency/morning.md src/exercises/concurrency/afternoon.md -msgid "Exercises" -msgstr "Egzersizler" - #: src/SUMMARY.md msgid "Chromium" msgstr "Chromium" @@ -835,7 +956,8 @@ msgstr "Chromium C++'dan Rust Koduna Bağımlılık" msgid "Visual Studio Code" msgstr "Visual Studio Code" -#: src/SUMMARY.md src/exercises/chromium/third-party.md +#: src/SUMMARY.md src/lifetimes/exercise.md +#: src/exercises/chromium/third-party.md msgid "Exercise" msgstr "Alıştırma" @@ -853,7 +975,7 @@ msgstr "`chromium::import!` Makrosu" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md msgid "Interoperability with C++" -msgstr "C++ ile Birlikte Çalışabilirlik" +msgstr "C++ ile Birlikte Çalışabilirlik (Interoperability)" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md msgid "Example Bindings" @@ -944,7 +1066,7 @@ msgstr "Alıştırma Çözümleri" #: src/SUMMARY.md msgid "Bare Metal: Morning" -msgstr "Yalın Metal (Bare Metal): Sabah" +msgstr "Yalın Sistem (Bare Metal): Sabah" #: src/SUMMARY.md src/bare-metal/no_std.md msgid "`no_std`" @@ -998,18 +1120,28 @@ msgstr "Hata Ayıklama" msgid "Other Projects" msgstr "Diğer Projeler" +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/exercises/bare-metal/morning.md src/exercises/bare-metal/afternoon.md +#: src/concurrency/welcome.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async-exercises.md +msgid "Exercises" +msgstr "Alıştırmalar" + #: src/SUMMARY.md src/exercises/bare-metal/compass.md #: src/exercises/bare-metal/solutions-morning.md msgid "Compass" msgstr "Pusula" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/solutions.md msgid "Solutions" msgstr "Çözümler" #: src/SUMMARY.md msgid "Bare Metal: Afternoon" -msgstr "Yalın Metal (Bare Metal): Öğleden Sonra" +msgstr "Yalın Sistem (Bare Metal): Öğleden Sonra" #: src/SUMMARY.md msgid "Application Processors" @@ -1035,6 +1167,10 @@ msgstr "Bir UART Sürücü Yazalım" msgid "More Traits" msgstr "Daha Fazla Özellik (Trait)" +#: src/SUMMARY.md src/bare-metal/aps/safemmio/using.md +msgid "Using It" +msgstr "Onu Kullan" + #: src/SUMMARY.md msgid "A Better UART Driver" msgstr "Daha İyi Bir UART Sürücüsü" @@ -1048,17 +1184,22 @@ msgid "Multiple Registers" msgstr "Çoklu Yazmaçlar (Registers)" #: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "Driver" msgstr "Sürücü" -#: src/SUMMARY.md -msgid "Using It" -msgstr "Onu Kullan" +#: src/SUMMARY.md src/bare-metal/aps/safemmio/registers.md +msgid "safe-mmio" +msgstr "safe-mmio" -#: src/SUMMARY.md src/bare-metal/aps/exceptions.md +#: src/SUMMARY.md src/error-handling/result.md src/bare-metal/aps/exceptions.md msgid "Exceptions" msgstr "İstisnalar" +#: src/SUMMARY.md src/bare-metal/aps/aarch64-rt.md +msgid "aarch64-rt" +msgstr "aarch64-rt" + #: src/SUMMARY.md msgid "Useful Crates" msgstr "Kullanışlı Kasalar (Crates)" @@ -1083,6 +1224,10 @@ msgstr "`tinyvec`" msgid "`spin`" msgstr "`spin`" +#: src/SUMMARY.md src/bare-metal/android.md +msgid "Bare-Metal on Android" +msgstr "Android'de Yalın Sistem (Bare Metal)" + #: src/SUMMARY.md msgid "`vmbase`" msgstr "`vmbase`" @@ -1095,23 +1240,36 @@ msgstr "RTC Sürücüsü" msgid "Concurrency: Morning" msgstr "Eşzamanlılık: Sabah" -#: src/SUMMARY.md src/concurrency/threads.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/threads.md msgid "Threads" msgstr "İş Parçacıkları (Threads)" -#: src/SUMMARY.md src/concurrency/scoped-threads.md +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md +msgid "Plain Threads" +msgstr "Temel İş Parçacıkları (Plain Threads)" + +#: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/scoped.md msgid "Scoped Threads" msgstr "Kapsamlı İş Parçacıkları (Threads)" -#: src/SUMMARY.md src/concurrency/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/channels.md msgid "Channels" msgstr "Kanallar" -#: src/SUMMARY.md src/concurrency/channels/unbounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md +msgid "Senders and Receivers" +msgstr "Vericiler ve Alıcılar" + +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "Sınırsız Kanallar" -#: src/SUMMARY.md src/concurrency/channels/bounded.md +#: src/SUMMARY.md src/concurrency/channels.md +#: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "Sınırlı Kanallar" @@ -1119,6 +1277,11 @@ msgstr "Sınırlı Kanallar" msgid "`Send` and `Sync`" msgstr "`Send` ve `Sync`" +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md +msgid "Marker Traits" +msgstr "Marker Özellikleri (Traits)" + #: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" msgstr "`Send`" @@ -1127,34 +1290,39 @@ msgstr "`Send`" msgid "`Sync`" msgstr "`Sync`" -#: src/SUMMARY.md src/concurrency/send-sync/examples.md +#: src/SUMMARY.md src/concurrency/send-sync.md +#: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "Örnekler" -#: src/SUMMARY.md src/concurrency/shared_state.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome.md src/concurrency/shared-state.md msgid "Shared State" msgstr "Paylaşımlı Durum (State)" -#: src/SUMMARY.md src/concurrency/shared_state/arc.md +#: src/SUMMARY.md src/concurrency/shared-state/arc.md msgid "`Arc`" msgstr "`Arc`" -#: src/SUMMARY.md src/concurrency/shared_state/mutex.md +#: src/SUMMARY.md src/concurrency/shared-state/mutex.md msgid "`Mutex`" msgstr "`Mutex`" #: src/SUMMARY.md src/memory-management/review.md -#: src/error-handling/try-conversions.md -#: src/concurrency/shared_state/example.md +#: src/error-handling/try-conversions.md src/concurrency/shared-state.md +#: src/concurrency/shared-state/example.md msgid "Example" msgstr "Örnek" -#: src/SUMMARY.md src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises.md msgid "Dining Philosophers" msgstr "Filozofların Akşam Yemeği" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md +#: src/SUMMARY.md src/concurrency/sync-exercises.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Multi-threaded Link Checker" msgstr "Çok İş Parçacıklı Link Denetleyicisi" @@ -1162,69 +1330,84 @@ msgstr "Çok İş Parçacıklı Link Denetleyicisi" msgid "Concurrency: Afternoon" msgstr "Eşzamanlılık: Öğleden Sonra" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" msgstr "Async Temelleri" -#: src/SUMMARY.md src/async/async-await.md +#: src/SUMMARY.md src/concurrency/async/async-await.md msgid "`async`/`await`" msgstr "`async`/`await`" -#: src/SUMMARY.md src/async/futures.md +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md msgid "Futures" msgstr "Future Özellikleri (Traits)" -#: src/SUMMARY.md src/async/runtimes.md +#: src/SUMMARY.md src/concurrency/async.md +#: src/concurrency/async/state-machine.md +msgid "State Machine" +msgstr "Durum Makinesi" + +#: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md msgid "Runtimes" msgstr "Çalışma Zamanları" -#: src/SUMMARY.md src/async/runtimes/tokio.md +#: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md msgid "Tokio" msgstr "Tokio Kasası" -#: src/SUMMARY.md src/exercises/concurrency/link-checker.md src/async/tasks.md -#: src/exercises/concurrency/chat-app.md +#: src/SUMMARY.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/async.md src/concurrency/async/tasks.md +#: src/concurrency/async-exercises/chat-app.md msgid "Tasks" msgstr "Görevler" -#: src/SUMMARY.md src/async/channels.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md +msgid "Channels and Control Flow" +msgstr "Kanallar ve Kontrol Akışı" + +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/channels.md msgid "Async Channels" msgstr "Async Kanalları" -#: src/SUMMARY.md -msgid "Control Flow" -msgstr "Kontrol Akışı" - -#: src/SUMMARY.md src/async/control-flow/join.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/join.md msgid "Join" msgstr "Join" -#: src/SUMMARY.md src/async/control-flow/select.md +#: src/SUMMARY.md src/concurrency/async-control-flow.md +#: src/concurrency/async-control-flow/select.md msgid "Select" msgstr "Select" -#: src/SUMMARY.md +#: src/SUMMARY.md src/running-the-course/course-structure.md +#: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" msgstr "Tuzaklar" -#: src/SUMMARY.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" msgstr "Yürütücünün/Çalıştırıcının (Executor) Engellenmesi" -#: src/SUMMARY.md src/async/pitfalls/pin.md +#: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md msgid "`Pin`" msgstr "`Pin`" -#: src/SUMMARY.md src/async/pitfalls/async-traits.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "Async Traits" msgstr "Async Özellikleri (Traits)" -#: src/SUMMARY.md src/async/pitfalls/cancellation.md +#: src/SUMMARY.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "Cancellation" msgstr "İptal (Cancellation)" -#: src/SUMMARY.md src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/SUMMARY.md src/concurrency/async-exercises.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "Broadcast Chat Application" msgstr "Yayımlamalı Sohbet Uygulaması" @@ -1236,6 +1419,7 @@ msgstr "Son sözler" msgid "Thanks!" msgstr "Teşekkürler!" +#. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md msgid "Glossary" msgstr "Sözlük" @@ -1275,8 +1459,8 @@ msgid "" "topics like generics and error handling." msgstr "" "Bu, Google'daki Android ekibi tarafından geliştirilen ücretsiz bir Rust " -"kursudur. Kurs, temel sözdiziminden jenerikler ve hata işleme gibi ileri " -"düzey konulara kadar Rust'ın tüm yelpazesini kapsar." +"kursudur. Kurs, temel sözdiziminden genelleştirmeler (generics) ve hata " +"işleme gibi ileri düzey konulara kadar Rust'ın tüm yelpazesini kapsar." #: src/index.md msgid "" @@ -1289,7 +1473,16 @@ msgstr "" "kontrol edin." #: src/index.md -#, fuzzy +msgid "" +"The course is available in other languages. Select your preferred language " +"in the top right corner of the page or check the [Translations](running-the-" +"course/translations.md) page for a list of all available translations." +msgstr "" +"Kurs diğer dillerde de mevcuttur. Sayfanın sağ üst köşesinden tercih " +"ettiğiniz dili seçin veya tüm mevcut çevirilerin listesi için [Çeviriler]" +"(running-the-course/translations.md) sayfasını kontrol edin." + +#: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." msgstr "Kurs ayrıca [PDF olarak](comprehensive-rust.pdf) da mevcuttur." @@ -1313,7 +1506,7 @@ msgstr "" #: src/index.md msgid "Show you common Rust idioms." -msgstr "Yaygın Rust kod kaplarını göstermeyi." +msgstr "Yaygın Rust kod kalıplarını göstermeyi." #: src/index.md msgid "We call the first four course days Rust Fundamentals." @@ -1333,7 +1526,7 @@ msgid "" msgstr "" "[Android](android.md): Android platformu geliştirme (AOSP) için Rust'ın " "kullanımına ilişkin yarım günlük bir kurs. Buna C, C++ ve Java ile birlikte " -"çalışabilirlik de dahildir." +"çalışabilirlik (interoperability) de dahildir." #: src/index.md msgid "" @@ -1352,21 +1545,21 @@ msgid "" "(embedded) development. Both microcontrollers and application processors are " "covered." msgstr "" -"[Yalın-metal](bare-metal.md): Yalın metal (gömülü) geliştirme için Rust'ın " +"[Yalın-metal](bare-metal.md): Yalın sistem (gömülü) geliştirme için Rust'ın " "kullanımına ilişkin tam günlük bir ders. Hem mikrodenetleyiciler hem de " "uygulama işlemcileri kapsanmaktadır." #: src/index.md msgid "" -"[Concurrency](concurrency.md): a whole-day class on concurrency in Rust. We " -"cover both classical concurrency (preemptively scheduling using threads and " -"mutexes) and async/await concurrency (cooperative multitasking using " -"futures)." +"[Concurrency](concurrency/welcome.md): a whole-day class on concurrency in " +"Rust. We cover both classical concurrency (preemptively scheduling using " +"threads and mutexes) and async/await concurrency (cooperative multitasking " +"using futures)." msgstr "" -"[Eşzamanlılık](concurrency.md): Rust'ta eşzamanlılık üzerine tam günlük bir " -"ders. Hem klasik eşzamanlılığı (iş parçacıkları ve mutexleri kullanarak " -"kesintili/geçişli zamanlama) hem de async/await eşzamanlılığını (future " -"özelliklerini kullanarak işbirlikçi çoklu görev) ele alıyoruz." +"[Eşzamanlılık](concurrency/welcome.md): Rust'ta eşzamanlılık üzerine tam " +"günlük bir ders. Hem klasik eşzamanlılığı (iş parçacıkları ve muteksleri " +"kullanarak kesintili/geçişli zamanlama) hem de async/await eşzamanlılığını " +"(future özelliklerini kullanarak işbirlikçi çoklu görev) ele alıyoruz." #: src/index.md msgid "Non-Goals" @@ -1382,14 +1575,13 @@ msgstr "" #: src/index.md msgid "" -"Learning how to develop macros: please see [Chapter 19.5 in the Rust Book]" -"(https://doc.rust-lang.org/book/ch19-06-macros.html) and [Rust by Example]" -"(https://doc.rust-lang.org/rust-by-example/macros.html) instead." +"Learning how to develop macros: please see [the Rust Book](https://doc.rust-" +"lang.org/book/) and [Rust by Example](https://doc.rust-lang.org/rust-by-" +"example/macros.html) instead." msgstr "" "Makroların nasıl geliştirileceğini öğrenmek: lütfen bunun yerine [Rust " -"Book'ta Bölüm 19.5](https://doc.rust-lang.org/book/ch19-06-macros.html) ve " -"[Örneklerle Rust](https://doc.rust-lang.org/rust-by-example/macros.html) " -"bakınız." +"Kitabı](https://doc.rust-lang.org/book/)'na ve [Örneklerle Rust](https://doc." +"rust-lang.org/rust-by-example/macros.html)'a bakınız." #: src/index.md msgid "Assumptions" @@ -1401,9 +1593,10 @@ msgid "" "statically-typed language and we will sometimes make comparisons with C and " "C++ to better explain or contrast the Rust approach." msgstr "" -"Kurs, nasıl programlanacağını zaten bildiğinizi varsayar. Rust, statik " -"olarak türlenen bir dildir ve Rust yaklaşımını daha iyi açıklamak veya " -"karşılaştırmak için bazen C ve C++ ile karşılaştırmalar yapacağız." +"Kurs, nasıl programlanacağını zaten bildiğinizi varsayar. Rust, statik tür " +"sistemine sahip (statically-typed) bir dildir ve Rust yaklaşımını daha iyi " +"açıklamak veya karşılaştırmak için bazen C ve C++ ile karşılaştırmalar " +"yapacağız." #: src/index.md msgid "" @@ -1525,8 +1718,8 @@ msgid "" "information in the standard library." msgstr "" "İnsanların alıştırmaları kendi başlarına veya küçük gruplar halinde " -"çözmelerine izin verin. Genellikle sabah ve öğleden sonra egzersizlere 30-45 " -"dakika harcıyoruz (çözümleri gözden geçirme (review) zamanı da dahil). " +"çözmelerine izin verin. Genellikle sabah ve öğleden sonra alıştırmalara " +"30-45 dakika harcıyoruz (çözümleri gözden geçirme (review) zamanı da dahil). " "İnsanlara takılıp kalmadıklarını veya yardımcı olabileceğiniz bir konu olup " "olmadığını sorduğunuzdan emin olun. Birkaç kişinin aynı sorunu yaşadığını " "gördüğünüzde bunu sınıfa söyleyin ve bir çözüm önerin; örneğin insanlara " @@ -1571,133 +1764,133 @@ msgid "Course schedule:" msgstr "Kurs programı:" #: src/running-the-course/course-structure.md -msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" -msgstr "1. Gün Sabah (2 saat 5 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-1.md) (5 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-1.md) (5 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Hello, World](../hello-world.md) (15 minutes)" -msgstr "[Merhaba, Dünya](../hello-world.md) (15 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Types and Values](../types-and-values.md) (40 minutes)" -msgstr "[Türler ve Değerler](../types-and-values.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Control Flow Basics](../control-flow-basics.md) (40 minutes)" -msgstr "[Kontrol Akışı Temelleri](../control-flow-basics.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" -msgstr "1. Gün Öğleden Sonra (2 saat 35 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Tuples and Arrays](../tuples-and-arrays.md) (35 minutes)" -msgstr "[Demetler ve Diziler](../tuples-and-arrays.md) (35 dakika)" +msgid "Day 1 Morning (2 hours and 10 minutes, including breaks)" +msgstr "1. Gün Sabah (2 saat 10 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "[References](../references.md) (55 minutes)" -msgstr "[Referanslar](../references.md) (55 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md +#: 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 src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "Segment" +msgstr "Bölüm" -#: src/running-the-course/course-structure.md -msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" -msgstr "[Kullanıcı Tanımlı Türler](../user-defined-types.md) (50 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/hello-world.md src/types-and-values.md src/control-flow-basics.md +#: src/welcome-day-1-afternoon.md src/tuples-and-arrays.md src/references.md +#: src/user-defined-types.md src/welcome-day-2.md src/pattern-matching.md +#: src/methods-and-traits.md src/generics.md src/welcome-day-2-afternoon.md +#: src/std-types.md src/closures.md src/std-traits.md src/welcome-day-3.md +#: src/memory-management.md src/smart-pointers.md +#: src/welcome-day-3-afternoon.md src/borrowing.md src/lifetimes.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/welcome-day-4-afternoon.md src/error-handling.md src/unsafe-rust.md +#: src/concurrency/welcome.md src/concurrency/threads.md +#: src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/sync-exercises.md +#: src/concurrency/welcome-async.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "Duration" +msgstr "Süre" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/user-defined-types.md src/pattern-matching.md +#: src/generics.md src/std-types.md src/closures.md src/std-traits.md +#: src/memory-management.md src/smart-pointers.md src/lifetimes.md +#: src/iterators.md src/modules.md src/testing.md src/error-handling.md +#: src/unsafe-rust.md src/concurrency/shared-state.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "5 minutes" +msgstr "5 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/user-defined-types.md src/pattern-matching.md src/methods-and-traits.md +#: src/modules.md src/unsafe-rust.md src/concurrency/welcome.md +#: src/concurrency/threads.md src/concurrency/shared-state.md +msgid "15 minutes" +msgstr "15 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/concurrency/welcome-async.md +msgid "40 minutes" +msgstr "40 dakika" + +#: src/running-the-course/course-structure.md src/welcome-day-1.md +#: src/welcome-day-2.md src/welcome-day-4.md +msgid "45 minutes" +msgstr "45 dakika" #: src/running-the-course/course-structure.md -msgid "Day 2 Morning (2 hours and 55 minutes, including breaks)" -msgstr "2. Gün Sabah (2 saat 55 dakika, aralar dahil)" +msgid "Day 1 Afternoon (2 hours and 45 minutes, including breaks)" +msgstr "1. Gün Öğleden Sonra (2 saat 45 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-2.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-2.md) (3 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +msgid "35 minutes" +msgstr "35 dakika" -#: src/running-the-course/course-structure.md -msgid "[Pattern Matching](../pattern-matching.md) (1 hour)" -msgstr "[Desen Eşleştirme](../pattern-matching.md) (1 saat)" +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-3.md src/welcome-day-3-afternoon.md src/welcome-day-4.md +#: src/welcome-day-4-afternoon.md src/concurrency/welcome-async.md +msgid "55 minutes" +msgstr "55 dakika" -#: src/running-the-course/course-structure.md -msgid "[Methods and Traits](../methods-and-traits.md) (50 minutes)" -msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md +#: src/welcome-day-2-afternoon.md src/welcome-day-3.md +msgid "1 hour" +msgstr "1 saat" #: src/running-the-course/course-structure.md -msgid "[Generics](../generics.md) (40 minutes)" -msgstr "[Jenerikler](../generics.md) (40 dakika)" +msgid "Day 2 Morning (2 hours and 45 minutes, including breaks)" +msgstr "2. Gün Sabah (2 saat 45 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/hello-world.md +#: src/types-and-values.md src/control-flow-basics.md src/tuples-and-arrays.md +#: src/references.md src/welcome-day-2.md src/methods-and-traits.md +#: src/std-types.md src/closures.md src/welcome-day-3.md src/borrowing.md +#: src/welcome-day-4.md src/iterators.md src/modules.md src/testing.md +#: src/error-handling.md +msgid "3 minutes" +msgstr "3 dakika" -#: src/running-the-course/course-structure.md -msgid "Day 2 Afternoon (3 hours and 10 minutes, including breaks)" -msgstr "2. Gün Öğleden Sonra (3 saat 10 dakika, aralar dahil)" +#: src/running-the-course/course-structure.md src/welcome-day-2.md +#: src/welcome-day-3-afternoon.md +msgid "50 minutes" +msgstr "50 dakika" #: src/running-the-course/course-structure.md -msgid "[Standard Library Types](../std-types.md) (1 hour and 20 minutes)" -msgstr "[Standart Kütüphanedeki Türler](../std-types.md) (1 saat 20 dakika)" +msgid "Day 2 Afternoon (2 hours and 50 minutes, including breaks)" +msgstr "2. Gün Öğleden Sonra (2 saat 50 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" -msgstr "" -"[Standart Kütüphanedeki Özellikler](../std-traits.md) (1 saat 40 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md +#: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md +#: src/testing.md src/unsafe-rust.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/async-exercises.md +msgid "30 minutes" +msgstr "30 dakika" #: src/running-the-course/course-structure.md msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" msgstr "3. Gün Sabah (2 saat 20 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-3.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-3.md) (3 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Memory Management](../memory-management.md) (1 hour)" -msgstr "[Bellek Yönetimi](../memory-management.md) (1 saat)" - -#: src/running-the-course/course-structure.md -msgid "[Smart Pointers](../smart-pointers.md) (55 minutes)" -msgstr "[Akıllı Göstericiler](../smart-pointers.md) (55 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 3 Afternoon (1 hour and 50 minutes, including breaks)" -msgstr "3. Gün Öğleden Sonra (1 saat 50 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Borrowing](../borrowing.md) (50 minutes)" -msgstr "[Ödünç Alma](../borrowing.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Lifetimes](../lifetimes.md) (50 minutes)" -msgstr "[Ömürler](../lifetimes.md) (50 dakika)" - -#: src/running-the-course/course-structure.md -msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" -msgstr "4. Gün Sabah (2 saat 40 dakika, aralar dahil)" - -#: src/running-the-course/course-structure.md -msgid "[Welcome](../welcome-day-4.md) (3 minutes)" -msgstr "[Hoş Geldiniz](../welcome-day-4.md) (3 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Iterators](../iterators.md) (45 minutes)" -msgstr "[Adımlayıcılar](../iterators.md) (45 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Modules](../modules.md) (40 minutes)" -msgstr "[Modüller](../modules.md) (40 dakika)" - -#: src/running-the-course/course-structure.md -msgid "[Testing](../testing.md) (45 minutes)" -msgstr "[Test Etme](../testing.md) (45 dakika)" +msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" +msgstr "3. Gün Öğleden Sonra (1 saat 55 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "Day 4 Afternoon (2 hours and 10 minutes, including breaks)" -msgstr "4. Gün Öğleden Sonra (2 saat 10 dakika, aralar dahil)" +msgid "Day 4 Morning (2 hours and 50 minutes, including breaks)" +msgstr "4. Gün Sabah (2 saat 50 dakika, aralar dahil)" #: src/running-the-course/course-structure.md -msgid "[Error Handling](../error-handling.md) (55 minutes)" -msgstr "[Hata İşleme](../error-handling.md) (55 dakika)" +msgid "Day 4 Afternoon (2 hours and 20 minutes, including breaks)" +msgstr "4. Gün Öğleden Sonra (2 saat 20 dakika, aralar dahil)" -#: src/running-the-course/course-structure.md -msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" -msgstr "[Emniyetsiz Rust](../unsafe-rust.md) (1 saat 5 dakika)" +#: src/running-the-course/course-structure.md src/welcome-day-4-afternoon.md +msgid "1 hour and 15 minutes" +msgstr "1 saat 15 dakika" #: src/running-the-course/course-structure.md msgid "Deep Dives" @@ -1782,7 +1975,7 @@ msgstr "" #: src/running-the-course/course-structure.md msgid "Bare-Metal Rust" -msgstr "Yalın-Metal (Bare-metal) Rust" +msgstr "Yalın-Sistem (Bare-metal) Rust" #: src/running-the-course/course-structure.md msgid "" @@ -1790,7 +1983,7 @@ msgid "" "using Rust for bare-metal (embedded) development. Both microcontrollers and " "application processors are covered." msgstr "" -"[Yalın-Metal Rust](../bare-metal.md) ayrıntılı incelemesi, yalın metal " +"[Yalın-Sistem Rust](../bare-metal.md) ayrıntılı incelemesi, yalın sistem " "(gömülü) geliştirme için Rust kullanımına ilişkin tam günlük bir derstir. " "Hem mikrodenetleyiciler hem de uygulama işlemcileri kapsanmaktadır." @@ -1812,11 +2005,12 @@ msgstr "Rust'ta Eşzamanlılık" #: src/running-the-course/course-structure.md msgid "" -"The [Concurrency in Rust](../concurrency.md) deep dive is a full day class " -"on classical as well as `async`/`await` concurrency." +"The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " +"class on classical as well as `async`/`await` concurrency." msgstr "" -"[Rust'ta Eşzamanlılık](../concurrency.md) ayrıntılı incelemesi, klasik ve " -"aynı zamanda `async`/`await` eşzamanlılığı üzerine tam günlük bir derstir." +"[Rust'ta Eşzamanlılık](../concurrency/welcome.md) ayrıntılı incelemesi, " +"klasik ve aynı zamanda `async`/`await` eşzamanlılığı üzerine tam günlük bir " +"derstir." #: src/running-the-course/course-structure.md msgid "" @@ -1828,6 +2022,31 @@ msgstr "" "hazır hale getirilmesine ihtiyacınız olacak. Daha sonra örnekleri denemek " "için kopyalayıp `src/main.rs` dosyasına yapıştırabilirsiniz:" +#: src/running-the-course/course-structure.md +msgid "Morning (3 hours and 20 minutes, including breaks)" +msgstr "Sabah (3 saat 20 dakika, aralar dahil)" + +#: src/running-the-course/course-structure.md src/references.md +#: src/std-types.md src/memory-management.md src/borrowing.md +#: src/error-handling.md src/concurrency/welcome.md +#: src/concurrency/sync-exercises.md src/concurrency/welcome-async.md +#: src/concurrency/async-pitfalls.md src/concurrency/async-exercises.md +msgid "20 minutes" +msgstr "20 dakika" + +#: src/running-the-course/course-structure.md src/concurrency/welcome.md +msgid "Send and Sync" +msgstr "Send ve Sync" + +#: src/running-the-course/course-structure.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md +msgid "1 hour and 10 minutes" +msgstr "1 saat 10 dakika" + +#: src/running-the-course/course-structure.md +msgid "Afternoon (3 hours and 30 minutes, including breaks)" +msgstr "Öğleden Sonra (3 saat 30 dakika, aralar dahil)" + #: src/running-the-course/course-structure.md msgid "Format" msgstr "Format" @@ -1845,36 +2064,20 @@ msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "Bu mdBook'ta birkaç kullanışlı klavye kısayolu vardır:" #: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Left" -msgstr "Yön Oku-Sol" +msgid "Arrow-Left: Navigate to the previous page." +msgstr "Arrow-Left: Önceki sayfaya gidin." #: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the previous page." -msgstr ": Önceki sayfaya gidin." +msgid "Arrow-Right: Navigate to the next page." +msgstr "Arrow-Right: Sonraki sayfaya gidin." #: src/running-the-course/keyboard-shortcuts.md -msgid "Arrow-Right" -msgstr "Yön Oku-Sağ" +msgid "Ctrl + Enter: Execute the code sample that has focus." +msgstr "Ctrl + Enter: Odaklı kod örneğini yürütün." #: src/running-the-course/keyboard-shortcuts.md -msgid ": Navigate to the next page." -msgstr ": Sonraki sayfaya gidin." - -#: src/running-the-course/keyboard-shortcuts.md src/cargo/code-samples.md -msgid "Ctrl + Enter" -msgstr "Ctrl + Enter" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Execute the code sample that has focus." -msgstr ": Odaklı kod örneğini yürütün." - -#: src/running-the-course/keyboard-shortcuts.md -msgid "s" -msgstr "s" - -#: src/running-the-course/keyboard-shortcuts.md -msgid ": Activate the search bar." -msgstr ": Arama çubuğunu etkinleştirin." +msgid "s: Activate the search bar." +msgstr "s: Arama çubuğunu etkinleştirin." #: src/running-the-course/translations.md msgid "" @@ -1900,8 +2103,7 @@ msgid "" "by [@suetfei](https://github.com/suetfei), [@wnghl](https://github.com/" "wnghl), [@anlunx](https://github.com/anlunx), [@kongy](https://github.com/" "kongy), [@noahdragon](https://github.com/noahdragon), [@superwhd](https://" -"github.com/superwhd), [@SketchK](https://github.com/SketchK), and [@nodmp]" -"(https://github.com/nodmp)." +"github.com/superwhd), @SketchK, and [@nodmp](https://github.com/nodmp)." msgstr "" "[Çince (Basitleştirilmiş)](https://google.github.io/comprehensive-rust/zh-" "CN/) yazanlar: [@suetfei](https://github.com/suetfei), [@wnghl](https://" @@ -1926,13 +2128,39 @@ msgstr "" #: src/running-the-course/translations.md msgid "" -"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" +"[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@DannyRavi]" +"(https://github.com/DannyRavi), [@javad-jafari](https://github.com/javad-" +"jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi](https://" +"github.com/moaminsharifi) , [@hamidrezakp](https://github.com/hamidrezakp) " +"and [@mehrad77](https://github.com/mehrad77)." +msgstr "" +"[Farsça](https://google.github.io/comprehensive-rust/fa/) yazanlar: " +"[@DannyRavi](https://github.com/DannyRavi), [@javad-jafari](https://github." +"com/javad-jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi]" +"(https://github.com/moaminsharifi), [@hamidrezakp](https://github.com/" +"hamidrezakp) ve [@mehrad77](https://github.com/mehrad77)." + +#: src/running-the-course/translations.md +msgid "" +"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" +"(https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) " +"and [@kantasv](https://github.com/kantasv)." +msgstr "" +"[Japonca](https://google.github.io/comprehensive-rust/ja/) yazanlar: " +"[@CoinEZ-JPN](https://github.com/CoinEZ), [@momotaro1105](https://github.com/" +"momotaro1105), [@HidenoriKobayashi](https://github.com/HidenoriKobayashi) ve " +"[@kantasv](https://github.com/kantasv)." + +#: src/running-the-course/translations.md +msgid "" +"[Korean](https://google.github.io/comprehensive-rust/ko/) by [@keispace]" "(https://github.com/keispace), [@jiyongp](https://github.com/jiyongp), " "[@jooyunghan](https://github.com/jooyunghan), and [@namhyung](https://github." "com/namhyung)." msgstr "" "[Korece](https://google.github.io/comprehensive-rust/ko/) yazanlar: " -"[@keispace](https://github.com/keispace), [@jiyongp](https://github.com) /" +"[@keispace](https://github.com/keispace), [@jiyongp](https://github.com/" "jiyongp), [@jooyunghan](https://github.com/jooyunghan) ve [@namhyung]" "(https://github.com/namhyung)." @@ -1944,6 +2172,16 @@ msgstr "" "[Bengalce](https://google.github.io/comprehensive-rust/bn/) yazanlar: " "[@raselmandol](https://github.com/raselmandol)." +#: src/running-the-course/translations.md +msgid "" +"[Ukrainian](https://google.github.io/comprehensive-rust/uk/) by [@git-user-" +"cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) and [@reta](https://github.com/reta)." +msgstr "" +"[Ukraynaca](https://google.github.io/comprehensive-rust/uk/) yazanlar: [@git-" +"user-cpp](https://github.com/git-user-cpp), [@yaremam](https://github.com/" +"yaremam) ve [@reta](https://github.com/reta)." + #: src/running-the-course/translations.md msgid "" "Use the language picker in the top-right corner to switch between languages." @@ -1962,6 +2200,14 @@ msgstr "" "Devam eden çok sayıda çeviri var. En son güncellenen çevirilere bağlantı " "veriyoruz:" +#: src/running-the-course/translations.md +msgid "" +"[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" +"(https://github.com/younies)" +msgstr "" +"[Arapça](https://google.github.io/comprehensive-rust/ar/) yazanlar: " +"[@younies](https://github.com/younies)" + #: src/running-the-course/translations.md msgid "" "[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" @@ -1973,10 +2219,12 @@ msgstr "" #: src/running-the-course/translations.md msgid "" "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" -"(https://github.com/KookaS) and [@vcaen](https://github.com/vcaen)." +"(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" "[Fransızca](https://google.github.io/comprehensive-rust/fr/) yazanlar: " -"[@KookaS](https://github.com/KookaS) ve [@vcaen](https://github.com) /vcaen)." +"[@KookaS](https://github.com/KookaS), [@vcaen](https://github.com/vcaen) ve " +"[@AdrienBaudemont](https://github.com/AdrienBaudemont)." #: src/running-the-course/translations.md msgid "" @@ -1984,19 +2232,9 @@ msgid "" "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" "[Almanca](https://google.github.io/comprehensive-rust/de/) yazanlar: " -"[@Throvn](https://github.com/Throvn) ve [@ronaldfw](https://github.com) /" +"[@Throvn](https://github.com/Throvn) ve [@ronaldfw](https://github.com/" "ronaldfw)." -#: src/running-the-course/translations.md -msgid "" -"[Japanese](https://google.github.io/comprehensive-rust/ja/) by [@CoinEZ-JPN]" -"(https://github.com/CoinEZ) and [@momotaro1105](https://github.com/" -"momotaro1105)." -msgstr "" -"[Japonca](https://google.github.io/comprehensive-rust/ja/) yazanlar: " -"[@CoinEZ-JPN](https://github.com/CoinEZ) ve [@momotaro1105](https://github) ." -"com/momotaro1105)." - #: src/running-the-course/translations.md msgid "" "[Italian](https://google.github.io/comprehensive-rust/it/) by " @@ -2007,6 +2245,19 @@ msgstr "" "[@henrythebuilder](https://github.com/henrythebuilder) ve [@detro](https://" "github.com/detro)." +#: src/running-the-course/translations.md +msgid "" +"The full list of translations with their current status is also available " +"either [as of their last update](https://google.github.io/comprehensive-rust/" +"translation-report.html) or [synced to the latest version of the course]" +"(https://google.github.io/comprehensive-rust/synced-translation-report.html)." +msgstr "" +"Çevirilerin tam listesi ve güncel durumları [son güncelleme tarihi " +"itibarıyla](https://google.github.io/comprehensive-rust/translation-report." +"html) veya [kursun en son sürümüyle senkronize edilmiş olarak](https://" +"google.github.io/comprehensive-rust/synced-translation-report.html) da " +"mevcuttur." + #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" @@ -2050,7 +2301,7 @@ msgstr "" "Bu size Cargo oluşturma aracını (`cargo`) ve Rust derleyicisini (`rustc`) " "sağlayacaktır. Ayrıca, araç zincirlerini (toolchain) kurmak/değiştirmek, " "çapraz derlemeyi ayarlamak vb. için kullanabileceğiniz bir komut satırı " -"yardımcı programı olan `rustup` a sahip olacaksınız." +"yardımcı programı olan `rustup`'a sahip olacaksınız." #: src/cargo.md msgid "" @@ -2065,23 +2316,33 @@ msgstr "" "Rust'u kurduktan sonra editörünüzü/düzenleyicinizi veya IDE'nizi Rust ile " "çalışacak şekilde yapılandırmalısınız. Çoğu editör bunu, [VS Code](https://" "code.visualstudio.com/), [Emacs](https://rust-analyzer.github.io/manual." -"html#emacs), [Vim/Neovim](https://rust-analyzer.github.io/manual. " -"html#vimneovim) ve diğerleri için otomatik tamamlama ve tanıma atlama işlevi " -"sağlayan [rust-analyzer](https://rust-analyzer.github.io/) ile haberleşerek " -"yapar. Ayrıca [RustRover](https://www.jetbrains.com/rust/) adında farklı bir " -"IDE de mevcuttur." +"html#emacs), [Vim/Neovim](https://rust-analyzer.github.io/manual." +"html#vimneovim) ve diğerleri için otomatik tamamlama ve tanıma atlama " +"işlevselliği sağlayan [rust-analyzer](https://rust-analyzer.github.io/) ile " +"haberleşerek yapar. Ayrıca [RustRover](https://www.jetbrains.com/rust/) " +"adında farklı bir IDE de mevcuttur." #: src/cargo.md msgid "" "On Debian/Ubuntu, you can also install Cargo, the Rust source and the [Rust " "formatter](https://github.com/rust-lang/rustfmt) via `apt`. However, this " -"gets you an outdated rust version and may lead to unexpected behavior. The " +"gets you an outdated Rust version and may lead to unexpected behavior. The " "command would be:" msgstr "" -"Debian/Ubuntu'da ayrıca Cargo'yu, Rust kaynak kodunu ve [Rust " -"biçimlendiriciyi](https://github.com/rust-lang/rustfmt) `apt` aracılığıyla " -"yükleyebilirsiniz. Ancak bu, eski bir Rust sürümüne sahip olmanızı sağlar ve " -"beklenmeyen davranışlara yol açabilir. Komut şöyle olacaktır:" +"Debian/Ubuntu'da ayrıca `apt` aracılığıyla Cargo'yu, Rust kaynak kodunu ve " +"[Rust biçimlendiricisini (formatter)](https://github.com/rust-lang/rustfmt) " +"kurabilirsiniz. Ancak bu size eski bir Rust sürümü verir ve beklenmeyen " +"davranışlara yol açabilir. Komut şu şekilde olacaktır:" + +#: src/cargo.md +msgid "" +"On macOS, you can use [Homebrew](https://brew.sh/) to install Rust, but this " +"may provide an outdated version. Therefore, it is recommended to install " +"Rust from the official site." +msgstr "" +"Mac işletim sisteminde Rust'ı yüklemek için [Homebrew](https://brew.sh/)'i " +"kullanabilirsiniz, ancak bu eski bir sürüm sağlayabilir. Bu nedenle Rust'ı " +"resmi sitesinden kurmanız önerilir." #: src/cargo/rust-ecosystem.md msgid "The Rust Ecosystem" @@ -2130,9 +2391,9 @@ msgstr "" "yapmanıza olanak tanır." #: 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 +#: src/references/exclusive.md src/memory-management/move.md +#: src/error-handling/try.md src/unsafe-rust/unsafe-functions/calling.md +#: src/android/setup.md src/concurrency/async/async-await.md msgid "Key points:" msgstr "Anahtar noktalar:" @@ -2173,11 +2434,12 @@ msgstr "" #: src/cargo/rust-ecosystem.md msgid "" "Rust also has [editions](https://doc.rust-lang.org/edition-guide/): the " -"current edition is Rust 2021. Previous editions were Rust 2015 and Rust 2018." +"current edition is Rust 2024. Previous editions were Rust 2015, Rust 2018 " +"and Rust 2021." msgstr "" "Rust'ın ayrıca [yayınları](https://doc.rust-lang.org/edition-guide/) " -"(editions) vardır: mevcut yayın (edition) Rust 2021'dir. Önceki yayınlar " -"Rust 2015 ve Rust 2018'di." +"(editions) vardır: mevcut yayın (edition) Rust 2024'dür. Önceki yayınlar " +"Rust 2015, Rust 2018 ve Rust 2021'di." #: src/cargo/rust-ecosystem.md msgid "" @@ -2276,9 +2538,9 @@ msgid "" "which can be executed through your browser. This makes the setup much easier " "and ensures a consistent experience for everyone." msgstr "" -"Bu eğitimde çoğunlukla Rust dilini tarayıcınız üzerinden " -"çalıştırabileceğiniz örnekler üzerinden inceleyeceğiz. Bu, kurulumu çok daha " -"kolay hale getirir ve herkes için tutarlı bir deneyim sağlar." +"Bu eğitimde çoğunlukla Rust dilini tarayıcınız üzerinden yürütebileceğiniz " +"örnekler üzerinden inceleyeceğiz. Bu, kurulumu çok daha kolay hale getirir " +"ve herkes için tutarlı bir deneyim sağlar." #: src/cargo/code-samples.md msgid "" @@ -2286,7 +2548,7 @@ msgid "" "the exercises. On the last day, we will do a larger exercise which shows you " "how to work with dependencies and for that you need Cargo." msgstr "" -"Cargo'nun kurulumu hala teşvik edilmektedir: egzersizleri yapmanızı " +"Cargo'nun kurulumu hala teşvik edilmektedir: alıştırmaları yapmanızı " "kolaylaştıracaktır. Son gün, bağımlılıklarla nasıl çalışacağınızı ve bunun " "için Cargo'ya ihtiyacınız olduğunu gösteren daha büyük bir alıştırma " "yapacağız." @@ -2300,12 +2562,12 @@ msgid "\"Edit me!\"" msgstr "\"Düzenle beni!\"" #: src/cargo/code-samples.md -msgid "You can use " -msgstr "Odak metin kutusundayken kodu yürütmek için " - -#: src/cargo/code-samples.md -msgid " to execute the code when focus is in the text box." -msgstr " kullanabilirsiniz.." +msgid "" +"You can use Ctrl + Enter to execute the code when focus is in the " +"text box." +msgstr "" +"Metin kutusu odaklanmışken kodu çalıştırmak için Ctrl + Enter " +"tuşlarını kullanabilirsiniz." #: src/cargo/code-samples.md msgid "" @@ -2320,7 +2582,7 @@ msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." msgstr "" -"Gömülü deneme alanları (playgrounds) birim testleri gerçekleştiremez. Birim " +"Gömülü deneme alanları (playgrounds) birim testlerini yürütemez. Birim " "testlerini göstermek için kodu kopyalayıp yapıştırın ve gerçek Deneme " "Alanında (Playground) açın." @@ -2456,7 +2718,7 @@ msgstr "" #: src/welcome-day-1.md msgid "Types and type inference." -msgstr "Türler ve tür çıkarımı." +msgstr "Türler ve tür çıkarımı (inference)." #: src/welcome-day-1.md msgid "Control flow constructs: loops, conditionals, and so on." @@ -2467,46 +2729,19 @@ msgid "User-defined types: structs and enums." msgstr "" "Kullanıcı tanımlı türler: yapılar (structs) ve numaralandırmalar (enums)" -#: src/welcome-day-1.md -msgid "Pattern matching: destructuring enums, structs, and arrays." -msgstr "" -"Desen eşleştirme: numaralandırmaların (enums), yapıların ve dizilerin " -"çözümlenmesi (destructuring)." - #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md -#: src/welcome-day-4.md +#: src/welcome-day-4.md src/concurrency/welcome.md +#: src/concurrency/welcome-async.md msgid "Schedule" msgstr "Zamanlama (Schedule)" -#: src/welcome-day-1.md src/welcome-day-1-afternoon.md src/welcome-day-2.md -#: 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:" -msgstr "Bu oturumda:" - -#: src/welcome-day-1.md -msgid "[Welcome](./welcome-day-1.md) (5 minutes)" -msgstr "[Hoş Geldiniz](./welcome-day-1.md) (5 dakika)" - -#: src/welcome-day-1.md -msgid "[Hello, World](./hello-world.md) (15 minutes)" -msgstr "[Merhaba, Dünya](./hello-world.md) (15 dakika)" - -#: src/welcome-day-1.md -msgid "[Types and Values](./types-and-values.md) (40 minutes)" -msgstr "[Türler ve Değerler](./types-and-values.md) (40 dakika)" - -#: src/welcome-day-1.md -msgid "[Control Flow Basics](./control-flow-basics.md) (40 minutes)" -msgstr "[Kontrol Akışı Temelleri](./control-flow-basics.md) (40 dakika)" - #: src/welcome-day-1.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 5 " -"minutes" +"Including 10 minute breaks, this session should take about 2 hours and 10 " +"minutes. It contains:" msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 5 dakika sürecektir" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 10 dakika sürmelidir. " +"İçeriği:" #: src/welcome-day-1.md msgid "Please remind the students that:" @@ -2550,7 +2785,7 @@ msgid "" "Remember that the slides are just a support and you are free to skip them as " "you like." msgstr "" -"Bu kesinlikle sorun değil! Tekrar etkemk, öğrenmenin önemli bir parçasıdır. " +"Bu kesinlikle sorun değil! Tekrar etmek, öğrenmenin önemli bir parçasıdır. " "Slaytların sadece bir destek olduğunu ve istediğiniz gibi atlamakta özgür " "olduğunuzu unutmayın." @@ -2574,34 +2809,43 @@ msgid "" msgstr "" "Eğer bunu bir sınıfta öğretiyorsanız, burası programın üzerinden geçmek için " "iyi bir yerdir. Her bölümün sonunda bir alıştırma ve ardından bir ara " -"olduğunu unutmayın. Aradan sonra egzersiz çözümünü tamamlamayı planlayın. " +"olduğunu unutmayın. Aradan sonra alıştırma çözümünü tamamlamayı planlayın. " "Burada listelenen zamanlar kursun programa uygun devam etmesi için bir " "öneridir. Esnek olmaktan ve gerektiği gibi ayarlamaktan çekinmeyin!" +#: src/hello-world.md src/concurrency/send-sync.md +msgid "This segment should take about 15 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 15 dakika sürmelidir. İçeriği:" + #: src/hello-world.md src/types-and-values.md src/control-flow-basics.md #: 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/std-types.md src/closures.md src/std-traits.md src/memory-management.md #: 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 "In this segment:" -msgstr "Bu bölümde:" - -#: src/hello-world.md -msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" -msgstr "[Rust Nedir?](./hello-world/what-is-rust.md) (10 dakika)" - -#: src/hello-world.md -msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" -msgstr "[Rust'ın Faydaları](./hello-world/benefits.md) (3 dakika)" - -#: src/hello-world.md -msgid "[Playground](./hello-world/playground.md) (2 minutes)" -msgstr "[Deneme Alanı](./hello-world/playground.md) (2 dakika)" - -#: src/hello-world.md -msgid "This segment should take about 15 minutes" -msgstr "Bu bölüm yaklaşık 15 dakika sürecektir" +#: src/concurrency/threads.md src/concurrency/channels.md +#: src/concurrency/send-sync.md src/concurrency/shared-state.md +#: src/concurrency/sync-exercises.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +#: src/concurrency/async-exercises.md +msgid "Slide" +msgstr "Slayt" + +#: src/hello-world.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/closures.md src/memory-management.md +#: src/smart-pointers.md src/borrowing.md src/lifetimes.md src/modules.md +#: src/unsafe-rust.md src/concurrency/channels.md src/concurrency/send-sync.md +#: src/concurrency/shared-state.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md src/concurrency/async-pitfalls.md +msgid "10 minutes" +msgstr "10 dakika" + +#: src/hello-world.md src/control-flow-basics.md src/user-defined-types.md +#: src/memory-management.md src/concurrency/channels.md +#: src/concurrency/send-sync.md +msgid "2 minutes" +msgstr "2 dakika" #: src/hello-world/what-is-rust.md msgid "" @@ -2613,7 +2857,7 @@ msgstr "" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" -msgstr "Rust, C++ ile benzer role sahip statik olarak derlenmiş bir dildir" +msgstr "Rust, C++ ile benzer role sahip statik olarak derlenen bir dildir" #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." @@ -2694,7 +2938,7 @@ msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" -"_Derleme zamanı bellek güvenliği_ - derleme zamanında tüm bellek hataları " +"_Derleme zamanı bellek emniyeti_ - derleme zamanında tüm bellek hataları " "sınıfları önlenir" #: src/hello-world/benefits.md @@ -2703,7 +2947,7 @@ msgstr "İlklendirilmemiş değişken yok." #: src/hello-world/benefits.md msgid "No double-frees." -msgstr "Double free ((adresi iki kez serbest bırakma)) yok." +msgstr "Adresi iki kez serbest bırakma (double free) yok." #: src/hello-world/benefits.md msgid "No use-after-free." @@ -2715,7 +2959,7 @@ msgstr "`NULL` göstericileri yok." #: src/hello-world/benefits.md msgid "No forgotten locked mutexes." -msgstr "Unutulan kilitli muteksler yok." +msgstr "Kilitli halde unutulmuş hiçbir mutex yok." #: src/hello-world/benefits.md msgid "No data races between threads." @@ -2723,7 +2967,7 @@ msgstr "İş parçacıkları (threads) arasında veri yarışları (data races) #: src/hello-world/benefits.md msgid "No iterator invalidation." -msgstr "Adımlayıcıyı (iterator) geçersiz kılma (invalidation) yok." +msgstr "Adımlayıcıyının (iterator) geçersiz kılınması (invalidation) yok." #: src/hello-world/benefits.md msgid "" @@ -2739,7 +2983,7 @@ msgstr "Dizi erişiminde sınırlar kontrol edilir." #: src/hello-world/benefits.md msgid "Integer overflow is defined (panic or wrap-around)." -msgstr "Tamsayı taşması tanımlandı (panic veya wrap-around)." +msgstr "Tamsayı taşması tanımlıdır (panic veya wrap-around)." #: src/hello-world/benefits.md msgid "" @@ -2754,7 +2998,7 @@ msgstr "Numaralandırmalar (Enums) ve desen eşleştirme." #: src/hello-world/benefits.md msgid "Generics." -msgstr "Jenerikler." +msgstr "Genelleştirmeler (Generics)." #: src/hello-world/benefits.md msgid "No overhead FFI." @@ -2766,7 +3010,7 @@ msgstr "Sıfır maliyetli soyutlamalar." #: src/hello-world/benefits.md msgid "Great compiler errors." -msgstr "Mükemmel derleyici hatala mesajları." +msgstr "Mükemmel derleyici hata mesajları." #: src/hello-world/benefits.md msgid "Built-in dependency manager." @@ -2806,22 +3050,22 @@ msgstr "" "C veya C++ deneyimi: Rust, ödünç alma denetleyicisi (borrow checker) " "aracılığıyla tüm _çalışma zamanı hatalarını(runtime errors)_ ortadan " "kaldırır. C ve C++'daki gibi performans elde edersiniz bununla birlikte " -"bellek güvenliği sorunları yaşamazsınız. Ayrıca desen eşleştirme (pattern " -"matching) ve yerleşik bağımlılık yönetimi (dependency management) gibi " -"yapılara sahip modern bir dil elde edersiniz." +"bellek emniyetsizliği sorunları yaşamazsınız. Ayrıca desen eşleştirme " +"(pattern matching) ve yerleşik bağımlılık yönetimi (dependency management) " +"gibi yapılara sahip modern bir dil elde edersiniz." #: src/hello-world/benefits.md msgid "" "Experience with Java, Go, Python, JavaScript...: You get the same memory " "safety as in those languages, plus a similar high-level language feeling. In " "addition you get fast and predictable performance like C and C++ (no garbage " -"collector) as well as access to low-level hardware (should you need it)" +"collector) as well as access to low-level hardware (should you need it)." msgstr "" -"Java, Go, Python, JavaScript... deneyimi: Bu dillerdekiyle aynı bellek " -"emniyetine (safety) ve ayrıca benzer yüksek seviyeli dil hissine sahip " -"olursunuz. Ayrıca, C ve C++ (çöp toplayıcı yok) gibi hızlı ve öngörülebilir " -"performansın yanı sıra düşük seviyeli donanıma erişim (ihtiyaç duymanız " -"halinde) elde edersiniz." +"Java, Go, Python, JavaScript... ile deneyim: Bu dillerdekiyle aynı bellek " +"emniyetine (safety) ve benzer bir yüksek seviyeli dil hissini elde " +"edersiniz. Ayrıca C ve C++ gibi hızlı ve öngörülebilir performans (çöp " +"toplayıcı yok) ve düşük seviyeli donanıma erişim (ihtiyaç duymanız halinde) " +"elde edersiniz." #: src/hello-world/playground.md msgid "" @@ -2877,34 +3121,9 @@ msgstr "" "oluşturulan asm kodu hakkında daha fazla bilgi edinmek isteyen ileri düzey " "öğrenciler için faydalıdır." -#: src/types-and-values.md -msgid "[Hello, World](./types-and-values/hello-world.md) (5 minutes)" -msgstr "[Merhaba, Dünya](./types-and-values/hello-world.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Variables](./types-and-values/variables.md) (5 minutes)" -msgstr "[Değişkenler](./types-and-values/variables.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Values](./types-and-values/values.md) (5 minutes)" -msgstr "[Değerler](./types-and-values/values.md) (5 dakika)" - -#: src/types-and-values.md -msgid "[Arithmetic](./types-and-values/arithmetic.md) (3 minutes)" -msgstr "[Aritmetik](./types-and-values/arithmetic.md) (3 dakika)" - -#: src/types-and-values.md -msgid "[Type Inference](./types-and-values/inference.md) (3 minutes)" -msgstr "[Tür Çıkarımı](./types-and-values/inference.md) (3 dakika)" - -#: src/types-and-values.md -msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (15 minutes)" -msgstr "[Alıştırma: Fibonacci](./types-and-values/exercise.md) (15 dakika)" - -#: src/types-and-values.md src/control-flow-basics.md src/generics.md -#: src/modules.md -msgid "This segment should take about 40 minutes" -msgstr "Bu bölüm yaklaşık 40 dakika sürecektir" +#: src/types-and-values.md src/concurrency/async.md +msgid "This segment should take about 40 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 40 dakika sürmelidir. İçeriği:" #: src/types-and-values/hello-world.md msgid "" @@ -2926,14 +3145,18 @@ msgstr "Ne görüyorsunuz:" msgid "Functions are introduced with `fn`." msgstr "Fonksiyonlar `fn` ile tanıtılır." +#: src/types-and-values/hello-world.md +msgid "The `main` function is the entry point of the program." +msgstr "`main` fonksiyon programın giriş noktasıdır (entry point)." + #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "" "Bloklar, C ve C++'daki gibi küme parantezleriyle sınırları belirlenmiştir." #: src/types-and-values/hello-world.md -msgid "The `main` function is the entry point of the program." -msgstr "'main' fonksiyon programın giriş noktasıdır (entry point)." +msgid "Statements end with `;`." +msgstr "Deyimler (Statements) `;` ile biter." #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." @@ -2977,8 +3200,8 @@ msgid "" "arguments (no function [overloading](../control-flow-basics/functions.md))." msgstr "" "Rust, değişken sayıda argümana sahip olmak istediğiniz durumlar için " -"makroları kullanır (fonksiyon [yüklemesi](../control-flow-basics/functions." -"md) yoktur)." +"makroları kullanır (fonksiyon [yüklemesi (overloading)](../control-flow-" +"basics/functions.md) yoktur)." #: src/types-and-values/hello-world.md msgid "" @@ -2989,8 +3212,8 @@ msgid "" msgstr "" "Makroların 'arınmış/pak' olması, kullanıldıkları kapsamdaki (scope) " "tanımlayıcıları (identifiers) yanlışlıkla yakalamadıkları anlamına gelir. " -"Rust makroları aslında yalnızca [kısmen hijyeniktir](https://veykril.github." -"io/tlborm/decl-macros/minutiae/hygiene.html)." +"Rust makroları aslında yalnızca [kısmi paktır (hygienic)](https://veykril." +"github.io/tlborm/decl-macros/minutiae/hygiene.html)." #: src/types-and-values/hello-world.md msgid "" @@ -3009,11 +3232,10 @@ msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" -"Rust, statik tür özelliğine sahip olmasıyla tür güvenliği sağlar. Değişken " +"Rust, statik tür sistemine sahip olmasıyla tür emniyeti sağlar. Değişken " "bağlamaları (binding) `let` ile yapılır:" -#: src/types-and-values/variables.md src/control-flow-basics/loops/for.md -#: src/control-flow-basics/blocks-and-scopes.md +#: src/types-and-values/variables.md msgid "\"x: {x}\"" msgstr "\"x: {x}\"" @@ -3030,9 +3252,20 @@ msgid "" "Uncomment the `x = 20` to demonstrate that variables are immutable by " "default. Add the `mut` keyword to allow changes." msgstr "" -"Değişkenlerin varsayılan olarak değişmez (immutable) olduğunu göstermek için " -"`x = 20`'in yorum satırını kaldırın. Değişikliklere izin vermek için `mut` " -"anahtar kelimesini ekleyin." +"Değişkenlerin varsayılan olarak değiştirilemez (immutable) olduğunu " +"göstermek için `x = 20`'in yorum satırını kaldırın. Değişikliklere izin " +"vermek için `mut` anahtar kelimesini ekleyin." + +#: src/types-and-values/variables.md +msgid "" +"Warnings are enabled for this slide, such as for unused variables or " +"unnecessary `mut`. These are omitted in most slides to avoid distracting " +"warnings. Try removing the mutation but leaving the `mut` keyword in place." +msgstr "" +"Bu slayt için kullanılmayan değişkenler veya gereksiz `mut` gibi uyarılar " +"(warnings) etkinleştirildi. Dikkat dağıtan uyarılardan kaçınmak için çoğu " +"slaytta bunlar atlanır. Atamayı içeren yorum satırını kaldırmayı deneyin, " +"ancak `mut` anahtar sözcüğünü yerinde kalmaya devam etsin." #: src/types-and-values/variables.md msgid "" @@ -3041,8 +3274,8 @@ msgid "" "many cases." msgstr "" "Buradaki `i32` değişkenin türüdür. Bunun derleme zamanında bilinmesi " -"gerekir, ancak tür çıkarımı (daha sonra ele alınacaktır), programcının " -"birçok durumda bunu atlamasına olanak tanır." +"gerekir, ancak tür çıkarımı (type inference) (daha sonra ele alınacaktır), " +"programcının birçok durumda bunu atlamasına olanak tanır." #: src/types-and-values/values.md msgid "" @@ -3050,7 +3283,7 @@ msgid "" "each type." msgstr "" "Burada bazı temel yerleşik türler ve her türün değişmez değerlerinin " -"sözdizimi (syntax) verilmiştir." +"(literal values) sözdizimi (syntax) verilmiştir." #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" @@ -3098,7 +3331,7 @@ msgstr "`3.14`, `-10.0e20`, `2_f32`" #: src/types-and-values/values.md msgid "Unicode scalar values" -msgstr "Ünicode skaler değerler" +msgstr "Ünikod skaler değerler" #: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`char`" @@ -3171,18 +3404,18 @@ msgstr "" #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." msgstr "" -"Aritmetik işlemleri, diğer dillerinkine benzer öncelik sıralamasıyla çok " -"benzerdir." +"Aritmetik, benzer öncelik (precedence) kurallarıyla birlikte diğer " +"dillerdeki aritmetiğe oldukça benzerdir." #: src/types-and-values/arithmetic.md msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " -"actually undefined, and might do different things on different platforms or " -"compilers. In Rust, it's defined." +"actually undefined, and might do unknown things at runtime. In Rust, it's " +"defined." msgstr "" "Peki, tamsayı taşması ne olacak? C ve C++'da _işaretli_ tamsayıların taşması " -"aslında tanımsızdır (undefined) ve farklı platformlarda veya derleyicilerde " -"farklı şeyler olabilir. Rust'ta bu tanımlanmıştır." +"aslında tanımsızdır (undefined) ve çalışma zamanında bilinmeyen şeyler " +"olabilir. Rust'ta ise bu tanımlıdır." #: src/types-and-values/arithmetic.md msgid "" @@ -3204,12 +3437,13 @@ msgid "" "In fact, the compiler will detect overflow of constant expressions, which is " "why the example requires a separate function." msgstr "" -"Aslında derleyici sabit (constant) ifadelerin (expression) taşmasını " +"Aslında derleyici sabit ifadelerin (constant expression) taşmasını " "algılayacaktır, bu nedenle örnek ayrı bir fonksiyon gerektirir." #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" -msgstr "Rust, türü belirlemek için değişkenin nasıl _kullanıldığına_ bakacak:" +msgstr "" +"Rust, türü belirlemek için değişkenin nasıl _kullanıldığına_ bakacaktır:" #: src/types-and-values/inference.md msgid "" @@ -3217,8 +3451,8 @@ msgid "" "constraints given by variable declarations and usages." msgstr "" "Bu slayt, Rust derleyicisinin değişken bildirimleri ve kullanımları " -"tarafından verilen kısıtlamalara dayanarak türleri nasıl çıkarım yaptığını " -"gösterir." +"tarafından verilen kısıtlamalara (constraints) dayanarak türleri nasıl " +"çıkarım (inference) yapabildiğini gösterir." #: src/types-and-values/inference.md msgid "" @@ -3240,10 +3474,10 @@ msgid "" "`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " "floating-point literals default to `f64`." msgstr "" -"Hiçbir şey bir tamsayı değişmezinin türünü kısıtlamadığında, Rust varsayılan " -"olarak türü `i32` yapar. Bu bazen hata mesajlarında \"{integer}\" olarak " -"görünür. Benzer şekilde, ondalıklı sayı değişmezleri için varsayılan tür " -"`f64`'tür." +"Bir tamsayı değişmezinin (integer literal) türünü hiçbir " +"şeykısıtlamadığında, Rust varsayılan olarak türü `i32` yapar. Bu bazen hata " +"mesajlarında \"{integer}\" olarak görünür. Benzer şekilde, ondalıklı sayı " +"değişmezleri (floating-point literals) için varsayılan tür `f64`'tür." #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" @@ -3253,13 +3487,13 @@ msgstr "" #: src/types-and-values/exercise.md msgid "" -"The first and second Fibonacci numbers are both `1`. For n>2, the n'th " -"Fibonacci number is calculated recursively as the sum of the n-1'th and " -"n-2'th Fibonacci numbers." +"The Fibonacci sequence begins with `[0,1]`. For n>1, the n'th Fibonacci " +"number is calculated recursively as the sum of the n-1'th and n-2'th " +"Fibonacci numbers." msgstr "" -"Birinci ve ikinci Fibonacci sayılarının her ikisi de `1`'dir. n>2 için, " -"n'inci Fibonacci sayısı yinelemeli olarak n-1'inci ve n-2'inci Fibonacci " -"sayılarının toplamı olarak hesaplanır." +"Fibonacci dizisi `[0,1]` ile başlar. n>1 için, n'inci Fibonacci sayısı " +"yinelemeli olarak n-1'inci ve n-2'inci Fibonacci sayılarının toplamı olarak " +"hesaplanır." #: src/types-and-values/exercise.md msgid "" @@ -3267,7 +3501,7 @@ msgid "" "will this function panic?" msgstr "" "N'inci Fibonacci sayısını hesaplayan bir `fib(n)` fonksiyonu yazın. Bu " -"fonksiyon ne zaman paniğe kapılacak?" +"fonksiyon ne zaman paniğe (panic) uğrar?" #: src/types-and-values/exercise.md msgid "// The base case.\n" @@ -3279,45 +3513,107 @@ msgstr "\"Bunu gerçekleştirin (implement)\"" #: src/types-and-values/exercise.md msgid "// The recursive case.\n" -msgstr "// Özyinelemeli durum.\n" +msgstr "// Özyinelemeli (recursive) durum.\n" #: src/types-and-values/exercise.md src/types-and-values/solution.md msgid "\"fib({n}) = {}\"" msgstr "\"fib({n}) = {}\"" +#: src/control-flow-basics.md src/methods-and-traits.md src/generics.md +#: src/modules.md src/testing.md +msgid "This segment should take about 45 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 45 dakika sürmelidir. İçeriği:" + #: src/control-flow-basics.md -msgid "[if Expressions](./control-flow-basics/if.md) (4 minutes)" -msgstr "[if İfadeleri](./control-flow-basics/if.md) (4 dakika)" +msgid "if Expressions" +msgstr "if İfadeleri (Expressions)" + +#: src/control-flow-basics.md src/pattern-matching.md src/concurrency/async.md +#: src/concurrency/async-control-flow.md +msgid "4 minutes" +msgstr "4 dakika" #: src/control-flow-basics.md -msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" -msgstr "[Döngüler](./control-flow-basics/loops.md) (5 dakika)" +msgid "match Expressions" +msgstr "match İfadeleri (Expressions)" #: src/control-flow-basics.md -msgid "" -"[break and continue](./control-flow-basics/break-continue.md) (4 minutes)" +msgid "break and continue" +msgstr "break ve continue" + +#: src/control-flow-basics.md +msgid "We will now cover the many kinds of flow control found in Rust." msgstr "" -"[break ve continue](./control-flow-basics/break-continue.md) (4 dakika)" +"Şimdi, Rust'ta bulunan birçok akış kontrol (flow control) çeşitlerini ele " +"alacağız." #: src/control-flow-basics.md msgid "" -"[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (5 minutes)" +"Most of this will be very familiar to what you have seen in other " +"programming languages." msgstr "" -"[Bloklar ve Kapsamlar](./control-flow-basics/blocks-and-scopes.md) (5 dakika)" +"Bunların çoğu diğer programlama dillerinde gördüklerinize çok tanıdık " +"gelecektir." -#: src/control-flow-basics.md -msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" -msgstr "[Fonksiyonlar](./control-flow-basics/functions.md) (3 dakika)" +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " +"Each block has a value and a type, which are those of the last expression of " +"the block:" +msgstr "" +"Rust dilindeki bir blok, `{}` parantezleri içine alınmış bir ifadeler dizisi " +"(sequence of expressions) içerir. Her bloğun bir değeri ve bir türü vardır, " +"bunlar, bloğun son ifadesinin değer ve türüdür:" -#: src/control-flow-basics.md -msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" -msgstr "[Makrolar](./control-flow-basics/macros.md) (2 dakika)" +#: src/control-flow-basics/blocks-and-scopes.md +msgid "// dbg!(y);\n" +msgstr "// dbg!(y);\n" -#: src/control-flow-basics.md +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"If the last expression ends with `;`, then the resulting value and type is " +"`()`." +msgstr "Son ifade `;` ile bitiyorsa, ortaya çıkan değer ve tür `()` olur." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "A variable's scope is limited to the enclosing block." +msgstr "" +"Bir değişkenin kapsamı (scope) onu çevreleyen blokla (enclosing block) " +"sınırlıdır." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"You can explain that dbg! is a Rust macro that prints and returns the value " +"of a given expression for quick and dirty debugging." +msgstr "" +"\"dbg!\"'nin, hızlı ve basitçe hata ayıklama için verilen bir ifadenin " +"değerini yazdırmaya ve geri döndürmeye yarayan bir Rust makrosu olduğunu " +"açıklayabilirsiniz." + +#: src/control-flow-basics/blocks-and-scopes.md +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 "" +"Bloktaki son satırı değiştirerek bloğun değerinin nasıl değiştiğini " +"gösterebilirsiniz. Örneğin, noktalı virgül eklemek/kaldırmak veya bir " +"`return` kullanmak." + +#: src/control-flow-basics/blocks-and-scopes.md +msgid "" +"Demonstrate that attempting to access `y` outside of its scope won't compile." +msgstr "" +"`y` değişkenine kapsamı (scope) dışından erişmeye çalışmanın derleme hatası " +"olacağını gösterin." + +#: src/control-flow-basics/blocks-and-scopes.md msgid "" -"[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (15 minutes)" +"Values are effectively \"deallocated\" when they go out of their scope, even " +"if their data on the stack is still there." msgstr "" -"[Alıştırma: Collatz Sekansı](./control-flow-basics/exercise.md) (15 dakika)" +"Değerler, yığındaki (stack) verileri hala orada olsa bile, kapsamlarının " +"(scope) dışına çıktıklarında etkili bir şekilde \"tahsisleri geri verilir " +"(deallocated)\"." #: src/control-flow-basics/if.md msgid "`if` expressions" @@ -3376,13 +3672,141 @@ msgstr "" #: 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." +"An `if` expression should be used in the same way as the other expressions. " +"For example, when it is used in a `let` statement, the statement must be " +"terminated with a `;` as well. Remove the `;` before `println!` to see the " +"compiler error." +msgstr "" +"Bir `if` ifadesi diğer ifadelerle aynı şekilde kullanılmalıdır. Örneğin, bir " +"`let` ifadesinde kullanıldığında, ifadenin `;` ile de sonlandırılması " +"gerekir. Derleyici hatasını görmek için `println!`'den önceki `;`'yi " +"kaldırın." + +#: src/control-flow-basics/match.md +msgid "`match` can be used to check a value against one or more options:" +msgstr "" +"`match` bir değeri bir veya daha fazla seçeneğe göre kontrol etmek için " +"kullanılabilir:" + +#: src/control-flow-basics/match.md +msgid "\"one\"" +msgstr "\"bir\"" + +#: src/control-flow-basics/match.md +msgid "\"ten\"" +msgstr "\"on\"" + +#: src/control-flow-basics/match.md +msgid "\"one hundred\"" +msgstr "\"yüz\"" + +#: src/control-flow-basics/match.md +msgid "\"something else\"" +msgstr "\"başka bir şey\"" + +#: src/control-flow-basics/match.md +msgid "Like `if` expressions, `match` can also return a value;" +msgstr "" +"`if` ifadeleri gibi `match` ifadesi de bir değeri geri döndürebilir (return);" + +#: src/control-flow-basics/match.md +msgid "\"The value of {flag} is {val}\"" +msgstr "\"{flag}'in değeri = {val}\"" + +#: src/control-flow-basics/match.md +msgid "" +"`match` arms are evaluated from top to bottom, and the first one that " +"matches has its corresponding body executed." +msgstr "" +"`match` kolları (arms) yukarıdan aşağıya doğru değerlendirilir ve eşleşen " +"ilk kolun karşılık gelen gövdesi (body) çalıştırılır." + +#: src/control-flow-basics/match.md +msgid "" +"There is no fall-through between cases the way that `switch` works in other " +"languages." +msgstr "" +"`switch`'in diğer dillerdeki çalışma şekli gibi durumlar (cases) arasında " +"aşağıya geçiş (fall-through) yoktur." + +#: src/control-flow-basics/match.md +msgid "" +"The body of a `match` arm can be a single expression or a block. Technically " +"this is the same thing, since blocks are also expressions, but students may " +"not fully understand that symmetry at this point." +msgstr "" +"Bir `match` kolunun gövdesi tek bir ifade (expression) veya bir blok " +"olabilir. Teknik olarak bu aynı şeydir, çünkü bloklar da bir ifadedir, ancak " +"öğrenciler bu noktadaki denk yapıyı (symmetry) tam olarak anlamayabilirler." + +#: src/control-flow-basics/match.md +msgid "" +"`match` expressions need to be exhaustive, meaning they either need to cover " +"all possible values or they need to have a default case such as `_`. " +"Exhaustiveness is easiest to demonstrate with enums, but enums haven't been " +"introduced yet. Instead we demonstrate matching on a `bool`, which is the " +"simplest primitive type." +msgstr "" +"`match` ifadelerinin kapsamlı (exhaustive) olması gerekir, yani ya tüm olası " +"değerleri kapsamaları ya da `_` gibi varsayılan bir duruma (case) sahip " +"olmaları gerekir. Kapsamlılık (Exhaustiveness) enumlarla gösterilmesi en " +"kolay olanıdır, ancak enumlar henüz tanıtılmadı. Bunun yerine, en basit " +"ilkel tür olan `bool` üzerinde eşleştirmeyi (matching) gösteriyoruz." + +#: src/control-flow-basics/match.md +msgid "" +"This slide introduces `match` without talking about pattern matching, giving " +"students a chance to get familiar with the syntax without front-loading too " +"much information. We'll be talking about pattern matching in more detail " +"tomorrow, so try not to go into too much detail here." +msgstr "" +"Bu slayt, desen eşleştirmesinden (pattern matching) bahsetmeden `match`'i " +"tanıtıyor ve öğrencilere çok fazla bilgi yüklemeden sözdizimine (syntax) " +"aşina olma şansı veriyor. Desen eşleştirmesi hakkında yarın daha detaylı " +"konuşacağız, bu yüzden burada çok fazla detaya girmemeye çalışın." + +#: src/control-flow-basics/match.md src/references/dangling.md +#: src/user-defined-types/named-structs.md src/user-defined-types/enums.md +#: src/user-defined-types/static.md src/pattern-matching/infallible.md +#: src/pattern-matching/destructuring-structs.md +#: src/pattern-matching/let-control-flow/let-else.md src/closures/syntax.md +#: src/memory-management/review.md src/memory-management/move.md +#: src/memory-management/copy-types.md src/borrowing/shared.md +#: src/borrowing/borrowck.md src/borrowing/interior-mutability/refcell.md +#: src/iterators/motivation.md src/iterators/iterator.md +#: src/iterators/helpers.md src/iterators/collect.md +#: src/modules/encapsulation.md src/error-handling/result.md +#: src/error-handling/anyhow.md src/concurrency/async/state-machine.md +msgid "More to Explore" +msgstr "Daha Fazlasını Keşfedin" + +#: src/control-flow-basics/match.md +msgid "" +"To further motivate the usage of `match`, you can compare the examples to " +"their equivalents written with `if`. In the second case matching on a `bool` " +"an `if {} else {}` block is pretty similar. But in the first example that " +"checks multiple cases, a `match` expression can be more concise than `if {} " +"else if {} else if {} else`." msgstr "" -"Bir ifadede `if` kullanıldığında, ifadeyi bir sonraki ifadeden ayırmak için " -"ifadenin `;` olması gerekir. Derleyici hatasını görmek için `println!`den " -"önceki `;` işaretini kaldırın." +"`match` kullanımını daha da motive etmek için, örnekleri `if` ile yazılmış " +"eşdeğerleriyle karşılaştırabilirsiniz. İkinci durumda, bir `bool` üzerinde " +"eşleme (matching) yapmak, `if {} else {}` bloğuna oldukça benzer. Ancak " +"birden fazla durumu kontrol eden ilk örnekte, bir `match` ifadesi `if {} " +"else if {} else if {} else` ifadesinden daha az ve öz olabilir." + +#: src/control-flow-basics/match.md +msgid "" +"`match` also supports match guards, which allow you to add an arbitrary " +"logical condition that will get evaluated to determine if the match arm " +"should be taken. However talking about match guards requires explaining " +"about pattern matching, which we're trying to avoid on this slide." +msgstr "" +"`match` ayrıca eşleşme filtrelerini (match guards) da destekler, bu da " +"eşleşme kolunun (match arm) alınıp alınmaması gerektiğini belirlemek için " +"değerlendirilecek keyfi bir mantıksal koşul (condition) eklemenize olanak " +"tanır. Ancak eşleşme filtreleri hakkında konuşmak, bu slaytta kaçınmaya " +"çalıştığımız desen eşleştirmesi (pattern matching) hakkında açıklama " +"gerektirir." #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" @@ -3401,11 +3825,7 @@ msgid "" msgstr "" "[`while` anahtar kelimesi](https://doc.rust-lang.org/reference/expressions/" "loop-expr.html#predicate-loops) diğer dillerdeki gibi işler ve koşul doğru " -"olduğu sürece döngü gövdesini çalıştırır." - -#: src/control-flow-basics/loops.md -msgid "\"Final x: {x}\"" -msgstr "\"Son x: {x}\"" +"olduğu sürece döngü gövdesini yürütür (execute)." #: src/control-flow-basics/loops/for.md msgid "" @@ -3413,11 +3833,8 @@ msgid "" "over ranges of values or the items in a collection:" msgstr "" "[`for` döngüsü](https://doc.rust-lang.org/std/keyword.for.html) değer " -"aralıkları veya bir koleksiyondaki öğeler üzerinde tekrarlar:" - -#: src/control-flow-basics/loops/for.md -msgid "\"elem: {elem}\"" -msgstr "\"elem: {elem}\"" +"aralıkları (ranges of values) veya bir koleksiyondaki (collection) öğeler " +"üzerinde adımlama yapar (iterate):" #: src/control-flow-basics/loops/for.md msgid "" @@ -3426,17 +3843,17 @@ msgid "" "discussed in more detail later." msgstr "" "`for` döngülerinin başlığının altında, farklı türdeki aralıklar/" -"koleksiyonlar üzerinde tekrarlamayı gerçekleştirmek için \"adımlayıcılar\" " -"adı verilen bir kavram kullanılır. Adımlayıcılar (iterators) daha sonra daha " +"koleksiyonlar üzerinde adımlamayı gerçekleştirmek için \"adımlayıcılar\" adı " +"verilen bir kavram kullanılır. Adımlayıcılar (iterators) daha sonra daha " "ayrıntılı olarak tartışılacaktır." #: 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." +"Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " +"for an inclusive range." msgstr "" -"`for` döngüsünün yalnızca `4`'e kadar adım attığını unutmayın. Kapalı aralık " -"için `1..=5` sözdizimini gösterin." +"İlk `for` döngüsünün yalnızca `4`'e kadar adımladığını unutmayın. Kapalı bir " +"aralık için `1..=5` sözdizimini gösterin." #: src/control-flow-basics/loops/loop.md msgid "" @@ -3447,8 +3864,12 @@ msgstr "" "`break`'e kadar sonsuz döner." #: src/control-flow-basics/loops/loop.md -msgid "\"{i}\"" -msgstr "\"{i}\"" +msgid "" +"The `loop` statement works like a `while true` loop. Use it for things like " +"servers which will serve connections forever." +msgstr "" +"`loop` deyimi `while true` döngüsü gibi çalışır. Bağlantılara sonsuza kadar " +"hizmet edecek sunucular gibi şeyler için kullanın." #: src/control-flow-basics/break-continue.md msgid "" @@ -3461,23 +3882,26 @@ msgstr "" #: src/control-flow-basics/break-continue.md msgid "" "If you want to exit any kind of loop early, use [`break`](https://doc.rust-" -"lang.org/reference/expressions/loop-expr.html#break-expressions). For " +"lang.org/reference/expressions/loop-expr.html#break-expressions). With " "`loop`, this can take an optional expression that becomes the value of the " "`loop` expression." msgstr "" -"Bir döngüden erken çıkmak istiyorsanız [`break`](https://doc.rust-lang.org/" -"reference/expressions/loop-expr.html#break-expressions) kullanın. `loop` " -"için bu, `loop` ifadesinin değeri haline gelen isteğe bağlı bir ifadeyi " -"(optional expression) alabilir." +"Herhangi bir döngüden erken çıkmak istiyorsanız, [`break`](https://doc.rust-" +"lang.org/reference/expressions/loop-expr.html#break-expressions) kullanın. " +"`loop` ile, isteğe bağlı bir ifade yazılabilir ve bu ifade, `loop` " +"ifadesinin değeri olur." -#: 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 +msgid "" +"Note that `loop` is the only looping construct which can return a non-" +"trivial value. This is because it's guaranteed to only return at a `break` " +"statement (unlike `while` and `for` loops, which can also return when the " +"condition fails)." +msgstr "" +"`loop`'un önemsiz olmayan (non-trivial) bir değer döndüren tek döngüsel yapı " +"olduğunu unutmayın. Bunun nedeni, en az bir `break` ifadesinde sonlanmasının " +"garantili olmasıdır (koşul başarısız olduğunda da sonlanabilen `while` ve " +"`for` döngülerinin aksine)." #: src/control-flow-basics/break-continue/labels.md msgid "" @@ -3488,116 +3912,12 @@ msgstr "" "çıkmak için kullanılan bir etiket (label) argümanını alabilir:" #: src/control-flow-basics/break-continue/labels.md -msgid "\"elements searched: {elements_searched}\"" -msgstr "\"aranan öğeler: {elements_searched}\"" +msgid "Labeled break also works on arbitrary blocks, e.g." +msgstr "Etiketli break, keyfi olarak yazılan bloklarda da çalışır, örneğin." #: 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 " -"`while` and `for` loops)." -msgstr "" -"`loop`'un önemsiz olmayan (non-trivial) bir değer döndüren tek döngüsel yapı " -"olduğunu unutmayın. Bunun nedeni, en az bir kez girilmesinin (`while` ve " -"`for` döngülerinden farklı olarak) garanti altında olmasıdır ." - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "Blocks" -msgstr "Bloklar" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"A block in Rust contains a sequence of expressions, enclosed by braces `{}`. " -"Each block has a value and a type, which are those of the last expression of " -"the block:" -msgstr "" -"Rust dilindeki bir blok, `{}` parantezleri içine alınmış bir ifadeler dizisi " -"(sequence of expressions) içerir. Her bloğun, bloğun son ifadesine ait olan " -"bir değeri ve türü vardır:" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "\"y: {y}\"" -msgstr "\"y: {y}\"" - -#: src/control-flow-basics/blocks-and-scopes.md -msgid "" -"If the last expression ends with `;`, then the resulting value and type is " -"`()`." -msgstr "Son ifade `;` ile bitiyorsa, ortaya çıkan değer ve tür `()` olur." - -#: src/control-flow-basics/blocks-and-scopes.md -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 "" -"Bloktaki son satırı değiştirerek bloğun değerinin nasıl değiştiğini " -"gösterebilirsiniz. Örneğin, noktalı virgül eklemek/kaldırmak veya bir " -"`return` kullanmak." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "A variable's scope is limited to the enclosing block." -msgstr "Bir değişkenin kapsamı (scope) onu çevreleyen blokla sınırlıdır." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"You can shadow variables, both those from outer scopes and variables from " -"the same scope:" -msgstr "" -"Hem dış kapsamlardaki (outer scopes) değişkenleri hem de aynı kapsamdaki " -"değişkenleri gölgeleyebilirsiniz (shadow):" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"before: {a}\"" -msgstr "\"önce: {a}\"" - -#: 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 "\"merhaba\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"inner scope: {a}\"" -msgstr "\"iç kapsam: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"shadowed in inner scope: {a}\"" -msgstr "\"iç kapsamda gölgelendi: {a}\"" - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "\"after: {a}\"" -msgstr "\"sonra: {a}\"" - -#: 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 "" -"Son örnekte iç bloğa (inner block) bir `b` ekleyerek ve ardından bu bloğun " -"dışından ona erişmeye çalışarak bir değişkenin kapsamının (scope) sınırlı " -"olduğunu gösterin." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"Shadowing is different from mutation, because after shadowing both " -"variable's memory locations exist at the same time. Both are available under " -"the same name, depending where you use it in the code." -msgstr "" -"Gölgeleme mutasyondan farklıdır çünkü gölgeleme sonrasında her iki " -"değişkenin hafıza konumları aynı anda mevcuttur. Her ikisi de kodda nerede " -"kullandığınıza bağlı olarak aynı ad altında mevcuttur." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "A shadowing variable can have a different type." -msgstr "Bir gölgeleme (shadowing) değişkeni farklı bir türe sahip olabilir." - -#: src/control-flow-basics/blocks-and-scopes/scopes.md -msgid "" -"Shadowing looks obscure at first, but is convenient for holding on to values " -"after `.unwrap()`." -msgstr "" -"Gölgelendirme ilk başta anlaşılmaz görünebilir, ancak `.unwrap()` " -"sonrasındaki değerleri korumak için kullanışlıdır." +msgid "\"This line gets skipped\"" +msgstr "\"Bu satır geçilece\"" #: src/control-flow-basics/functions.md msgid "" @@ -3617,25 +3937,25 @@ msgstr "" "Bir fonksiyon gövdesindeki (veya herhangi bir bloktaki) son ifade " "(expression), geri dönüş değeri (return value) olur. İfadenin sonundaki `;` " "işaretini silmeniz yeterlidir. `return` anahtar kelimesi erken geri dönüş " -"(early return) için kullanılabilir, ancak \"yalın (bare) değer\" formu bir " -"fonksiyonun sonunda tercih edilen yaklaşımdır (idiomatic) (`return`kullanmak " -"için `gcd`'yi yeniden düzenleyin - refactor)." +"(early return) için kullanılabilir, ancak fonksiyonun sonunda \"yalın (bare) " +"değer\" kullanmak daha yaygındır (idiomatic) (`return`kullanmak için " +"`gcd`'yi yeniden düzenleyin - refactor)." #: src/control-flow-basics/functions.md msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " -"compiler will infer this if the `-> ()` return type is omitted." +"compiler will infer this if the return type is omitted." msgstr "" -"Bazı fonksiyonların geri dönüş değeri (return value) yoktur ve 'birim türü' " -"olan `()` değerini döndürür. Eğer `->()` dönüş tipi atlanırsa derleyici bunu " -"anlayacaktır." +"Bazı fonksiyonların dönüş değeri (return value) yoktur ve 'birim türü (unit " +"type)', `()` döndürürler. Eğer dönüş türü yazılmazsa, derleyici birim türünü " +"çıkarım (infer) yapacaktır." #: src/control-flow-basics/functions.md msgid "" "Overloading is not supported -- each function has a single implementation." msgstr "" -"Yüklenme (overloading) desteklenmez -- her fonksiyonun tek bir uygulaması " -"(implementation) vardır." +"Fonksiyon yüklemesi (overloading) desteklenmez -- her fonksiyonun tek bir " +"uygulaması (implementation) vardır." #: src/control-flow-basics/functions.md msgid "" @@ -3651,8 +3971,8 @@ msgid "" "Always takes a single set of parameter types. These types can be generic, " "which will be covered later." msgstr "" -"Her zaman tek bir parametre türü kümesini alır. Bu türler, daha sonra ele " -"alınacak olan jenerik olabilir." +"Her zaman tek bir parametre türü kümesi alır. Bu türler genelleştirilmiş " +"(generic) olabilir, bu konuya daha sonra değinilecektir." #: src/control-flow-basics/macros.md msgid "" @@ -3661,7 +3981,7 @@ msgid "" "The Rust standard library includes an assortment of useful macros." msgstr "" "Makrolar, derleme sırasında Rust koduna genişletilir ve değişken sayıda " -"argüman alabilir. Sonunda `!` işaretiyle ayırt edilirler. Rust standart " +"argüman alabilir. Sonda olan `!` işaretiyle ayırt edilirler. Rust standart " "kütüphanesi çeşitli yararlı makrolar içerir." #: src/control-flow-basics/macros.md @@ -3670,7 +3990,8 @@ msgid "" "described in [`std::fmt`](https://doc.rust-lang.org/std/fmt/index.html)." msgstr "" "`println!(format, ..)`, [`std::fmt`](https://doc.rust-lang.org/std/fmt/index." -"html)'de açıklanan biçimi uygulayarak standart çıktıya bir satır yazdırır." +"html)'de açıklanan biçimi (formatting) uygulayarak standart çıktıya bir " +"satır yazdırır." #: src/control-flow-basics/macros.md msgid "" @@ -3683,7 +4004,7 @@ msgstr "" #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "" -"`dbg!(expression)` ifadenin değerini kayıt tutar (loggging) ve onu geri " +"`dbg!(expression)` ifadenin değerini kaydeder (loggging) ve onu geri " "döndürür." #: src/control-flow-basics/macros.md @@ -3692,15 +4013,7 @@ msgid "" "panic." msgstr "" "`todo!()` kodun bir kısmını henüz uygulanmamış (not-yet-implemented) olarak " -"işaretler. Eğer çalıştırılırsa, paniğe neden olur." - -#: src/control-flow-basics/macros.md -msgid "" -"`unreachable!()` marks a bit of code as unreachable. If executed, it will " -"panic." -msgstr "" -"`unreachable!()` kodun bir kısmını erişilemez (unreachable) olarak " -"işaretler. Eğer çalıştırılırsa, paniğe neden olur." +"işaretler. Eğer yürütülürse (execute), paniğe neden olur." #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" @@ -3722,163 +4035,107 @@ msgid "" "use of derive macros." msgstr "" "Kurs, makroların tanımlanmasını (define) kapsamaz, ancak daha sonraki bir " -"bölümde türetilmiş makroların kullanımı anlatılacaktır." +"bölümde `derive` makrolarının kullanımı anlatılacaktır." -#: src/control-flow-basics/exercise.md +#: src/control-flow-basics/macros.md src/pattern-matching/match.md +msgid "More To Explore" +msgstr "Daha Fazlasını Keşfedin" + +#: src/control-flow-basics/macros.md msgid "" -"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " -"defined as follows, for an arbitrary n" +"There are a number of other useful macros provided by the standard library. " +"Some other examples you can share with students if they want to know more:" msgstr "" -"[Collatz sanısı](https://en.wikipedia.org/wiki/Collatz_conjecture) şu " -"şekilde tanımlanır, keyfi bir" +"Standart kütüphane tarafından sağlanan birçok başka kullanışlı makro vardır. " +"Öğrenciler daha fazlasını öğrenmek isterse onlarla paylaşabileceğiniz bazı " +"diğer örnekler:" -#: src/control-flow-basics/exercise.md -msgid "1" -msgstr "1" - -#: src/control-flow-basics/exercise.md -msgid " greater than zero:" -msgstr " sıfırdan büyük sayısı için:" +#: src/control-flow-basics/macros.md +msgid "" +"[`assert!`](https://doc.rust-lang.org/stable/std/macro.assert.html) and " +"related macros can be used to add assertions to your code. These are used " +"heavily in writing tests." +msgstr "" +"[`assert!`](https://doc.rust-lang.org/stable/std/macro.assert.html) ve " +"ilgili makrolar, kodunuza doğrulamalar (assertions) eklemek için " +"kullanılabilir. Bu makrolar, test yazımında yoğun şekilde kullanılır." -#: src/control-flow-basics/exercise.md -msgid "If _n" -msgstr "If _n" +#: src/control-flow-basics/macros.md +msgid "" +"[`unreachable!`](https://doc.rust-lang.org/stable/std/macro.unreachable." +"html) is used to mark a branch of control flow that should never be hit." +msgstr "" +"[`unreachable!`](https://doc.rust-lang.org/stable/std/macro.unreachable." +"html), hiçbir zaman ulaşılmaması gereken bir kontrol akışı dalını " +"işaretlemek için kullanılır." -#: src/control-flow-basics/exercise.md -msgid "i" -msgstr "i" +#: src/control-flow-basics/macros.md +msgid "" +"[`eprintln!`](https://doc.rust-lang.org/stable/std/macro.eprintln.html) " +"allows you to print to stderr." +msgstr "" +"[`eprintln!`](https://doc.rust-lang.org/stable/std/macro.eprintln.html) " +"stderr'e yazdırmanıza olanak tanır." #: src/control-flow-basics/exercise.md -msgid "_ is 1, then the sequence terminates at _n" -msgstr "_ 1 ise, o zaman sekans bu sayıda sonlanır, _n" +msgid "" +"The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " +"defined as follows, for an arbitrary n1 greater than zero:" +msgstr "" +"[Collatz sanısı](https://en.wikipedia.org/wiki/Collatz_conjecture), sıfırdan " +"büyük herhangi bir n1 için aşağıdaki şekilde tanımlanır:" #: src/control-flow-basics/exercise.md -msgid "_." -msgstr "_." +msgid "" +"If _ni_ is 1, then the sequence terminates at _ni_." +msgstr "Eğer _ni_ 1 ise, dizi _ni_'de sonlanır." #: src/control-flow-basics/exercise.md -msgid "_ is even, then _n" -msgstr "_ çifttir, o zaman _n" +msgid "If _ni_ is even, then _ni+1 = ni / 2_." +msgstr "" +"Eğer _ni_ çift ise, o zaman _ni+1 = ni / 2_." #: src/control-flow-basics/exercise.md -msgid "i+1" -msgstr "i+1" +msgid "" +"If _ni_ is odd, then _ni+1 = 3 * ni + 1_." +msgstr "" +"Eğer _ni_ tek sayı ise _ni+1 = 3 * ni + 1_." #: src/control-flow-basics/exercise.md -msgid " = n" -msgstr " = n" +msgid "For example, beginning with _n1_ = 3:" +msgstr "Örneğin, _n1_ = 3 ile başalrsak:" #: src/control-flow-basics/exercise.md -msgid " / 2_." -msgstr " / 2_." +msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" +msgstr "3 tek sayıdır, dolayısıyla _n2_ = 3 * 3 + 1 = 10;" #: src/control-flow-basics/exercise.md -msgid "_ is odd, then _n" -msgstr "_ tektir, o zaman _n" +msgid "10 is even, so _n3_ = 10 / 2 = 5;" +msgstr "10 çift sayıdır, dolayısıyla _n3_ = 10 / 2 = 5;" #: src/control-flow-basics/exercise.md -msgid " = 3 * n" -msgstr " = 3 * n" +msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" +msgstr "5 tek sayıdır, dolayısıyla _n4_ = 3 * 5 + 1 = 16;" #: src/control-flow-basics/exercise.md -msgid " + 1_." -msgstr " + 1_." +msgid "16 is even, so _n5_ = 16 / 2 = 8;" +msgstr "16 çift sayıdır, dolayısıyla _n5_ = 16 / 2 = 8;" #: src/control-flow-basics/exercise.md -msgid "For example, beginning with _n" -msgstr "Örneğin, başlangıcımız _n" +msgid "8 is even, so _n6_ = 8 / 2 = 4;" +msgstr "8 çift sayıdır, dolayısıyla _n6_ = 8 / 2 = 4;" #: src/control-flow-basics/exercise.md -msgid "_ = 3:" -msgstr "_ = 3:" +msgid "4 is even, so _n7_ = 4 / 2 = 2;" +msgstr "4 çift sayıdır, dolayısıyla _n7_ = 4 / 2 = 2;" #: src/control-flow-basics/exercise.md -msgid "3 is odd, so _n" -msgstr "3 tektir, yani _n" +msgid "2 is even, so _n8_ = 1; and" +msgstr "2 çifttir, bu yüzden _n8_ = 1; ve" #: src/control-flow-basics/exercise.md -msgid "2" -msgstr "2" - -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 3 + 1 = 10;" -msgstr "_ = 3 * 3 + 1 = 10;" - -#: src/control-flow-basics/exercise.md -msgid "10 is even, so _n" -msgstr "10 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "3" -msgstr "3" - -#: src/control-flow-basics/exercise.md -msgid "_ = 10 / 2 = 5;" -msgstr "_ = 10 / 2 = 5;" - -#: src/control-flow-basics/exercise.md -msgid "5 is odd, so _n" -msgstr "5 tektir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "4" -msgstr "4" - -#: src/control-flow-basics/exercise.md -msgid "_ = 3 * 5 + 1 = 16;" -msgstr "_ = 3 * 5 + 1 = 16;" - -#: src/control-flow-basics/exercise.md -msgid "16 is even, so _n" -msgstr "16 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md -msgid "5" -msgstr "5" - -#: src/control-flow-basics/exercise.md -msgid "_ = 16 / 2 = 8;" -msgstr "_ = 16 / 2 = 8;" - -#: src/control-flow-basics/exercise.md -msgid "8 is even, so _n" -msgstr "8 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "6" -msgstr "6" - -#: src/control-flow-basics/exercise.md -msgid "_ = 8 / 2 = 4;" -msgstr "_ = 8 / 2 = 4;" - -#: src/control-flow-basics/exercise.md -msgid "4 is even, so _n" -msgstr "4 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md -msgid "7" -msgstr "7" - -#: src/control-flow-basics/exercise.md -msgid "_ = 4 / 2 = 2;" -msgstr "_ = 4 / 2 = 2;" - -#: src/control-flow-basics/exercise.md -msgid "2 is even, so _n" -msgstr "2 çifttir, yani _n" - -#: src/control-flow-basics/exercise.md src/bare-metal/aps/better-uart.md -msgid "8" -msgstr "8" - -#: src/control-flow-basics/exercise.md -msgid "_ = 1; and" -msgstr "_ = 1; ve" - -#: src/control-flow-basics/exercise.md -msgid "the sequence terminates." -msgstr "sekans sonlandırılır." +msgid "the sequence terminates." +msgstr "sekans sonlandırılır." #: src/control-flow-basics/exercise.md msgid "" @@ -3892,59 +4149,50 @@ msgstr "" msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" msgstr "/// `n`'den başlayan collatz sekansının uzunluğunu belirle.\n" -#: src/control-flow-basics/solution.md src/concurrency/scoped-threads.md +#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "\"Length: {}\"" -msgstr "\"Length: {}\"" +msgstr "\"Uzunluk: {}\"" + +#: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md +msgid "// should be 15\n" +msgstr "// 15 olmalı\n" #: src/welcome-day-1-afternoon.md src/welcome-day-2-afternoon.md #: src/welcome-day-3-afternoon.md src/welcome-day-4-afternoon.md msgid "Welcome Back" msgstr "Tekrar Hoş Geldiniz" -#: src/welcome-day-1-afternoon.md -msgid "[Tuples and Arrays](./tuples-and-arrays.md) (35 minutes)" -msgstr "[Demetler ve Diziler](./tuples-and-arrays.md) (35 dakika)" - -#: src/welcome-day-1-afternoon.md -msgid "[References](./references.md) (55 minutes)" -msgstr "[Referanslar](../references.md) (55 dakika)" - -#: src/welcome-day-1-afternoon.md -msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" -msgstr "[Kullanıcı Tanımlı Türler](./user-defined-types.md) (50 dakika)" - -#: src/welcome-day-1-afternoon.md +#: src/welcome-day-1-afternoon.md src/welcome-day-2.md msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 35 " -"minutes" -msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 35 dakika sürecektir" - -#: src/tuples-and-arrays.md -msgid "[Arrays](./tuples-and-arrays/arrays.md) (5 minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Tuples](./tuples-and-arrays/tuples.md) (5 minutes)" +"Including 10 minute breaks, this session should take about 2 hours and 45 " +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 45 dakika sürmelidir. " +"İçeriği:" #: src/tuples-and-arrays.md -msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" -msgstr "" +msgid "This segment should take about 35 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 35 dakika sürmelidir. İçeriği:" #: src/tuples-and-arrays.md msgid "" -"[Patterns and Destructuring](./tuples-and-arrays/destructuring.md) (5 " -"minutes)" -msgstr "" - -#: src/tuples-and-arrays.md -msgid "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (15 minutes)" +"We have seen how primitive types work in Rust. Now it's time for you to " +"start building new composite types." msgstr "" +"Rust'ta (primitive) ilkel türlerin nasıl çalıştığını gördük. Şimdi yeni " +"bileşik (composite) türler oluşturmaya başlamanın zamanı geldi." -#: src/tuples-and-arrays.md -msgid "This segment should take about 35 minutes" +#: src/tuples-and-arrays/arrays.md +msgid "" +"Arrays can also be initialized using the shorthand syntax, e.g. `[0; 1024]`. " +"This can be useful when you want to initialize all elements to the same " +"value, or if you have a large array that would be hard to initialize " +"manually." msgstr "" +"Diziler ayrıca kısaltma sözdizimi (shorthand syntax) kullanılarak da " +"ilklendirilebilir, örneğin `[0; 1024]`. Bu, tüm elemanları aynı değere " +"başlatmak istediğinizde veya manuel olarak başlatılması zor olan büyük bir " +"diziniz varsa yararlı olabilir." #: src/tuples-and-arrays/arrays.md msgid "" @@ -3954,17 +4202,45 @@ msgid "" "different types. Slices, which have a size determined at runtime, are " "covered later." msgstr "" +"Bir `[T; N]` dizi türünün değeri , aynı `T` türdeki `N` (derleme zamanı " +"sabiti) öğelerini/elemanlarını tutar. Dizinin uzunluğunun _türünün parçası_ " +"olduğuna dikkat edin, bu da `[u8; 3]' ve '[u8; 4]` dizilerinin iki farklı " +"tür olarak kabul edildiği anlamına gelir. Dilimler (slices), ki çalışma " +"zamanında belirlenen bir boyuta sahiptir, daha sonra ele alınacaktır." #: 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." +"Try accessing an out-of-bounds array element. The compiler is able to " +"determine that the index is unsafe, and will not compile the code:" msgstr "" +"Sınırların dışında (out-of-bounds) bir dizi (array) elemanına erişmeyi " +"deneyin. Derleyici, indeksin emniyetsiz (unsafe) olduğunu belirleyebilir ve " +"kodu derlemez:" + +#: src/tuples-and-arrays/arrays.md +msgid "\"a: {a:?}\"" +msgstr "\"a: {a:?}\"" + +#: src/tuples-and-arrays/arrays.md +msgid "" +"Array accesses are checked at runtime. Rust can usually optimize these " +"checks away; meaning if the compiler can prove the access is safe, it " +"removes the runtime check for better performance. They can be avoided using " +"unsafe Rust. The optimization is so good that it's hard to give an example " +"of runtime checks failing. The following code will compile but panic at " +"runtime:" +msgstr "" +"Dizi erişimleri çalışma zamanında kontrol edilir. Rust genellikle bu " +"kontrolleri optimize edebilir; yani, derleyici erişimin güvenli olduğunu " +"kanıtlayabilirse, daha iyi performans için çalışma zamanı kontrolünü " +"kaldırır. Bu kontroller, unsafe Rust kullanılarak da atlanabilir. " +"Optimizasyon o kadar iyidir ki, çalışma zamanı kontrollerinin başarısız " +"olduğu bir örnek vermek zordur. Aşağıdaki kod derlenecektir ancak çalışma " +"zamanında panik (panic) ile sonuçlanacaktır:" #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." -msgstr "" +msgstr "Dizilere değer atamak için değişmezleri (literals) kullanabiliriz." #: src/tuples-and-arrays/arrays.md msgid "" @@ -3974,66 +4250,94 @@ msgid "" "only implement the debug output. This means that we must use debug output " "here." msgstr "" +"`println!` makrosu `?` biçim (format) parametresiyle hata ayıklama " +"gerçekleştirimini/uyarlamasını (implementation) ister: `{}` varsayılan " +"çıktıyı verir, `{:?}` hata ayıklama çıktısını verir. Tamsayılar (integer) ve " +"dizeler (string) gibi türler varsayılan çıktıyı uygular (default output), " +"ancak diziler (arrays) yalnızca hata ayıklama çıktısını (debug output) " +"uygular. Bu, bahsi geçen kodda hata ayıklama çıktısını kullanmamız gerektiği " +"anlamına gelir." #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" +"`#` eklemek, örneğin `{a:#?}`, okunması daha kolay olabilecek \"güzel " +"yazdırma (pretty printing)\" biçimini (format) çağırır." #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." -msgstr "" +msgstr "Diziler gibi, demetlerin (tuple) de sabit bir uzunluğu vardır." #: src/tuples-and-arrays/tuples.md msgid "Tuples group together values of different types into a compound type." msgstr "" +"Demetler farklı türdeki değerleri bir bileşik tür (compound type) halinde " +"gruplandırır." #: src/tuples-and-arrays/tuples.md msgid "" "Fields of a tuple can be accessed by the period and the index of the value, " "e.g. `t.0`, `t.1`." msgstr "" +"Bir demetin alanlarına (fields) nokta ve değerin indeksi ile erişilebilir, " +"örneğin `t.0`, `t.1`." #: src/tuples-and-arrays/tuples.md msgid "" "The empty tuple `()` is referred to as the \"unit type\" and signifies " "absence of a return value, akin to `void` in other languages." msgstr "" +"Boş demet `()`, \"birim türü (unit type)\" olarak anılır ve, diğer " +"dillerdeki `void`'e benzer şekilde, bir geri dönüş değerinin (return value) " +"bulunmadığını belirtir." #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "" +"'for' deyimi (statement) diziler üzerinde adımlamayı/dolaşmayı destekler " +"(ancak demetler (tuples) üzerinde desteklemez)." #: src/tuples-and-arrays/iteration.md msgid "" "This functionality uses the `IntoIterator` trait, but we haven't covered " "that yet." msgstr "" +"Bu fonksiyonellik `IntoIterator` özelliğini (trait) kullanıyor, ancak bunu " +"henüz ele almadık." #: src/tuples-and-arrays/iteration.md msgid "" "The `assert_ne!` macro is new here. There are also `assert_eq!` and `assert!" -"` macros. These are always checked while, debug-only variants like " +"` macros. These are always checked, while debug-only variants like " "`debug_assert!` compile to nothing in release builds." msgstr "" +"`assert_ne!` makrosu burada yenidir. Ayrıca `assert_eq!` ve `assert!` " +"makroları da vardır. Bunlar her zaman kontrol edilirken, `debug_assert!` " +"gibi yalnızca hata ayıklama varyantları sürüm inşasında (release build) " +"hiçbir şeye derlenmez." #: src/tuples-and-arrays/destructuring.md msgid "" -"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:" +"Rust supports using pattern matching to destructure a larger value like a " +"tuple into its constituent parts:" msgstr "" +"Rust, bir demet (tuple) gibi daha büyük bir değeri, onu oluşturan parçalara " +"çözümlemek (destructure) için desen eşleştirmeyi (pattern matching) " +"kullanmayı destekler:" #: src/tuples-and-arrays/destructuring.md -msgid "\"left: {left}, right: {right}\"" -msgstr "" +msgid "\"{tuple:?}: {}\"" +msgstr "\"{tuple:?}: {}\"" #: src/tuples-and-arrays/destructuring.md -msgid "" -"However, Rust also supports using pattern matching to destructure a larger " -"value into its constituent parts:" -msgstr "" +msgid "\"ordered\"" +msgstr "\"sıralanmış\"" + +#: src/tuples-and-arrays/destructuring.md +msgid "\"unordered\"" +msgstr "\"sıralı de\"" #: src/tuples-and-arrays/destructuring.md msgid "" @@ -4041,12 +4345,18 @@ msgid "" "statically verify that the value on the right of `=` has the same structure " "as the pattern." msgstr "" +"Burada kullanılan desenler (patterns) \"reddedilemez (irrefutable)\"dir, " +"yani derleyici `=` sağındaki değerin desenle aynı yapıya sahip olduğunu " +"statik olarak doğrulayabilir." #: 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 "" +"Bir değişken adı, her zaman herhangi bir değerle eşleşen reddedilemez " +"(irrefutable) bir desendir, bu nedenle tek bir değişkeni bildirmek için " +"`let`'i kullanabiliriz." #: src/tuples-and-arrays/destructuring.md msgid "" @@ -4054,88 +4364,71 @@ msgid "" "comparison and destructuring to happen at the same time. This form of " "pattern matching will be discussed in more detail later." msgstr "" +"Rust ayrıca koşullu ifadelerde desenlerin (patterns) kullanılmasını " +"destekleyerek eşitlik karşılaştırmasının (comparison) ve çözümlenmenin " +"(destructuring) aynı anda gerçekleşmesine olanak tanır. Bu desen eşleştirme " +"stili daha sonra daha ayrıntılı olarak tartışılacaktır." #: 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 "" +"Desenin (pattern) eşleştirilen değerle eşleşmediğinde oluşacak derleyici " +"hatasını göstermek için yukarıdaki örnekleri düzenleyin." #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" -msgstr "" +msgstr "Diziler başka diziler de içerebilir:" #: src/tuples-and-arrays/exercise.md msgid "What is the type of this variable?" -msgstr "" +msgstr "Bu değişkenin türü nedir?" #: src/tuples-and-arrays/exercise.md msgid "" "Use an array such as the above to write a function `transpose` which will " "transpose a matrix (turn rows into columns):" msgstr "" - -#: src/tuples-and-arrays/exercise.md -msgid "Hard-code both functions to operate on 3 × 3 matrices." -msgstr "" +"Bir matrisin devrini (transpose) yapacak (satırları sütunlara çevirecek) " +"`transpose` fonksiyonu yazmak için yukarıdaki gibi bir dizi kullanın:" #: src/tuples-and-arrays/exercise.md msgid "" "Copy the code below to and implement the " -"functions:" -msgstr "" - -#: 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 "//\n" +"function. This function only operates on 3x3 matrices." msgstr "" +"Aşağıdaki kodu adresine kopyalayın ve " +"fonksiyonu gerçekleştirin (implement). Bu fonksiyon yalnızca 3x3'lük " +"matrislerde çalışır." #: 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/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 "[Slices: &\\[T\\]](./references/slices.md) (10 minutes)" -msgstr "[Dilimler: &\\[T\\]](../references/slices.md) (10 dakika)" +msgstr "// <-- bu yorum, rustfmt'nin yeni satır eklemesini sağlar\n" -#: src/references.md -msgid "[Strings](./references/strings.md) (10 minutes)" -msgstr "[Dizgeler](./references/strings.md) (10 dakika)" +#: src/references.md src/smart-pointers.md src/borrowing.md src/iterators.md +#: src/error-handling.md src/concurrency/async-pitfalls.md +msgid "This segment should take about 55 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 55 dakika sürmelidir. İçerir:" -#: src/references.md -msgid "[Exercise: Geometry](./references/exercise.md) (15 minutes)" +#: src/references/shared.md +msgid "" +"A reference provides a way to access another value without taking ownership " +"of the value, and is also called \"borrowing\". Shared references are read-" +"only, and the referenced data cannot change." msgstr "" +"Bir referans, değerin sahipliğini almadan başka bir değere erişmenin bir " +"yolunu sağlar ve \"ödünç alma (borrowing)\" olarak da adlandırılır. " +"Paylaşılan referanslar (shared reference) salt okunurdur (read-only) ve " +"referans edilen veriler değiştirilemez." -#: src/references.md src/smart-pointers.md src/error-handling.md -msgid "This segment should take about 55 minutes" -msgstr "" +#: src/references/shared.md src/std-traits/solution.md +msgid "'A'" +msgstr "'A'" #: 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 " -"references are read-only, and the referenced data cannot change." -msgstr "" +msgid "'B'" +msgstr "'B'" #: src/references/shared.md msgid "" @@ -4143,10 +4436,16 @@ msgid "" "with the `&` operator. The `*` operator \"dereferences\" a reference, " "yielding its value." msgstr "" +"`T` türüne yönelik paylaşılan referansın türü `&T`'dir. `&` operatörüyle bir " +"referans değeri (reference value) oluşturulur. `*` operatörü bir referansın " +"içeriğine eriştirir (dereference) ve onun değerini verir." #: src/references/shared.md -msgid "Rust will statically forbid dangling references:" +msgid "" +"References can never be null in Rust, so null checking is not necessary." msgstr "" +"Rust'ta referanslar hiçbir zaman null olamaz, bu yüzden null kontrolü (null " +"checking) gerekli değildir." #: src/references/shared.md msgid "" @@ -4155,6 +4454,11 @@ msgid "" "access the value, but is still \"owned\" by the original variable. The " "course will get into more detail on ownership in day 3." msgstr "" +"Bir referansın, atıfta bulunduğu (refer) değeri \"ödünç aldığı (barrow)\" " +"söylenir ve bu, göstericilere aşina olmayan öğrenciler için iyi bir " +"modeldir: kod, değere erişmek için referansı kullanabilir, ancak değer yine " +"de orijinal değişken tarafından \"sahiplidir (owned)\". Kurs, 3. günde " +"sahiplik (ownership) konusunda daha ayrıntılı bilgi verecektir." #: src/references/shared.md msgid "" @@ -4164,12 +4468,21 @@ msgid "" "cover how Rust prevents the memory-safety bugs that come from using raw " "pointers." msgstr "" +"Referanslar göstericiler (pointers) olarak gerçekleştirilir (implement) ve " +"önemli bir avantaj şudur ki, gösterdikleri şeyin boyutundan çok daha küçük " +"olabilmeleridir. C veya C++'a aşina olan öğrenciler referansları " +"göstericiler olarak tanıyacaklardır. Kursun ilerleyen bölümlerinde Rust'ın, " +"ham göstericilerin (raw pointers) kullanılmasından kaynaklanan bellek " +"emniyeti hatalarını (memory-safety bugs) nasıl önlediği ele alınacaktır." #: src/references/shared.md msgid "" -"Rust does not automatically create references for you - the `&` is always " -"required." +"Explicit referencing with `&` is usually required. However, Rust performs " +"automatic referencing and dereferencing when invoking methods." msgstr "" +"Açık bir şekilde (explicit) `&` ile referans vermek genellikle gereklidir. " +"Ancak, Rust metotları çağırırken referans verme ve referanstan çıkarma " +"(dereferencing) işlemlerini otomatik olarak gerçekleştirir." #: src/references/shared.md msgid "" @@ -4177,6 +4490,9 @@ msgid "" "methods (try `r.is_ascii()`). There is no need for an `->` operator like in " "C++." msgstr "" +"Rust bazı durumlarda, özellikle de metotları çağırırken (`r.is_ascii()`'i " +"deneyin) otomatik olarak referansın içeriğine erişecektir (auto-" +"dereference). C++'daki gibi `->` operatörüne gerek yoktur." #: src/references/shared.md msgid "" @@ -4185,30 +4501,48 @@ msgid "" "different from C++, where assignment to a reference changes the referenced " "value." msgstr "" +"Bu örnekte, `r` değiştirilebilir (mutable) olduğundan ona tekrar atama " +"yapılabilir (reassigned) (`r = &b`). Bunun `r`'yi yeniden bağladığını (re-" +"bind) ve böylece başka bir şeye atıfta bulunduğunu (refer) unutmayın. Bu C++ " +"dilinden, bir referansa atamanın (assignment) referans verilenin değerini " +"değiştirmesinden, farklıdır." #: src/references/shared.md msgid "" "A shared reference does not allow modifying the value it refers to, even if " "that value was mutable. Try `*r = 'X'`." msgstr "" +"Paylaşılan bir referans (shared reference), atıfta bulunduğu (refer) değerin " +"değiştirilmesine (modify), bu değer değiştirilebilir (mutable) olsa bile, " +"izin vermez. `*r = 'X'`'i deneyin." #: src/references/shared.md msgid "" "Rust is tracking the lifetimes of all references to ensure they live long " -"enough. Dangling references cannot occur in safe Rust. `x_axis` would return " -"a reference to `point`, but `point` will be deallocated when the function " -"returns, so this will not compile." +"enough. Dangling references cannot occur in safe Rust." msgstr "" +"Rust, yeterince uzun süre hayatta olmalarını sağlamak için tüm referansların " +"ömrülerini (lifetime) takip eder. Emniyetli (safe) Rust'ta boşa çıkan " +"referanslar (dangling reference) oluşamaz." #: src/references/shared.md -msgid "We will talk more about borrowing when we get to ownership." +msgid "" +"We will talk more about borrowing and preventing dangling references when we " +"get to ownership." msgstr "" +"Sahipliğe (ownership) geçince ödünç alma (borrowing) konusunu daha detaylı " +"konuşacağız.\n" +"Sahiplik (ownership) konusuna geldiğimizde ödünç alma ve boşa çıkan " +"referansları (dangling references) daha detaylı konuşacağız." #: src/references/exclusive.md msgid "" "Exclusive references, also known as mutable references, allow changing the " "value they refer to. They have type `&mut T`." msgstr "" +"Değiştirilebilir referanslar (mutable reference) olarak da bilinen özel " +"(exclusive) referanslar, atıfta bulundukları (refer) değerin " +"değiştirilmesine olanak tanır. Aynı zamanda, `&mut T` türüne sahiplerdir." #: src/references/exclusive.md msgid "" @@ -4218,6 +4552,11 @@ msgid "" "exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " "alive." msgstr "" +"\"Özel (exclusive)\", değere erişmek için yalnızca bu referansın " +"kullanılabileceği anlamına gelir. Aynı anda başka hiçbir referans " +"(paylaşılan veya özel olsun farketmez) mevcut olamaz ve özel referans " +"(exclusive) varken atıfta bulunan değere erişilemez. `x_coord` hayattayken " +"bir `&point.0` oluşturmayı veya `point.0`'ı değiştirmeyi deneyin." #: src/references/exclusive.md msgid "" @@ -4226,28 +4565,28 @@ msgid "" "bound to different values, while the second represents an exclusive " "reference to a mutable value." msgstr "" - -#: src/references/slices.md -msgid "Slices" -msgstr "Dilimler (Slices)" +"`let mut x_coord: &i32` ve `let x_coord: &mut i32` arasındaki farka dikkat " +"ettiğinizden emin olun. Birincisi, farklı değerlere bağlanabilen (bind) " +"paylaşılan bir referansı (shared reference) temsil ederken, ikincisi, " +"değiştirilebilir bir değere (mutable value) özel bir referansı (exclusive " +"reference) temsil eder (represent)." #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" msgstr "" +"Bir dilim (slice) size daha büyük bir koleksiyonun içinden bir görüntü verir:" #: src/references/slices.md msgid "Slices borrow data from the sliced type." -msgstr "" - -#: src/references/slices.md -msgid "Question: What happens if you modify `a[3]` right before printing `s`?" -msgstr "" +msgstr "Dilimler (slice), dilimlenmiş türden verileri ödünç alır (borrowing)." #: src/references/slices.md msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" +"`a`'yı ödünç alıp (borrowing) başlangıç ​​ve bitiş indekslerini köşeli " +"parantez içinde belirterek bir dilim (slice) oluşturuyoruz." #: src/references/slices.md msgid "" @@ -4255,17 +4594,24 @@ msgid "" "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" +"Dilim (slice) indeks 0'da başlıyorsa, Rust'ın aralık sözdizimi (range " +"syntax) başlangıç indeksini kullanmamaya izin verir; bu, `&a[0..a.len()]` ve " +"`&a[..a.len()]`dilimlerinin aynı olduğu anlamına gelir." #: src/references/slices.md msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." msgstr "" +"Aynı şey bitiş indeksi için de geçerlidir, dolayısıyla `&a[2..a.len()]` ve " +"`&a[2..]` aynıdır." #: src/references/slices.md msgid "" "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" +"Tüm bir dizinin dilimini (slice) kolayca oluşturmak için `&a[..]`'ı " +"kullanabiliriz." #: src/references/slices.md msgid "" @@ -4273,33 +4619,66 @@ msgid "" "(`&[i32]`) no longer mentions the array length. This allows us to perform " "computation on slices of different sizes." msgstr "" +"`s`,`i32`'lerin bir dilimine (slice) referanstır. `s` (`&[i32]`) türünün " +"artık dizi uzunluğundan bahsetmediğine dikkat edin. Bu bize farklı " +"boyutlardaki dilimler üzerinde hesaplama yapmamızı sağlar." #: src/references/slices.md 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 "" +"Dilimler (slice) her zaman başka bir nesneden ödünç alır (borrow). Bu " +"örnekte `a`'nın en azından dilimimiz (slice) kadar 'canlı " +"(alive)' (kapsamında) kalması gerekiyor." + +#: src/references/slices.md +msgid "You can't \"grow\" a slice once it's created:" +msgstr "Bir dilimi (slice) oluşturduktan sonra onu \"büyütemezsiniz\":" + +#: src/references/slices.md +msgid "" +"You can't append elements of the slice, since it doesn't own the backing " +"buffer." +msgstr "" +"Dilim (slice), destekleyici arabelleğe (backing buffer) sahip olmadığından, " +"dilimin öğelerine ekleyemezsiniz." + +#: src/references/slices.md +msgid "" +"You can't grow a slice to point to a larger section of the backing buffer. " +"The slice loses information about the underlying buffer and so you can't " +"know how larger the slice can be grown." +msgstr "" +"Bir dilimi (slice), destekleyici arabelleğin (backing buffer) daha büyük bir " +"bölümünü gösterecek şekilde büyütemezsiniz. Dilim, temel arabellek " +"(underlying buffer) hakkında bilgiyi kaybeder ve bu nedenle ne kadar " +"büyütülebileceğini bilemezsiniz." #: src/references/slices.md 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." +"To get a larger slice you have to back to the original buffer and create a " +"larger slice from there." msgstr "" +"Daha büyük bir dilim (slice) elde etmek için, orijinal arabelleği (buffer) " +"kullanarak daha büyük bir dilim (slice) oluşturmalısınız." #: src/references/strings.md msgid "We can now understand the two string types in Rust:" -msgstr "" +msgstr "Artık Rust'taki iki dize (string) türünü anlayabiliyoruz:" #: src/references/strings.md msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgstr "" +"`&str`, `&[u8]`e benzer şekilde, UTF-8 olarak kodlanmış baytların bir " +"dilimidir (slice)." #: src/references/strings.md -msgid "`String` is an owned, heap-allocated buffer of UTF-8 bytes." +msgid "" +"`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "" +"`String`, `Vec`ye benzer şekildedir, UTF-8 olarak kodlanmış baytlardan " +"oluşan sahipli bir arabellektir." #: src/references/strings.md src/std-traits/read-and-write.md msgid "\"World\"" @@ -4307,19 +4686,19 @@ msgstr "\"Dünya\"" #: src/references/strings.md msgid "\"s1: {s1}\"" -msgstr "" +msgstr "\"s1: {s1}\"" #: src/references/strings.md msgid "\"Hello \"" msgstr "\"Merhaba \"" -#: src/references/strings.md src/memory-management/move.md +#: src/references/strings.md msgid "\"s2: {s2}\"" -msgstr "" +msgstr "\"s2: {s2}\"" #: src/references/strings.md msgid "\"s3: {s3}\"" -msgstr "" +msgstr "\"s3: {s3}\"" #: src/references/strings.md msgid "" @@ -4327,12 +4706,19 @@ msgid "" "encoded string data stored in a block of memory. String literals " "(`\"Hello\"`), are stored in the program’s binary." msgstr "" +"`&str`, bir bellek bloğunda saklanan UTF-8 olarak kodlanmış dize (string) " +"verilerine değiştirilemez (immutable) referans olan bir dize dilimi (string " +"slice) sunar. Dize değişmezleri (string literals) (`\"Hello\"`), programın " +"ikili (binary) dosyasında saklanır." #: 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 "" +"Rust'ın `String` türü, baytlardan oluşan bir vektörün bir sarmalayıcı " +"türüdür. Bir `Vec` gibi, bu türden veri `String` türü tarafından " +"sahiplidir (owned)." #: src/references/strings.md msgid "" @@ -4340,12 +4726,19 @@ msgid "" "literal; `String::new()` creates a new empty string, to which string data " "can be added using the `push()` and `push_str()` methods." msgstr "" +"Diğer birçok türde olduğu gibi, `String::from()` bir dize değişmezinden " +"(string literal) bir string oluşturur; `String::new()` yeni bir boş dize " +"oluşturur ve dizeye veriler `push()` ve `push_str()` metotları kullanılarak " +"eklenebilir." #: 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 "" +"`format!()` makrosu, dinamik değerlerden sahipli bir dize oluşturmak için " +"uygun bir yoldur. Aynı biçimin `println!()` makrosundaki gibi aynı biçim " +"tanımlamasını kabul eder." #: src/references/strings.md msgid "" @@ -4354,6 +4747,12 @@ msgid "" "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" +"`String`'den `&str` dilimlerini (slices) `&` ve isteğe bağlı olarak aralık " +"seçimi (range selection) ile ödünç alabilirsiniz (barrow). Karakter " +"sınırlarının dışını da kapsayacak bir bayt aralığı seçerseniz, ifade " +"(expression) paniğe neden olacaktır. `chars` adımlayıcısı, karakterler " +"üzerinde adımlama yapar ve karakter sınırlarını doğru bulmaya çalışmak " +"yerine tercih edilir." #: src/references/strings.md msgid "" @@ -4362,10 +4761,17 @@ msgid "" "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 "" +"C++ programcıları için: `&str`'yi C++'daki `std::string_view` olarak " +"düşünün, ancak her zaman bellekteki geçerli bir dizeye işaret eder. Rust " +"dilindeki `String`, C++'daki `std::string`'in kabaca eşdeğeridir (ana fark: " +"yalnızca UTF-8 olarak kodlanmış baytlar içerebilir ve asla küçük dize " +"optimizasyonu / small-string optimization kullanmaz)." #: src/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "" +"Bayt dizelerinden değişmezler (Byte strings literals), doğrudan bir `&[u8]` " +"değeri oluşturmanıza olanak tanır:" #: src/references/strings.md msgid "" @@ -4373,6 +4779,53 @@ msgid "" "`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " "amount of `#` on either side of the quotes:" msgstr "" +"Ham (raw) dizeler, kaçış karakterlerininin devre dışı bırakıldığı bir `&str` " +"değeri oluşturmanıza olanak tanır: `r\"\\n\" == \"\\\\n\"`. Dizenin içindeki " +"çift tırnakları, dizeyi oluşturan tırnakların her iki tarafınaa eşit sayıda " +"`#` karakteri koyarak görebilirsiniz:" + +#: src/references/dangling.md +msgid "" +"Rust enforces a number of rules for references that make them always safe to " +"use. One rule is that references can never be `null`, making them safe to " +"use without `null` checks. The other rule we'll look at for now is that " +"references can't _outlive_ the data they point to." +msgstr "" +"Rust, referansların her zaman emniyetli (safe) kullanılmasını sağlayan bir " +"dizi kural uygular. Bunlardan biri, referansların asla `null` " +"olamayacağıdır; bu da `null` kontrolü yapmadan emniyetli kullanılmalarını " +"sağlar. Şimdi bakacağımız diğer kural ise, referansların gösterdikleri " +"veriden _daha uzun ömürlü (outlive)_ olamayacaklarıdır." + +#: src/references/dangling.md +msgid "" +"This slide gets students thinking about references as not simply being " +"pointers, since Rust has different rules for references than other languages." +msgstr "" +"Bu slayt, Rust'ın referanslar için diğer dillerden farklı kuralları " +"olduğundan, öğrencilerin referansların sadece göstericiler (pointers) " +"olmadığını düşünmelerini sağlar." + +#: src/references/dangling.md +msgid "" +"We'll look at the rest of Rust's borrowing rules on day 3 when we talk about " +"Rust's ownership system." +msgstr "" +"Rust'ın ödünç alma (borrowing) kurallarının geri kalanına, 3. günde Rust'ın " +"sahiplik (ownership) sisteminden bahsederken bakacağız." + +#: src/references/dangling.md +msgid "" +"Rust's equivalent of nullability is the `Option` type, which can be used to " +"make any type \"nullable\" (not just references/pointers). We haven't yet " +"introduced enums or pattern matching, though, so try not to go into too much " +"detail about this here." +msgstr "" +"Rust dilindeki null olabilirliğin karşılığı `Option` türüdür, bu tür " +"herhangi bir türü \"null olabilir (nullable)\" hâle getirmek için " +"kullanılabilir (sadece referanslar/göstericiler değil). Ancak henüz " +"enum'ları veya desen eşleştirmeyi (pattern matching) tanıtmadık, bu yüzden " +"burada bu konulara fazla girmemeye çalış." #: src/references/exercise.md msgid "" @@ -4380,6 +4833,9 @@ msgid "" "representing a point as `[f64;3]`. It is up to you to determine the function " "signatures." msgstr "" +"3 boyutlu geometri için, bir noktayı `[f64;3]` olarak temsil eden birkaç " +"yardımcı fonksiyon oluşturacağız. Fonksiyon imzalarını belirlemek size " +"kalmış." #: src/references/exercise.md msgid "" @@ -4389,112 +4845,109 @@ msgid "" "square\n" "// root, like `v.sqrt()`.\n" msgstr "" +"// Bir vektörün büyüklüğünü, koordinatlarının karelerini toplayarak " +"hesaplayın\n" +"// ve karekökünü alın. Karekökü hesaplamak için `sqrt()` metodunu kullanın,\n" +"// örneğin `v.sqrt()` gibi.\n" #: src/references/exercise.md msgid "" "// Normalize a vector by calculating its magnitude and dividing all of its\n" "// coordinates by that magnitude.\n" msgstr "" +"// Bir vektörü, büyüklüğünü hesaplayarak ve tüm koordinatlarını bu " +"büyüklüğe\n" +"// bölererek normalize edin.\n" #: src/references/exercise.md msgid "// Use the following `main` to test your work.\n" msgstr "" +"// Çalışmanızı test etmek için aşağıdaki `main` fonksiyonunu kullanın.\n" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of a unit vector: {}\"" -msgstr "" +msgstr "\"Birim vektörünün büyüklüğü: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?}: {}\"" -msgstr "" +msgstr "\"{v:?} vektörünün büyüklüğü: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?} after normalization: {}\"" -msgstr "" +msgstr "\"Normalize edildikten sonra {v:?} vektörünün büyüklüğü: {}\"" #: src/references/solution.md msgid "/// Calculate the magnitude of the given vector.\n" -msgstr "" +msgstr "/// Verilen vektörün büyüklüğünü hesaplayın.\n" #: src/references/solution.md msgid "" "/// Change the magnitude of the vector to 1.0 without changing its " "direction.\n" -msgstr "" - -#: src/user-defined-types.md -msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" -msgstr "" - -#: src/user-defined-types.md -msgid "[Static](./user-defined-types/static.md) (5 minutes)" -msgstr "[Static](./user-defined-types/static.md) (5 dakika)" +msgstr "/// Vektörün büyüklüğünü, yönünü değiştirmeden 1.0'a değiştirin.\n" -#: src/user-defined-types.md -msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" -msgstr "" - -#: src/user-defined-types.md +#: src/references/solution.md msgid "" -"[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" +"Note that in `normalize` we were able to do `*item /= mag` to modify each " +"element. This is because we're iterating using a mutable reference to an " +"array, which causes the `for` loop to give mutable references to each " +"element." msgstr "" +"`normalize` fonksiyonunda her bir elemanı değiştirmek için `*item /= mag` " +"yapabildiğimize dikkat edin. Bunun sebebi, bir diziye değiştirilebilir " +"(mutable) referans kullanarak döngü de dönmemizdir; bu da `for` döngüsünün " +"her elemana değiştirilebilir (mutable) referanslar vermesini sağlar." -#: src/user-defined-types.md src/methods-and-traits.md src/borrowing.md -#: src/lifetimes.md -msgid "This segment should take about 50 minutes" -msgstr "" +#: src/user-defined-types.md src/std-types.md src/std-traits.md +#: src/memory-management.md +msgid "This segment should take about 1 hour. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat sürmelidir. İçeriği:" #: src/user-defined-types/named-structs.md msgid "Like C and C++, Rust has support for custom structs:" msgstr "" +"C ve C++ dillerindeki gibi Rust'ın da özel (kullanıcı tanımlı) yapılara " +"desteği vardır:" #: src/user-defined-types/named-structs.md msgid "\"{} is {} years old\"" -msgstr "" +msgstr "\"{} {} yaşında\"" #: src/user-defined-types/named-structs.md #: src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" -msgstr "" +msgstr "\"Peter\"" #: src/user-defined-types/named-structs.md msgid "\"Avery\"" -msgstr "" - -#: src/user-defined-types/named-structs.md -msgid "\"Jackie\"" -msgstr "" +msgstr "\"Avery\"" #: src/user-defined-types/named-structs.md src/user-defined-types/enums.md #: src/pattern-matching/match.md src/methods-and-traits/methods.md msgid "Key Points:" -msgstr "" +msgstr "Önemli Noktalar:" #: src/user-defined-types/named-structs.md msgid "Structs work like in C or C++." -msgstr "" +msgstr "Yapılar C veya C++'daki gibi çalışır." #: src/user-defined-types/named-structs.md msgid "Like in C++, and unlike in C, no typedef is needed to define a type." msgstr "" +"C++'daki gibi ve C'den farklı olarak, bir türü tanımlamak için typedef'e " +"gerek yoktur." #: src/user-defined-types/named-structs.md msgid "Unlike in C++, there is no inheritance between structs." -msgstr "" +msgstr "C++'dan farklı olarak yapılar arasında kalıtım (inheritance) yoktur." #: src/user-defined-types/named-structs.md msgid "" "This may be a good time to let people know there are different types of " "structs." msgstr "" +"Bu, insanlara farklı yapı türleri olduğunu duyurmak için iyi bir zaman " +"olabilir." #: src/user-defined-types/named-structs.md msgid "" @@ -4502,118 +4955,197 @@ msgid "" "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" +"Sıfır boyutlu (zero-sized) yapılar (örn. `struct Foo;`), bir özelliğin " +"(trait) bazı türlere gerçekleştiriminde (implementing) kullanılabilir, ancak " +"değer olarak kendisinde saklamak istenilen herhangi bir veri yoktur." #: src/user-defined-types/named-structs.md msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" +"Sonraki slaytta alan adları (field names) önemli olmadığında kullanılan " +"Demet (Tuple) yapıları tanıtılacaktır." #: src/user-defined-types/named-structs.md msgid "" "If you already have variables with the right names, then you can create the " "struct using a shorthand." msgstr "" +"Eğer zaten doğru adlara sahip değişkenleriniz varsa, o zaman yapıyı bir " +"kısaltma kullanarak oluşturabilirsiniz." + +#: src/user-defined-types/named-structs.md +msgid "" +"Struct fields do not support default values. Default values are specified by " +"implementing the `Default` trait which we will cover later." +msgstr "" +"Yapı alanları (struct fields) varsayılan değerleri desteklemez. Varsayılan " +"değerler, daha sonra ele alacağımız `Default` özelliği (trait) uygulanarak " +"belirtilir." + +#: src/user-defined-types/named-structs.md +msgid "You can also demonstrate the struct update syntax here:" +msgstr "" +"Burada aynı zamanda yapı güncelleme sözdizimini (struct update syntax) de " +"gösterebilirsiniz:" + +#: src/user-defined-types/named-structs.md +msgid "\"Jackie\"" +msgstr "\"Jackie\"" + +#: src/user-defined-types/named-structs.md +msgid "" +"It allows us to copy the majority of the fields from the old struct without " +"having to explicitly type it all out. It must always be the last element." +msgstr "" +"Bu, eski yapının (struct) alanlarının çoğunu açıkça tek tek yazmak zorunda " +"kalmadan kopyalamamıza olanak tanır. Bu her zaman son öğe olmalıdır." #: src/user-defined-types/named-structs.md msgid "" -"The syntax `..avery` allows us to copy the majority of the fields from the " -"old struct without having to explicitly type it all out. It must always be " -"the last element." +"It is mainly used in combination with the `Default` trait. We will talk " +"about struct update syntax in more detail on the slide on the `Default` " +"trait, so we don't need to talk about it here unless students ask about it." msgstr "" +"Bu, çoğunlukla `Default` özelliği (trait) ile birlikte kullanılır. `Default` " +"özelliği ile ilgili slaytta yapı güncelleme sözdizimini (struct update " +"syntax) daha detaylı ele alacağız, bu yüzden öğrenciler sormadıkça burada " +"bahsetmemize gerek yok." #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" msgstr "" +"Alan adları (field names) önemsizse demet (tuple) yapısını kullanabilirsiniz:" #: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" -msgstr "" +msgstr "\"({}, {})\"" #: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" +"Bu genellikle tek alanlı sarmalayıcılar (single-field wrappers - newtype " +"deseni olarak adlandırılır) için kullanılır:" #: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" -msgstr "" +msgstr "\"NASA'daki bir roket bilim adamına sorun\"" #: src/user-defined-types/tuple-structs.md #: src/android/interoperability/cpp/cpp-bridge.md #: src/bare-metal/microcontrollers/type-state.md -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" -msgstr "" +msgstr "// ...\n" #: src/user-defined-types/tuple-structs.md msgid "" "Newtypes are a great way to encode additional information about the value in " "a primitive type, for example:" msgstr "" +"Yeni tür (newtype) deseni, ilkel (primitive) bir türdeki değer hakkındaki ek " +"bilgileri kodlamanın harika bir yoludur, örneğin:" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." -msgstr "" +msgstr "Sayı bazı birimlerde ölçülür: Yukarıdaki örnekte `Newtons`." #: src/user-defined-types/tuple-structs.md msgid "" "The value passed some validation when it was created, so you no longer have " "to validate it again at every use: `PhoneNumber(String)` or `OddNumber(u32)`." msgstr "" +"Değer, oluşturulduğunda bir miktar doğrulamadan geçti, bu nedenle artık onu " +"her kullanımda yeniden doğrulamanız gerekmiyor: `PhoneNumber(String)` veya " +"`OddNumber(u32)`." #: src/user-defined-types/tuple-structs.md msgid "" "Demonstrate how to add a `f64` value to a `Newtons` type by accessing the " "single field in the newtype." msgstr "" +"Yeni türde desenindeki tek alana erişerek bir `Newtons` türüne `f64` " +"değerinin nasıl ekleneceğini gösterin." #: src/user-defined-types/tuple-structs.md msgid "" "Rust generally doesn’t like inexplicit things, like automatic unwrapping or " "for instance using booleans as integers." msgstr "" +"Rust genellikle bir nesnenin değerinin otomatik çözülmesini (automatic " +"unwrapping) veya boole değerlerini tamsayı olarak kullanmak gibi açık " +"olmayan şeylerden hoşlanmaz." #: src/user-defined-types/tuple-structs.md msgid "Operator overloading is discussed on Day 3 (generics)." +msgstr "Operatör yüklemesi 3. günde (genelleştirmeler(generics)) tartışıldı." + +#: src/user-defined-types/tuple-structs.md +msgid "" +"When a tuple struct has zero fields, the `()` can be omitted. The result is " +"a zero-sized type (ZST), of which there is only one value (the name of the " +"type)." msgstr "" +"Bir demet (tuple) yapısının sıfır alanı varsa, `()` kısmı atlanabilir. " +"Böylece ortaya sıfır boyutlu (zero-sized) bir tür (SBT/ZST) çıkar ve bu " +"türün yalnızca bir değeri vardır (türün adı)." + +#: src/user-defined-types/tuple-structs.md +msgid "" +"This is common for types that implement some behavior but have no data " +"(imagine a `NullReader` that implements some reader behavior by always " +"returning EOF)." +msgstr "" +"Bu, bazı davranışları uygulayan verisi olmayan türler için yaygındır (her " +"zaman EOF döndüren bir `NullReader` hayal edin; okuma davranışını uygular " +"ama veri içermez)." #: src/user-defined-types/tuple-structs.md msgid "" "The example is a subtle reference to the [Mars Climate Orbiter](https://en." "wikipedia.org/wiki/Mars_Climate_Orbiter) failure." msgstr "" +"Örnek, [Mars İklim Yörünge Aracı](https://en.wikipedia.org/wiki/" +"Mars_Climate_Orbiter) hatasına incelikli bir göndermedir." #: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" +"`enum` anahtar sözcüğü birkaç farklı varyanta sahip bir türün yaratılmasına " +"olanak sağlar:" #: src/user-defined-types/enums.md msgid "// Simple variant\n" -msgstr "" +msgstr "// Basit (Simple) varyant\n" #: src/user-defined-types/enums.md msgid "// Tuple variant\n" -msgstr "" +msgstr "// Demet (Tuple) varyantı\n" #: src/user-defined-types/enums.md msgid "// Struct variant\n" -msgstr "" +msgstr "// Yapı (Struct) varyantı\n" #: src/user-defined-types/enums.md -msgid "\"On this turn: {:?}\"" -msgstr "" +msgid "\"On this turn: {player_move:?}\"" +msgstr "\"Sıradaki hamle: {player_move:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "" +"Numaralandırmalar, bir dizi değeri tek bir tür altında toplamanıza olanak " +"tanır." #: src/user-defined-types/enums.md msgid "" "`Direction` is a type with variants. There are two values of `Direction`: " "`Direction::Left` and `Direction::Right`." msgstr "" +"`Direction`, varyantları olan bir türdür. `Direction`'ın iki değeri vardır: " +"`Direction::Left` ve `Direction::Right`." #: src/user-defined-types/enums.md msgid "" @@ -4621,16 +5153,24 @@ msgid "" "Rust will store a discriminant so that it knows at runtime which variant is " "in a `PlayerMove` value." msgstr "" +"`PlayerMove` üç varyantı olan bir türdür. Rust, varyant ek yüküne (variant " +"payloads) ek olarak, çalışma zamanında hangi varyantın `PlayerMove` " +"değerinde olduğunu bilmesi için bir ayırıcı (discriminant) da depolar." #: src/user-defined-types/enums.md msgid "This might be a good time to compare structs and enums:" msgstr "" +"Bu, yapıları ve numaralandırmaları karşılaştırmak için iyi bir zaman " +"olabilir:" #: src/user-defined-types/enums.md msgid "" "In both, you can have a simple version without fields (unit struct) or one " "with different types of fields (variant payloads)." msgstr "" +"Her ikisinde de, alanları olmayan basit bir versiyona (birim yapı) veya " +"farklı alan türlerine sahip bir versiyona (varyant ek yükleri) sahip " +"olabilirsiniz." #: src/user-defined-types/enums.md msgid "" @@ -4638,14 +5178,17 @@ msgid "" "structs but then they wouldn’t be the same type as they would if they were " "all defined in an enum." msgstr "" +"Bir enum'ın farklı varyantlarını ayrı yapılarla bile uygulayabilirsiniz " +"ancak o zaman da hepsi bir enum'da tanımlanmış olduğunda olacağı gibi aynı " +"türde olmazlardı." #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." -msgstr "" +msgstr "Rust, ayırıcıyı (discriminant) depolamak için minimum alan kullanır." #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" -msgstr "" +msgstr "Gerekirse, gereken en küçük boyuttaki bir tam sayıyı depolar" #: src/user-defined-types/enums.md msgid "" @@ -4654,29 +5197,30 @@ msgid "" "optimization\"). For example, `Option<&u8>` stores either a pointer to an " "integer or `NULL` for the `None` variant." msgstr "" +"İzin verilen varyant değerleri tüm bit desenlerini kapsamıyorsa, ayırıcıyı " +"kodlamak için geçersiz bit desenleri kullanır (\"niş/oyuk/niche " +"optimizasyonu\"). Örneğin, `Option<&u8>`, `None` varyantı için bir tamsayıya " +"gösterici veya `NULL` depolar." #: src/user-defined-types/enums.md msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" +"Gerekirse ayırıcıyı kontrol edebilirsiniz (örneğin, C ile uyumluluk için):" #: src/user-defined-types/enums.md msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." -msgstr "" - -#: 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" -msgstr "" +msgstr "`repr` olmadan, ayırıcı tür 2 baytlık olur, çünkü 10001 2 bayta sığar." #: src/user-defined-types/enums.md msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." msgstr "" +"Rust, enum'ların daha az yer kaplamasını sağlamak için kullanabileceği " +"çeşitli optimizasyonlara sahiptir." #: src/user-defined-types/enums.md msgid "" @@ -4684,6 +5228,9 @@ msgid "" "option/#representation), Rust guarantees that `size_of::()` equals " "`size_of::>()`." msgstr "" +"Null gösterici optimizasyonu: [Bazı türler](https://doc.rust-lang.org/std/" +"option/#representation) için, Rust `size_of::()`'nin `size_of::" +">()`'ye eşit olduğunu garanti eder." #: src/user-defined-types/enums.md msgid "" @@ -4691,16 +5238,84 @@ msgid "" "like in practice. It's important to note that the compiler provides no " "guarantees regarding this representation, therefore this is totally unsafe." msgstr "" +"Bitsel gösterimin pratikte nasıl _görünebileceğini_ göstermek istiyorsanız " +"örnek kod aşağıdadır. Derleyicinin bu gösterimle (representation) ilgili " +"hiçbir garanti sağlamadığını, dolayısıyla bunun tamamen emniyetsiz olduğunu " +"belirtmek önemlidir." + +#: src/user-defined-types/aliases.md +msgid "" +"A type alias creates a name for another type. The two types can be used " +"interchangeably." +msgstr "" +"Bir tür eş ismi, başka bir tür için bir isim oluşturur. Her iki tür de " +"birbirinin yerine kullanılabilir." + +#: src/user-defined-types/aliases.md +msgid "// Aliases are more useful with long, complex types:\n" +msgstr "" +"// Eş isimler (aliases) uzun ve karmaşık türlerde daha kullanışlıdır:\n" + +#: src/user-defined-types/aliases.md +msgid "" +"A [newtype](tuple-structs.html) is often a better alternative since it " +"creates a distinct type. Prefer `struct InventoryCount(usize)` to `type " +"InventoryCount = usize`." +msgstr "" +"Bir [yeni tür (newtype)](tuple-structs.html) deseni genellikle farklı bir " +"tür oluşturduğu için daha iyi bir seçenektir. `type InventoryCount = usize` " +"yerine `struct InventoryCount(usize)`'ı tercih edin." + +#: src/user-defined-types/aliases.md +msgid "C programmers will recognize this as similar to a `typedef`." +msgstr "C programcıları bunun, `typedef`'e benzer olduğunu anlayacaklardır." + +#: src/user-defined-types/const.md +msgid "`const`" +msgstr "`const`" + +#: src/user-defined-types/const.md +msgid "" +"Constants are evaluated at compile time and their values are inlined " +"wherever they are used:" +msgstr "" +"Sabitler (constants) derleme zamanında (compile-time) değerlendirilir ve " +"değerleri kullanıldıkları her yerde satır içi (inline) olarak belirtilir:" + +#: src/user-defined-types/const.md +msgid "" +"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" +"vs-static.html) these are inlined upon use." +msgstr "" +"[Rust RFC Book'a](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html) göre bunlar kullanım sırasında satır içidir (inline)." + +#: 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 "" +"Sadece `const` olarak işaretlenen fonksiyonlar derleme zamanında çağrılarak " +"`const` değerler üretilebilir. Ancak `const` fonksiyonlar çalışma zamanında " +"da çağrılabilir." + +#: src/user-defined-types/const.md +msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" +msgstr "" +"`const`'un C++'ın `constexpr`'ına anlamsal olarak benzer davrandığını " +"belirtin" #: src/user-defined-types/static.md msgid "`static`" -msgstr "" +msgstr "`static`" #: src/user-defined-types/static.md msgid "" "Static variables will live during the whole execution of the program, and " "therefore will not move:" msgstr "" +"Statik değişkenler programın tüm yürütmesi (execution) boyunca yaşayacak ve " +"bu nedenle taşınmayacaklar (not move):" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" @@ -4708,7 +5323,7 @@ msgstr "\"RustOS 3.14'e Hoş Geldiniz\"" #: src/user-defined-types/static.md msgid "\"{BANNER}\"" -msgstr "" +msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md msgid "" @@ -4719,16 +5334,26 @@ msgid "" "globally-scoped value does not have a reason to need object identity, " "`const` is generally preferred." msgstr "" +"[Rust RFC Kitabında](https://rust-lang.github.io/rfcs/0246-const-vs-static." +"html) belirtildiği gibi, statik kullanımı satır içi (inline) özelliği vermez " +"ve gerçek bir ilişkili bellek konumuna sahiptir. Bu, emniyetsiz (unsafe) ve " +"gömülü (embedded) kod için yararlıdır ve değişken, program yürütmesinin " +"tamamı boyunca yaşar. Global kapsamlı (globally-scoped) bir değerin nesne " +"kimliğine (object identity) ihtiyaç duyması için bir nedeni olmadığında, " +"genellikle `const` tercih edilir." #: src/user-defined-types/static.md msgid "`static` is similar to mutable global variables in C++." -msgstr "" +msgstr "`statik`, C++'daki değiştirilebilir olan global değişkenlere benzer." #: 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 "" +"`static`, `Mutex` gibi iç değişebilirliğe (interior mutability) sahip " +"türlerin gerektirdiği şekilde bellekteki bir adres ve durumu nesneye kimlik " +"olarak sağlar." #: src/user-defined-types/static.md msgid "" @@ -4736,56 +5361,26 @@ msgid "" "`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html), atomic or similar." msgstr "" +"Çünkü `static` değişkenlere herhangi bir iş parçacığından (thread) " +"erişilebildiğinden, bunların `Sync` olması gerekir. İç değişebilirlik " +"(Interior mutability) [`Mutex`](https://doc.rust-lang.org/std/sync/struct." +"Mutex.html), atomik veya benzer yöntemlerle mümkündür." + +#: src/user-defined-types/static.md +msgid "" +"It is common to use `OnceLock` in a static as a way to support " +"initialization on first use. `OnceCell` is not `Sync` and thus cannot be " +"used in this context." +msgstr "" +"İlk kullanımda ilklendirmeyi (initialization) desteklemek için `static` " +"içinde `OnceLock` kullanmak yaygındır. `OnceCell`, `Sync` olmadığı için bu " +"bağlamda kullanılamaz." #: src/user-defined-types/static.md msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" - -#: src/user-defined-types/const.md -msgid "`const`" -msgstr "" - -#: 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/const.md -msgid "" -"According to the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" -"vs-static.html) these are inlined upon use." -msgstr "" - -#: 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/const.md -msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" -msgstr "" - -#: src/user-defined-types/const.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 "" - -#: src/user-defined-types/aliases.md -msgid "" -"A type alias creates a name for another type. The two types can be used " -"interchangeably." -msgstr "" - -#: src/user-defined-types/aliases.md -msgid "// Aliases are more useful with long, complex types:\n" -msgstr "" - -#: src/user-defined-types/aliases.md -msgid "C programmers will recognize this as similar to a `typedef`." -msgstr "" +"İş parçacığı için yerel (thread-local) veriler `std::thread_local` makrosu " +"ile oluşturulabilir." #: src/user-defined-types/exercise.md msgid "" @@ -4794,6 +5389,10 @@ msgid "" "various events. Use `#[derive(Debug)]` to allow the types to be formatted " "with `{:?}`." msgstr "" +"Bir asansör kontrol sistemindeki bir olayı temsil etmek için bir veri yapısı " +"oluşturacağız. Çeşitli olayları yapılandırmak için türleri ve fonksiyonları " +"tanımlamak size kalmış. Türlerin `{:?}` ile biçimlendirilmesine (format) " +"izin vermek için `#[derive(Debug)]` kullanın." #: src/user-defined-types/exercise.md msgid "" @@ -4801,97 +5400,116 @@ msgid "" "`main` runs without errors. The next part of the course will cover getting " "data out of these structures." msgstr "" +"Bu alıştırma yalnızca, `main`'in hatasız çalışması için veri yapıları " +"oluşturmayı ve doldurmayı gerektirir. Kursun bir sonraki kısmı bu yapılardan " +"veri almayı kapsayacaktır." #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// An event in the elevator system that the controller must react to.\n" -msgstr "" +msgstr "/// Asansör sisteminde kontrolörün tepki vermesi gereken bir olay.\n" #: src/user-defined-types/exercise.md msgid "// TODO: add required variants\n" -msgstr "" +msgstr "// TODO: gerekli değişkeleri (variant) ekle\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A direction of travel.\n" msgstr "" +"/// Bir seyahat yönü.\n" +"\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car has arrived on the given floor.\n" -msgstr "" +msgstr "/// Kabin verilen kata ulaşmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have opened.\n" -msgstr "" +msgstr "/// Kabin kapıları açılmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have closed.\n" -msgstr "" +msgstr "/// Kabin kapıları kapanmış durumda.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "" "/// A directional button was pressed in an elevator lobby on the given " "floor.\n" -msgstr "" +msgstr "/// Verilen kattaki asansör lobisinde yön düğmesine basıldı.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A floor button was pressed in the elevator car.\n" -msgstr "" +msgstr "/// Asansör kabininde bir kat düğmesine basıldı.\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A ground floor passenger has pressed the up button: {:?}\"" -msgstr "" +msgstr "\"Zemin kattaki bir yolcu yukarı düğmesine basmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" -msgstr "" +msgstr "\"Kabin zemin kata ulaşmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door opened: {:?}\"" -msgstr "" +msgstr "\"Kabin kapısı açıldı: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" -msgstr "" +msgstr "\"Bir yolcu 3. katın düğmesine basmış durumda: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" -msgstr "" +msgstr "\"Kabin kapısı kapandı: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the 3rd floor: {:?}\"" +msgstr "\"Kabin 3. kata ulaşmış durumda: {:?}\"" + +#: src/user-defined-types/exercise.md +msgid "" +"If students ask about `#![allow(dead_code)]` at the top of the exercise, " +"it's necessary because the only thing we do with the `Event` type is print " +"it out. Due to a nuance of how the compiler checks for dead code this causes " +"it to think that the code is unused. They can ignore it for the purpose of " +"this exercise." msgstr "" +"Eğer öğrenciler alıştırmanın en üstündeki `#![allow(dead_code)]` satırını " +"sorarlarsa, bunun nedeni `Event` türüyle yaptığımız tek şeyin onu ekrana " +"yazdırmak olmasıdır. Derleyicinin ölü kodu (dead code) kontrol etme " +"biçimindeki bir ayrıntı nedeniyle, bu durum kodun kullanılmadığını sanmasına " +"yol açar. Öğrenciler bu satırı bu alıştırma özelinde görmezden gelebilirler." #: src/user-defined-types/solution.md msgid "/// A button was pressed.\n" -msgstr "" +msgstr "/// Bir düğmeye basıldı.\n" #: src/user-defined-types/solution.md msgid "/// The car has arrived at the given floor.\n" -msgstr "" +msgstr "/// Kabin verilen kata ulaşmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have opened.\n" -msgstr "" +msgstr "/// Kabin kapıları açılmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have closed.\n" -msgstr "" +msgstr "/// Kabin kapıları kapanmış durumda.\n" #: src/user-defined-types/solution.md msgid "/// A floor is represented as an integer.\n" -msgstr "" +msgstr "/// Bir kat tamsayı olarak temsil edilir.\n" #: src/user-defined-types/solution.md msgid "/// A user-accessible button.\n" -msgstr "" +msgstr "/// Kullanıcının erişebileceği bir düğme.\n" #: src/user-defined-types/solution.md msgid "/// A button in the elevator lobby on the given floor.\n" -msgstr "" +msgstr "/// Verilem katta asansör lobisinde bulunan bir düğme.\n" #: src/user-defined-types/solution.md msgid "/// A floor button within the car.\n" -msgstr "" +msgstr "/// Kabinin içindeki bir kat düğmesi.\n" #: src/welcome-day-2.md msgid "Welcome to Day 2" @@ -4925,58 +5543,81 @@ msgid "" msgstr "" #: src/welcome-day-2.md -msgid "[Welcome](./welcome-day-2.md) (3 minutes)" +msgid "Closures: function pointers with data." msgstr "" -#: src/welcome-day-2.md -msgid "[Pattern Matching](./pattern-matching.md) (1 hour)" +#: src/pattern-matching.md src/lifetimes.md +msgid "This segment should take about 50 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 50 dakika sürmelidir. İçeriği:" + +#: src/pattern-matching/infallible.md +msgid "" +"In day 1 we briefly saw how patterns can be used to _destructure_ compound " +"values. Let's review that and talk about a few other things patterns can " +"express:" msgstr "" -#: src/welcome-day-2.md -msgid "[Methods and Traits](./methods-and-traits.md) (50 minutes)" -msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" +#: src/pattern-matching/infallible.md +msgid "// This does the same thing as above.\n" +msgstr "" -#: src/welcome-day-2.md -msgid "[Generics](./generics.md) (40 minutes)" +#: src/pattern-matching/infallible.md +msgid "// Ignore the first element, only bind the second and third.\n" msgstr "" -#: src/welcome-day-2.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 55 " -"minutes" +#: src/pattern-matching/infallible.md +msgid "// Ignore everything but the last element.\n" msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 55 dakika sürecektir" -#: src/pattern-matching.md -msgid "[Matching Values](./pattern-matching/match.md) (10 minutes)" +#: src/pattern-matching/infallible.md src/pattern-matching/match.md +#: src/generics/exercise.md src/generics/solution.md src/std-traits/solution.md +msgid "'a'" msgstr "" -#: src/pattern-matching.md -msgid "[Destructuring](./pattern-matching/destructuring.md) (10 minutes)" +#: src/pattern-matching/infallible.md +msgid "" +"All of the demonstrated patterns are _irrefutable_, meaning that they will " +"always match the value on the right hand side." msgstr "" -#: src/pattern-matching.md -msgid "[Let Control Flow](./pattern-matching/let-control-flow.md) (10 minutes)" +#: src/pattern-matching/infallible.md +msgid "" +"Patterns are type-specific, including irrefutable patterns. Try adding or " +"removing an element to the tuple and look at the resulting compiler errors." msgstr "" -#: src/pattern-matching.md +#: src/pattern-matching/infallible.md msgid "" -"[Exercise: Expression Evaluation](./pattern-matching/exercise.md) (30 " -"minutes)" +"Variable names are patterns that always match and which bind the matched " +"value into a new variable with that name." msgstr "" +"Değişken adları her zaman eşleşen ve eşleşen değeri o isimle yeni bir " +"değişkene bağlayan kalıplardır." -#: src/pattern-matching.md src/memory-management.md -msgid "This segment should take about 1 hour" +#: src/pattern-matching/infallible.md +msgid "" +"`_` is a pattern that always matches any value, discarding the matched value." msgstr "" -#: src/pattern-matching/match.md +#: src/pattern-matching/infallible.md +msgid "`..` allows you to ignore multiple values at once." +msgstr "" + +#: src/pattern-matching/infallible.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." +"You can also demonstrate more advanced usages of `..`, such as ignoring the " +"middle elements of a tuple." +msgstr "" + +#: src/pattern-matching/infallible.md +msgid "All of these patterns work with arrays as well:" msgstr "" #: src/pattern-matching/match.md -msgid "The patterns can be simple values, similarly to `switch` in C and C++:" +msgid "" +"The `match` keyword lets you match a value against one or more _patterns_. " +"The patterns can be simple values, similarly to `switch` in C and C++, but " +"they can also be used to express more complex conditions:" msgstr "" #: src/pattern-matching/match.md @@ -4991,12 +5632,6 @@ msgstr "" msgid "\"Quitting\"" msgstr "" -#: 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/match.md msgid "'s'" msgstr "" @@ -5013,13 +5648,11 @@ msgstr "" msgid "\"Moving around\"" msgstr "" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md msgid "'0'" msgstr "" -#: src/pattern-matching/match.md src/error-handling/exercise.md -#: src/error-handling/solution.md +#: src/pattern-matching/match.md msgid "'9'" msgstr "" @@ -5035,28 +5668,17 @@ msgstr "" 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 -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 "" - #: 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." +"can be used within the match arm. We will learn more about this on the next " +"slide." msgstr "" #: src/pattern-matching/match.md -msgid "A match guard causes the arm to match only if the condition is true." +msgid "" +"A match guard causes the arm to match only if the condition is true. If the " +"condition is false the match will continue checking later cases." msgstr "" #: src/pattern-matching/match.md @@ -5102,100 +5724,157 @@ msgid "" "with an `|`." msgstr "" -#: src/pattern-matching/destructuring.md -msgid "Like tuples, structs and enums can also be destructured by matching:" +#: src/pattern-matching/match.md +msgid "" +"Note that you can't use an existing variable as the condition in a match " +"arm, as it will instead be interpreted as a variable name pattern, which " +"creates a new variable that will shadow the existing one. For example:" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Expected value is 5, actual is {expected}\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "\"Value was something else\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "" +"Here we're trying to match on the number 123, where we want the first case " +"to check if the value is 5. The naive expectation is that the first case " +"won't match because the value isn't 5, but instead this is interpreted as a " +"variable pattern which always matches, meaning the first branch will always " +"be taken. If a constant is used instead this will then work as expected." +msgstr "" + +#: src/pattern-matching/match.md +msgid "" +"Another piece of pattern syntax you can show students is the `@` syntax " +"which binds a part of a pattern to a variable. For example:" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/match.md +msgid "\"outer: {outer:?}, inner: {inner}\"" +msgstr "" + +#: src/pattern-matching/match.md +msgid "" +"In this example `inner` has the value 123 which it pulled from the `Option` " +"via destructuring, `outer` captures the entire `Some(inner)` expression, so " +"it contains the full `Option::Some(123)`. This is rarely used but can be " +"useful in more complex patterns." +msgstr "" + +#: src/pattern-matching/destructuring-structs.md msgid "Structs" msgstr "Yapılar (Structs)" -#: src/pattern-matching/destructuring.md -msgid "\"x.0 = 1, b = {b}, y = {y}\"" +#: src/pattern-matching/destructuring-structs.md +msgid "Like tuples, Struct can also be destructured by matching:" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md +msgid "\"x.0 = 1, b = {b}, y = {y}\"" +msgstr "" + +#: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-structs.md +msgid "Change the literal values in `foo` to match with the other patterns." +msgstr "" + +#: src/pattern-matching/destructuring-structs.md +msgid "Add a new field to `Foo` and make changes to the pattern as needed." +msgstr "" + +#: src/pattern-matching/destructuring-structs.md +msgid "" +"Try `match &foo` and check the type of captures. The pattern syntax remains " +"the same, but the captures become shared references. This is [match " +"ergonomics](https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) and " +"is often useful with `match self` when implementing methods on an enum." +msgstr "" + +#: src/pattern-matching/destructuring-structs.md +msgid "" +"The same effect occurs with `match &mut foo`: the captures become exclusive " +"references." +msgstr "" + +#: src/pattern-matching/destructuring-structs.md +msgid "" +"The distinction between a capture and a constant expression can be hard to " +"spot. Try changing the `2` in the second arm to a variable, and see that it " +"subtly doesn't work. Change it to a `const` and see it working again." +msgstr "" + +#: src/pattern-matching/destructuring-enums.md +msgid "Like tuples, enums can also be destructured by matching:" +msgstr "" + +#: src/pattern-matching/destructuring-enums.md msgid "" "Patterns can also be used to bind variables to parts of your values. This is " "how you inspect the structure of your types. Let us start with a simple " "`enum` type:" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "\"{n} divided in two is {half}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "\"sorry, an error happened: {msg}\"" msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "Here we have used the arms to _destructure_ the `Result` value. In the first " "arm, `half` is bound to the value inside the `Ok` variant. In the second " "arm, `msg` is bound to the error message." msgstr "" -#: src/pattern-matching/destructuring.md -msgid "Change the literal values in `foo` to match with the other patterns." -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "Add a new field to `Foo` and make changes to the pattern as needed." -msgstr "" - -#: src/pattern-matching/destructuring.md -msgid "" -"The distinction between a capture and a constant expression can be hard to " -"spot. Try changing the `2` in the second arm to a variable, and see that it " -"subtly doesn't work. Change it to a `const` and see it working again." -msgstr "" - -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "You can try adding a third variant to the enum definition and displaying the " "errors when running the code. Point out the places where your code is now " "inexhaustive and how the compiler tries to give you hints." msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "The values in the enum variants can only be accessed after being pattern " "matched." msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" "Demonstrate what happens when the search is inexhaustive. Note the advantage " "the Rust compiler provides by confirming when all cases are handled." msgstr "" -#: src/pattern-matching/destructuring.md +#: src/pattern-matching/destructuring-enums.md msgid "" -"Save the result of `divide_in_two` in the `result` variable and `match` it " -"in a loop. That won't compile because `msg` is consumed when matched. To fix " -"it, match `&result` instead of `result`. That will make `msg` a reference so " -"it won't be consumed. This [\"match ergonomics\"](https://rust-lang.github." -"io/rfcs/2005-match-ergonomics.html) appeared in Rust 2018. If you want to " -"support older Rust, replace `msg` with `ref msg` in the pattern." +"Demonstrate the syntax for a struct-style variant by adding one to the enum " +"definition and the `match`. Point out how this is syntactically similar to " +"matching on a struct." msgstr "" #: src/pattern-matching/let-control-flow.md @@ -5213,62 +5892,55 @@ msgid "`while let` expressions" msgstr "`while let` ifadeleri" #: src/pattern-matching/let-control-flow.md -msgid "`match` expressions" -msgstr "`match` ifadeleri" +msgid "`let else` expressions" +msgstr "`let else` ifadeleri" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/if-let.md msgid "" "The [`if let` expression](https://doc.rust-lang.org/reference/expressions/if-" "expr.html#if-let-expressions) lets you execute different code depending on " "whether a value matches a pattern:" msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "\"slept for {:?}\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "\"slept for {duration:?}\"" msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "`let else` expressions" -msgstr "`let else` ifadeleri" - -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/if-let.md msgid "" -"For the common case of matching a pattern and returning from the function, " -"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" -"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " -"- anything but falling off the end of the block)." -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "\"got None\"" -msgstr "" - -#: src/pattern-matching/let-control-flow.md -msgid "\"got empty string\"" +"Unlike `match`, `if let` does not have to cover all branches. This can make " +"it more concise than `match`." msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "\"not a hex digit\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" -#: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md -msgid "\"result: {:?}\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "" +"Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" -#: src/pattern-matching/let-control-flow.md src/generics/trait-bounds.md -#: src/smart-pointers/solution.md src/testing/solution.md -#: src/android/testing.md src/android/testing/googletest.md -msgid "\"foo\"" +#: src/pattern-matching/let-control-flow/if-let.md +msgid "With an `else` clause, this can be used as an expression." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "Like with `if let`, there is a [`while let`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#predicate-pattern-loops) variant which " "repeatedly tests a value against a pattern:" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md +msgid "\"Comprehensive Rust 🦀\"" +msgstr "\"Comprehensive Rust 🦀\"" + +#: src/pattern-matching/let-control-flow/while-let.md +msgid "// (There are more efficient ways to reverse a string!)\n" +msgstr "" + +#: src/pattern-matching/let-control-flow/while-let.md msgid "" "Here [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) returns `Some(c)` until the string is empty, after " @@ -5276,131 +5948,126 @@ msgid "" "all items." msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "if-let" +#: src/pattern-matching/let-control-flow/while-let.md +msgid "" +"Point out that the `while let` loop will keep going as long as the value " +"matches the pattern." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/while-let.md msgid "" -"Unlike `match`, `if let` does not have to cover all branches. This can make " -"it more concise than `match`." +"You could rewrite the `while let` loop as an infinite loop with an if " +"statement that breaks when there is no value to unwrap for `name.pop()`. The " +"`while let` provides syntactic sugar for the above scenario." msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "A common usage is handling `Some` values when working with `Option`." +#: src/pattern-matching/let-control-flow/while-let.md +msgid "" +"This form cannot be used as an expression, because it may have no value if " +"the condition is false." msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/let-else.md +msgid "`let else` Statements" +msgstr "`let else` Deyimleri" + +#: src/pattern-matching/let-control-flow/let-else.md msgid "" -"Unlike `match`, `if let` does not support guard clauses for pattern matching." +"For the common case of matching a pattern and returning from the function, " +"use [`let else`](https://doc.rust-lang.org/rust-by-example/flow_control/" +"let_else.html). The \"else\" case must diverge (`return`, `break`, or panic " +"- anything but falling off the end of the block)." msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "let-else" +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"got None\"" msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "" -"`if-let`s can pile up, as shown. The `let-else` construct supports " -"flattening this nested code. Rewrite the awkward version for students, so " -"they can see the transformation." +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"got empty string\"" msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "The rewritten version is:" +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"not a hex digit\"" msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "while-let" -msgstr "while-let" +#: src/pattern-matching/let-control-flow/let-else.md +msgid "\"result: {:?}\"" +msgstr "" -#: src/pattern-matching/let-control-flow.md -msgid "" -"Point out that the `while let` loop will keep going as long as the value " -"matches the pattern." +#: src/pattern-matching/let-control-flow/let-else.md +#: src/generics/trait-bounds.md src/testing/solution.md src/android/testing.md +#: src/android/testing/googletest.md +msgid "\"foo\"" msgstr "" -#: src/pattern-matching/let-control-flow.md +#: src/pattern-matching/let-control-flow/let-else.md msgid "" -"You could rewrite the `while let` loop as an infinite loop with an if " -"statement that breaks when there is no value to unwrap for `name.pop()`. The " -"`while let` provides syntactic sugar for the above scenario." +"This early return-based control flow is common in Rust error handling code, " +"where you try to get a value out of a `Result`, returning an error if the " +"`Result` was `Err`." msgstr "" -#: src/pattern-matching/exercise.md -msgid "Let's write a simple recursive evaluator for arithmetic expressions." +#: src/pattern-matching/let-control-flow/let-else.md +msgid "" +"If students ask, you can also demonstrate how real error handling code would " +"be written with `?`." msgstr "" #: src/pattern-matching/exercise.md -msgid "" -"The `Box` type here is a smart pointer, and will be covered in detail later " -"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " -"tests. To evaluate a boxed expression, use the deref operator (`*`) to " -"\"unbox\" it: `eval(*boxed_expr)`." +msgid "Let's write a simple recursive evaluator for arithmetic expressions." msgstr "" #: src/pattern-matching/exercise.md msgid "" -"Some expressions cannot be evaluated and will return an error. The standard " -"[`Result`](https://doc.rust-lang.org/std/result/enum.Result." -"html) type is an enum that represents either a successful value " -"(`Ok(Value)`) or an error (`Err(String)`). We will cover this type in detail " -"later." +"An example of a small arithmetic expression could be `10 + 20`, which " +"evaluates to `30`. We can represent the expression as a tree:" msgstr "" #: src/pattern-matching/exercise.md msgid "" -"Copy and paste the code into the Rust playground, and begin implementing " -"`eval`. The final product should pass the tests. It may be helpful to use " -"`todo!()` and get the tests to pass one-by-one. You can also skip a test " -"temporarily with `#[ignore]`:" +"A bigger and more complex expression would be `(10 * 9) + ((3 - 4) * 5)`, " +"which evaluate to `85`. We represent this as a much bigger tree:" msgstr "" #: src/pattern-matching/exercise.md -msgid "" -"If you finish early, try writing a test that results in division by zero or " -"integer overflow. How could you handle this with `Result` instead of a panic?" +msgid "In code, we will represent the tree with two types:" msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An operation to perform on two subexpressions.\n" msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An expression, in tree form.\n" msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An operation on two subexpressions.\n" msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md +#: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A literal value\n" msgstr "" -#: src/pattern-matching/exercise.md src/pattern-matching/solution.md -msgid "\"division by zero\"" -msgstr "" - -#: src/pattern-matching/solution.md -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) (15 minutes)" -msgstr "[Özellikler](../methods-and-traits/traits.md) (15 dakika)" - -#: src/methods-and-traits.md -msgid "[Deriving](./methods-and-traits/deriving.md) (3 minutes)" +#: src/pattern-matching/exercise.md +msgid "" +"The `Box` type here is a smart pointer, and will be covered in detail later " +"in the course. An expression can be \"boxed\" with `Box::new` as seen in the " +"tests. To evaluate a boxed expression, use the deref operator (`*`) to " +"\"unbox\" it: `eval(*boxed_expr)`." msgstr "" -#: src/methods-and-traits.md +#: src/pattern-matching/exercise.md msgid "" -"[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" +"Copy and paste the code into the Rust playground, and begin implementing " +"`eval`. The final product should pass the tests. It may be helpful to use " +"`todo!()` and get the tests to pass one-by-one. You can also skip a test " +"temporarily with `#[ignore]`:" msgstr "" #: src/methods-and-traits/methods.md @@ -5430,7 +6097,7 @@ msgid "\"Lap {idx}: {lap} sec\"" msgstr "" #: src/methods-and-traits/methods.md -msgid "// Exclusive ownership of self\n" +msgid "// Exclusive ownership of self (covered later)\n" msgstr "" #: src/methods-and-traits/methods.md @@ -5498,6 +6165,12 @@ msgid "" "all the implementation code in one predictable place." msgstr "" +#: src/methods-and-traits/methods.md +msgid "" +"Note that methods can also be called like associated functions by explicitly " +"passing the receiver in, e.g. `CarRace::add_lap(&mut race, 20)`." +msgstr "" + #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" @@ -5562,12 +6235,12 @@ msgstr "" msgid "\"Oh you're a cutie! What's your name? {}\"" msgstr "" -#: src/methods-and-traits/traits/implementing.md +#: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Woof, my name is {}!\"" msgstr "" -#: src/methods-and-traits/traits/implementing.md +#: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Fido\"" msgstr "" @@ -5592,6 +6265,14 @@ msgid "" "`greet` is provided, and relies on `talk`." msgstr "" +#: src/methods-and-traits/traits/implementing.md +msgid "" +"Multiple `impl` blocks are allowed for a given type. This includes both " +"inherent `impl` blocks and trait `impl` blocks. Likewise multiple traits can " +"be implemented for a given type (and often types implement many traits!). " +"`impl` blocks can even be spread across multiple modules/files." +msgstr "" + #: src/methods-and-traits/traits/supertraits.md msgid "" "A trait can require that types implementing it also implement other traits, " @@ -5600,7 +6281,6 @@ msgid "" msgstr "" #: src/methods-and-traits/traits/supertraits.md -#: src/async/control-flow/select.md msgid "\"Rex\"" msgstr "" @@ -5622,7 +6302,7 @@ msgid "" msgstr "" #: src/methods-and-traits/traits/associated-types.md -#: src/async/control-flow/join.md +#: src/lifetimes/lifetime-elision.md msgid "\"{:?}\"" msgstr "\"{:?}\"" @@ -5661,7 +6341,7 @@ msgid "// Debug trait adds support for printing with `{:?}`.\n" msgstr "" #: src/methods-and-traits/deriving.md -msgid "\"{:?} vs. {:?}\"" +msgid "\"{p1:?} vs. {p2:?}\"" msgstr "" #: src/methods-and-traits/deriving.md @@ -5671,6 +6351,20 @@ msgid "" "serialization support for a struct using `#[derive(Serialize)]`." msgstr "" +#: src/methods-and-traits/deriving.md +msgid "" +"Derivation is usually provided for traits that have a common boilerplate-y " +"implementation that is correct for most cases. For example, demonstrate how " +"a manual `Clone` impl can be repetitive compared to deriving the trait:" +msgstr "" + +#: src/methods-and-traits/deriving.md +msgid "" +"Not all of the `.clone()`s in the above are necessary in this case, but this " +"demonstrates the generally boilerplate-y pattern that manual impls would " +"follow, which should help make the use of `derive` clear to students." +msgstr "" + #: src/methods-and-traits/exercise.md msgid "Exercise: Logger Trait" msgstr "Alıştırma: Kaydedici Özellik" @@ -5693,53 +6387,54 @@ msgstr "" #: src/methods-and-traits/exercise.md msgid "" "This is a common pattern: a struct wrapping a trait implementation and " -"implementing that same trait, adding behavior in the process. What other " -"kinds of wrappers might be useful in a logging utility?" +"implementing that same trait, adding behavior in the process. In the " +"\"Generics\" segment this afternoon, we will see how to make the wrapper " +"generic over the wrapped type." msgstr "" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md msgid "/// Log a message at the given verbosity level.\n" msgstr "" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md msgid "\"verbosity={verbosity}: {message}\"" msgstr "" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md -msgid "\"FYI\"" -msgstr "" - -#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md -msgid "\"Uhoh\"" +#: src/generics/generic-data.md +msgid "/// Only log messages up to the given verbosity level.\n" msgstr "" #: src/methods-and-traits/exercise.md -msgid "// TODO: Define and implement `VerbosityFilter`.\n" -msgstr "" - -#: src/methods-and-traits/solution.md -msgid "/// Only log messages up to the given verbosity level.\n" +msgid "// TODO: Implement the `Logger` trait for `VerbosityFilter`.\n" msgstr "" -#: src/generics.md -msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" +#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md src/closures/exercise.md +#: src/closures/solution.md +msgid "\"FYI\"" msgstr "" -#: src/generics.md -msgid "[Generic Data Types](./generics/generic-data.md) (10 minutes)" +#: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md +#: src/generics/generic-data.md +msgid "\"Uhoh\"" msgstr "" #: src/generics.md -msgid "[Trait Bounds](./generics/trait-bounds.md) (10 minutes)" -msgstr "" +msgid "impl Trait" +msgstr "impl Trait" #: src/generics.md -msgid "[impl Trait](./generics/impl-trait.md) (5 minutes)" -msgstr "" +msgid "dyn Trait" +msgstr "dyn Trait" #: src/generics.md -msgid "[Exercise: Generic min](./generics/exercise.md) (10 minutes)" -msgstr "" +msgid "Exercise: Generic min" +msgstr "Alıştırma: Jenerik min" #: src/generics/generic-functions.md msgid "" @@ -5748,23 +6443,27 @@ msgid "" msgstr "" #: src/generics/generic-functions.md -msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" +msgid "\"picked a number: {:?}\"" msgstr "" #: src/generics/generic-functions.md -msgid "\"picked a number: {:?}\"" +msgid "\"picked a string: {:?}\"" msgstr "" #: src/generics/generic-functions.md -msgid "\"picked a tuple: {:?}\"" +msgid "'L'" msgstr "" #: src/generics/generic-functions.md -msgid "\"dog\"" +msgid "'R'" msgstr "" #: src/generics/generic-functions.md -msgid "\"cat\"" +msgid "" +"It can be helpful to show the monomorphized versions of `pick`, either " +"before talking about the generic `pick` in order to show how generics can " +"reduce code duplication, or after talking about generics to show how " +"monomorphization works." msgstr "" #: src/generics/generic-functions.md @@ -5773,13 +6472,19 @@ msgid "" "value." msgstr "" +#: src/generics/generic-functions.md +msgid "" +"In this example we only use the primitive types `i32` and `char` for `T`, " +"but we can use any type here, including user-defined types:" +msgstr "" + #: src/generics/generic-functions.md msgid "" "This is similar to C++ templates, but Rust partially compiles the generic " "function immediately, so that function must be valid for all types matching " -"the constraints. For example, try modifying `pick` to return `even + odd` if " -"`n == 0`. Even if only the `pick` instantiation with integers is used, Rust " -"still considers it invalid. C++ would let you do this." +"the constraints. For example, try modifying `pick` to return `left + right` " +"if `cond` is false. Even if only the `pick` instantiation with integers is " +"used, Rust still considers it invalid. C++ would let you do this." msgstr "" #: src/generics/generic-functions.md @@ -5789,26 +6494,62 @@ msgid "" "hand-coded the data structures without the abstraction." msgstr "" -#: src/generics/generic-data.md -msgid "You can use generics to abstract over the concrete field type:" +#: src/generics/trait-bounds.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." msgstr "" -#: src/generics/generic-data.md -msgid "// fn set_x(&mut self, x: T)\n" +#: src/generics/trait-bounds.md +msgid "You can do this with `T: Trait`:" msgstr "" -#: src/generics/generic-data.md -msgid "\"{integer:?} and {float:?}\"" +#: src/generics/trait-bounds.md +msgid "\"{pair:?}\"" +msgstr "" + +#: src/generics/trait-bounds.md +msgid "Try making a `NotCloneable` and passing it to `duplicate`." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "When multiple traits are necessary, use `+` to join them." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "Show a `where` clause, students will encounter it when reading code." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "It declutters the function signature if you have many parameters." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "It has additional features making it more powerful." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "" +"If someone asks, the extra feature is that the type on the left of \":\" can " +"be arbitrary, like `Option`." +msgstr "" + +#: src/generics/trait-bounds.md +msgid "" +"Note that Rust does not (yet) support specialization. For example, given the " +"original `duplicate`, it is invalid to add a specialized `duplicate(a: u32)`." msgstr "" #: src/generics/generic-data.md -msgid "\"coords: {:?}\"" +msgid "" +"You can use generics to abstract over the concrete field type. Returning to " +"the exercise for the previous segment:" msgstr "" #: src/generics/generic-data.md msgid "" -"_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " -"redundant?" +"_Q:_ Why `L` is specified twice in `impl .. VerbosityFilter`? " +"Isn't that redundant?" msgstr "" #: src/generics/generic-data.md @@ -5818,30 +6559,33 @@ msgid "" msgstr "" #: src/generics/generic-data.md -msgid "It means these methods are defined for any `T`." +msgid "It means these methods are defined for any `L`." msgstr "" #: src/generics/generic-data.md -msgid "It is possible to write `impl Point { .. }`." +msgid "It is possible to write `impl VerbosityFilter { .. }`." msgstr "" #: src/generics/generic-data.md msgid "" -"`Point` is still generic and you can use `Point`, but methods in this " -"block will only be available for `Point`." +"`VerbosityFilter` is still generic and you can use `VerbosityFilter`, " +"but methods in this block will only be available for " +"`VerbosityFilter`." msgstr "" #: src/generics/generic-data.md msgid "" -"Try declaring a new variable `let p = Point { x: 5, y: 10.0 };`. Update the " -"code to allow points that have elements of different types, by using two " -"type variables, e.g., `T` and `U`." +"Note that we don't put a trait bound on the `VerbosityFilter` type itself. " +"You can put bounds there as well, but generally in Rust we only put the " +"trait bounds on the impl blocks." msgstr "" #: src/generics/generic-traits.md msgid "" "Traits can also be generic, just like types and functions. A trait's " -"parameters get concrete types when it is used." +"parameters get concrete types when it is used. For example the [`From`]" +"(https://doc.rust-lang.org/std/convert/trait.From.html) trait is used to " +"define type conversions:" msgstr "" #: src/generics/generic-traits.md @@ -5852,21 +6596,17 @@ msgstr "" 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." +"simple, and copied here for reference." 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 " +"parameters. Here, `Foo::from(\"hello\")` would not compile because there is " "no `From<&str>` implementation for `Foo`." msgstr "" @@ -5886,56 +6626,6 @@ msgid "" "html)." msgstr "" -#: src/generics/trait-bounds.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." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "You can do this with `T: Trait` or `impl Trait`:" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "// struct NotClonable;\n" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "\"{pair:?}\"" -msgstr "" - -#: src/generics/trait-bounds.md -msgid "Try making a `NonClonable` and passing it to `duplicate`." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "When multiple traits are necessary, use `+` to join them." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "Show a `where` clause, students will encounter it when reading code." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "It declutters the function signature if you have many parameters." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "It has additional features making it more powerful." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "" -"If someone asks, the extra feature is that the type on the left of \":\" can " -"be arbitrary, like `Option`." -msgstr "" - -#: src/generics/trait-bounds.md -msgid "" -"Note that Rust does not (yet) support specialization. For example, given the " -"original `duplicate`, it is invalid to add a specialized `duplicate(a: u32)`." -msgstr "" - #: src/generics/impl-trait.md msgid "" "Similar to trait bounds, an `impl Trait` syntax can be used in function " @@ -5948,18 +6638,6 @@ msgid "" "// fn add_42_millions>(x: T) -> i32 {\n" msgstr "" -#: src/generics/impl-trait.md -msgid "\"{many}\"" -msgstr "" - -#: src/generics/impl-trait.md -msgid "\"{many_more}\"" -msgstr "" - -#: src/generics/impl-trait.md -msgid "\"debuggable: {debuggable:?}\"" -msgstr "" - #: src/generics/impl-trait.md msgid "" "`impl Trait` allows you to work with types which you cannot name. The " @@ -5995,6 +6673,71 @@ msgid "" "the error message shows." msgstr "" +#: src/generics/dyn-trait.md +msgid "" +"In addition to using traits for static dispatch via generics, Rust also " +"supports using them for type-erased, dynamic dispatch via trait objects:" +msgstr "" + +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md +msgid "\"Miau!\"" +msgstr "" + +#: src/generics/dyn-trait.md +msgid "// Uses generics and static dispatch.\n" +msgstr "" + +#: src/generics/dyn-trait.md src/smart-pointers/trait-objects.md +msgid "\"Hello, who are you? {}\"" +msgstr "\"Merhaba, nasılsın? {}\"" + +#: src/generics/dyn-trait.md +msgid "// Uses type-erasure and dynamic dispatch.\n" +msgstr "" + +#: src/generics/dyn-trait.md +msgid "" +"Generics, including `impl Trait`, use monomorphization to create a " +"specialized instance of the function for each different type that the " +"generic is instantiated with. This means that calling a trait method from " +"within a generic function still uses static dispatch, as the compiler has " +"full type information and can resolve which type's trait implementation to " +"use." +msgstr "" + +#: src/generics/dyn-trait.md +msgid "" +"When using `dyn Trait`, it instead uses dynamic dispatch through a [virtual " +"method table](https://en.wikipedia.org/wiki/Virtual_method_table) (vtable). " +"This means that there's a single version of `fn dynamic` that is used " +"regardless of what type of `Pet` is passed in." +msgstr "" + +#: src/generics/dyn-trait.md +msgid "" +"When using `dyn Trait`, the trait object needs to be behind some kind of " +"indirection. In this case it's a reference, though smart pointer types like " +"`Box` can also be used (this will be demonstrated on day 3)." +msgstr "" + +#: src/generics/dyn-trait.md +msgid "" +"At runtime, a `&dyn Pet` is represented as a \"fat pointer\", i.e. a pair of " +"two pointers: One pointer points to the concrete object that implements " +"`Pet`, and the other points to the vtable for the trait implementation for " +"that type. When calling the `talk` method on `&dyn Pet` the compiler looks " +"up the function pointer for `talk` in the vtable and then invokes the " +"function, passing the pointer to the `Dog` or `Cat` into that function. The " +"compiler doesn't need to know the concrete type of the `Pet` in order to do " +"this." +msgstr "" + +#: src/generics/dyn-trait.md +msgid "" +"A `dyn Trait` is considered to be \"type-erased\", because we no longer have " +"compile-time knowledge of what the concrete type is." +msgstr "" + #: src/generics/exercise.md msgid "" "In this short exercise, you will implement a generic `min` function that " @@ -6003,11 +6746,10 @@ msgid "" msgstr "" #: src/generics/exercise.md -msgid "// TODO: implement the `min` function used in `main`.\n" +msgid "// TODO: implement the `min` function used in the tests.\n" msgstr "" #: src/generics/exercise.md src/generics/solution.md -#: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "" @@ -6019,6 +6761,11 @@ msgstr "" msgid "'1'" msgstr "" +#: src/generics/exercise.md src/generics/solution.md +#: src/std-traits/from-and-into.md +msgid "\"hello\"" +msgstr "\"merhaba\"" + #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" msgstr "" @@ -6032,61 +6779,39 @@ msgid "\"armadillo\"" msgstr "" #: src/generics/exercise.md -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 "" - -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Types](./std-types.md) (1 hour and 20 minutes)" -msgstr "" - -#: src/welcome-day-2-afternoon.md -msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" -msgstr "" - -#: src/welcome-day-2-afternoon.md -msgid "" -"Including 10 minute breaks, this session should take about 3 hours and 10 " -"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)" +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 "" -#: src/std-types.md -msgid "[Result](./std-types/result.md) (10 minutes)" +#: src/welcome-day-2-afternoon.md src/welcome-day-4.md +msgid "" +"Including 10 minute breaks, this session should take about 2 hours and 50 " +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 50 dakika sürmelidir. " +"İçeriği:" -#: src/std-types.md -msgid "[String](./std-types/string.md) (10 minutes)" +#: src/std-types.md src/std-types/option.md +msgid "Option" msgstr "" -#: src/std-types.md -msgid "[Vec](./std-types/vec.md) (10 minutes)" +#: src/std-types.md src/std-types/result.md src/error-handling.md +msgid "Result" msgstr "" -#: src/std-types.md -msgid "[HashMap](./std-types/hashmap.md) (10 minutes)" -msgstr "" +#: src/std-types.md src/std-types/string.md +msgid "String" +msgstr "String" #: src/std-types.md -msgid "[Exercise: Counter](./std-types/exercise.md) (20 minutes)" -msgstr "" +msgid "Vec" +msgstr "Vec" #: src/std-types.md -msgid "This segment should take about 1 hour and 20 minutes" -msgstr "" +msgid "HashMap" +msgstr "HashMap" #: src/std-types.md msgid "" @@ -6147,6 +6872,10 @@ msgid "" "std/collections/struct.BinaryHeap.html)." msgstr "" +#: src/std-types/docs.md +msgid "Use `rustup doc --std` or to view the documentation." +msgstr "" + #: src/std-types/docs.md msgid "In fact, you can document your own code:" msgstr "" @@ -6185,10 +6914,6 @@ msgid "" "rand>." msgstr "" -#: src/std-types/option.md -msgid "Option" -msgstr "" - #: src/std-types/option.md msgid "" "We have already seen some use of `Option`. It stores either a value of " @@ -6204,10 +6929,6 @@ msgstr "" msgid "'é'" msgstr "" -#: src/std-types/option.md -msgid "\"find returned {position:?}\"" -msgstr "" - #: src/std-types/option.md msgid "'Z'" msgstr "" @@ -6240,35 +6961,33 @@ msgstr "" #: src/std-types/option.md msgid "" -"The niche optimization means that `Option` often has the same size in " -"memory as `T`." -msgstr "" - -#: src/std-types/result.md -msgid "Result" +"The \"niche optimization\" means that `Option` often has the same size in " +"memory as `T`, if there is some representation that is not a valid value of " +"T. For example, a reference cannot be NULL, so `Option<&T>` automatically " +"uses NULL to represent the `None` variant, and thus can be stored in the " +"same memory as `&T`." msgstr "" #: src/std-types/result.md msgid "" "`Result` is similar to `Option`, but indicates the success or failure of an " -"operation, each with a different type. This is similar to the `Res` defined " -"in the expression exercise, but generic: `Result` where `T` is used in " -"the `Ok` variant and `E` appears in the `Err` variant." +"operation, each with a different enum variant. It is generic: `Result` " +"where `T` is used in the `Ok` variant and `E` appears in the `Err` variant." msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"diary.txt\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"Dear diary: {contents} ({bytes} bytes)\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"Could not read file content\"" msgstr "" -#: src/std-types/result.md +#: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" msgstr "" @@ -6293,19 +7012,15 @@ msgid "" "Day 4." msgstr "" -#: src/std-types/string.md -msgid "String" -msgstr "String" - #: src/std-types/string.md msgid "" -"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is the " -"standard heap-allocated growable UTF-8 string buffer:" +"[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is a " +"growable UTF-8 encoded string:" msgstr "" -#: src/std-types/string.md src/std-traits/read-and-write.md -#: src/memory-management/review.md src/testing/unit-tests.md -#: src/concurrency/scoped-threads.md +#: src/std-types/string.md src/std-traits/comparisons.md +#: src/std-traits/read-and-write.md src/memory-management/review.md +#: src/testing/unit-tests.md src/concurrency/threads/scoped.md msgid "\"Hello\"" msgstr "\"Merhaba\"" @@ -6526,10 +7241,6 @@ msgstr "" msgid "// Use the .entry() method to insert a value if nothing is found.\n" msgstr "" -#: src/std-types/hashmap.md -msgid "\"{page_counts:#?}\"" -msgstr "" - #: src/std-types/hashmap.md msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." @@ -6568,19 +7279,6 @@ msgid "" "value tuples." msgstr "" -#: src/std-types/hashmap.md -msgid "" -"We are showing `HashMap`, and avoid using `&str` as key to make " -"examples easier. Using references in collections can, of course, be done, " -"but it can lead into complications with the borrow checker." -msgstr "" - -#: src/std-types/hashmap.md -msgid "" -"Try removing `to_string()` from the example above and see if it still " -"compiles. Where do you think we might run into issues?" -msgstr "" - #: src/std-types/hashmap.md msgid "" "This type has several \"method-specific\" return types, such as `std::" @@ -6644,42 +7342,260 @@ msgstr "" msgid "\"got {} apples\"" msgstr "" -#: src/std-traits.md -msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" +#: src/closures.md src/concurrency/threads.md src/concurrency/shared-state.md +msgid "This segment should take about 30 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 30 dakika sürmelidir. İçeriği:" + +#: src/closures/syntax.md +msgid "Closures are created with vertical bars: `|..| ..`." msgstr "" -#: src/std-traits.md -msgid "[Operators](./std-traits/operators.md) (10 minutes)" +#: src/closures/syntax.md +msgid "// Argument and return type can be inferred for lightweight syntax:\n" msgstr "" -#: src/std-traits.md -msgid "[From and Into](./std-traits/from-and-into.md) (10 minutes)" +#: src/closures/syntax.md +msgid "// Or we can specify types and bracket the body to be fully explicit:\n" msgstr "" -#: src/std-traits.md -msgid "[Casting](./std-traits/casting.md) (5 minutes)" +#: src/closures/syntax.md +msgid "" +"The arguments go between the `|..|`. The body can be surrounded by `{ .. }`, " +"but if it is a single expression these can be omitted." msgstr "" -#: src/std-traits.md -msgid "[Read and Write](./std-traits/read-and-write.md) (10 minutes)" +#: src/closures/syntax.md +msgid "" +"Argument types are optional, and are inferred if not given. The return type " +"is also optional, but can only be written if using `{ .. }` around the body." msgstr "" -#: src/std-traits.md -msgid "[Default, struct update syntax](./std-traits/default.md) (5 minutes)" +#: src/closures/syntax.md +msgid "" +"The examples can both be written as mere nested functions instead -- they do " +"not capture any variables from their lexical environment. We will see " +"captures next." msgstr "" -#: src/std-traits.md -msgid "[Closures](./std-traits/closures.md) (20 minutes)" +#: src/closures/syntax.md +msgid "" +"The ability to store functions in variables doesn't just apply to closures, " +"regular functions can be put in variables and then invoked the same way that " +"closures can: [Example in the playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=817cbeeefc49f3d0d180a3d6d54c8bda)." msgstr "" -#: src/std-traits.md -msgid "[Exercise: ROT13](./std-traits/exercise.md) (30 minutes)" +#: src/closures/syntax.md +msgid "" +"The linked example also demonstrates that closures that don't capture " +"anything can also coerce to a regular function pointer." msgstr "" -#: src/std-traits.md -msgid "This segment should take about 1 hour and 40 minutes" +#: src/closures/capturing.md +msgid "" +"A closure can capture variables from the environment where it was defined." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"By default, a closure captures values by reference. Here `max_value` is " +"captured by `clamp`, but still available to `main` for printing. Try making " +"`max_value` mutable, changing it, and printing the clamped values again. Why " +"doesn't this work?" +msgstr "" + +#: src/closures/capturing.md +msgid "" +"If a closure mutates values, it will capture them by mutable reference. Try " +"adding `max_value += 1` to `clamp`." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"You can force a closure to move values instead of referencing them with the " +"`move` keyword. This can help with lifetimes, for example if the closure " +"must outlive the captured values (more on lifetimes later)." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"This looks like `move |v| ..`. Try adding this keyword and see if `main` can " +"still access `max_value` after defining `clamp`." +msgstr "" + +#: src/closures/capturing.md +msgid "" +"By default, closures will capture each variable from an outer scope by the " +"least demanding form of access they can (by shared reference if possible, " +"then exclusive reference, then by move). The `move` keyword forces capture " +"by value." +msgstr "" + +#: src/closures/traits.md +msgid "Closure traits" +msgstr "Çevreleyici özellikler (Closures traits)" + +#: src/closures/traits.md +msgid "" +"Closures or lambda expressions have types which cannot be named. However, " +"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." +"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " +"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" +msgstr "" + +#: src/closures/traits.md +msgid "" +"The special types `fn(..) -> T` refer to function pointers - either the " +"address of a function, or a closure that captures nothing." +msgstr "" + +#: src/closures/traits.md +msgid "\"Calling {func_name}({input}): {}\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"-itis\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"{x}{suffix}\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"add_suffix\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"senior\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"appenix\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"/\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"accumulate\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"red\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"green\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"blue\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"take_and_reverse\"" +msgstr "" + +#: src/closures/traits.md +msgid "\"reversed: \"" +msgstr "" + +#: src/closures/traits.md +msgid "" +"An `Fn` (e.g. `add_suffix`) neither consumes nor mutates captured values. It " +"can be called needing only a shared reference to the closure, which means " +"the closure can be executed repeatedly and even concurrently." +msgstr "" + +#: src/closures/traits.md +msgid "" +"An `FnMut` (e.g. `accumulate`) might mutate captured values. The closure " +"object is accessed via exclusive reference, so it can be called repeatedly " +"but not concurrently." +msgstr "" + +#: src/closures/traits.md +msgid "" +"If you have an `FnOnce` (e.g. `take_and_reverse`), you may only call it " +"once. Doing so consumes the closure and any values captured by move." +msgstr "" + +#: src/closures/traits.md +msgid "" +"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " +"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " +"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +msgstr "" + +#: src/closures/traits.md +msgid "" +"When you define a function that takes a closure, you should take `FnOnce` if " +"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " +"the most flexibility for the caller." +msgstr "" + +#: src/closures/traits.md +msgid "" +"In contrast, when you have a closure, the most flexible you can have is `Fn` " +"(which can be passed to a consumer of any of the 3 closure traits), then " +"`FnMut`, and lastly `FnOnce`." +msgstr "" + +#: src/closures/traits.md +msgid "" +"The compiler also infers `Copy` (e.g. for `add_suffix`) and `Clone` (e.g. " +"`take_and_reverse`), depending on what the closure captures. Function " +"pointers (references to `fn` items) implement `Copy` and `Fn`." +msgstr "" + +#: src/closures/exercise.md +msgid "" +"Building on the generic logger from this morning, implement a `Filter` which " +"uses a closure to filter log messages, sending those which pass the " +"filtering predicate to an inner logger." +msgstr "" + +#: src/closures/exercise.md +msgid "// TODO: Define and implement `Filter`.\n" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes\"" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"yikes, something went wrong\"" +msgstr "" + +#: src/closures/exercise.md src/closures/solution.md +msgid "\"uhoh\"" +msgstr "" + +#: src/closures/solution.md +msgid "/// Only log messages matching a filtering predicate.\n" msgstr "" +#: src/closures/solution.md +msgid "" +"Note that the `P: Fn(u8, &str) -> bool` bound on the first `Filter` impl " +"block isn't strictly necessary, but it helps with type inference when " +"calling `new`. Demonstrate removing it and showing how the compiler now " +"needs type annotations for the closure passed to `new`." +msgstr "" + +#: src/std-traits.md +msgid "From and Into" +msgstr "From ve Into" + +#: src/std-traits.md +msgid "Read and Write" +msgstr "Read ve Write" + +#: src/std-traits.md +msgid "Default, struct update syntax" +msgstr "Varsayılan, yapı (struct) güncelleme sözdizimi" + #: src/std-traits.md msgid "" "As with the standard-library types, spend time reviewing the documentation " @@ -6739,6 +7655,14 @@ msgid "" "them." msgstr "" +#: src/std-traits/comparisons.md +msgid "" +"When comparing references in Rust, it will compare the value of the things " +"pointed to, it will NOT compare the references themselves. That means that " +"references to two different things can compare as equal if the values " +"pointed to are the same:" +msgstr "" + #: src/std-traits/operators.md msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." @@ -6746,7 +7670,7 @@ msgid "" msgstr "" #: src/std-traits/operators.md -msgid "\"{:?} + {:?} = {:?}\"" +msgid "\"{p1:?} + {p2:?} = {:?}\"" msgstr "" #: src/std-traits/operators.md src/memory-management/drop.md @@ -6784,11 +7708,20 @@ msgid "" "i32)> for Point` would add a tuple to a `Point`." msgstr "" +#: src/std-traits/operators.md +msgid "" +"The `Not` trait (`!` operator) is notable because it does not \"boolify\" " +"like the same operator in C-family languages; instead, for integer types it " +"negates each bit of the number, which arithmetically is equivalent to " +"subtracting it from -1: `!5 == -6`." +msgstr "" + #: src/std-traits/from-and-into.md msgid "" "Types implement [`From`](https://doc.rust-lang.org/std/convert/trait.From." "html) and [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) to " -"facilitate type conversions:" +"facilitate type conversions. Unlike `as`, these traits correspond to " +"lossless, infallible conversions." msgstr "" #: src/std-traits/from-and-into.md @@ -6903,164 +7836,66 @@ msgstr "" msgid "\"\\n\"" msgstr "" -#: src/std-traits/read-and-write.md -msgid "\"Logged: {:?}\"" -msgstr "" - -#: src/std-traits/default.md -msgid "The `Default` Trait" -msgstr "" - -#: src/std-traits/default.md -msgid "" -"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) trait " -"produces a default value for a type." -msgstr "" - -#: src/std-traits/default.md -msgid "\"John Smith\"" -msgstr "" - -#: src/std-traits/default.md -msgid "\"{default_struct:#?}\"" -msgstr "" - -#: src/std-traits/default.md -msgid "\"Y is set!\"" -msgstr "" - -#: src/std-traits/default.md -msgid "\"{almost_default_struct:#?}\"" -msgstr "" - -#: src/std-traits/default.md src/lifetimes/exercise.md -#: src/lifetimes/solution.md -msgid "\"{:#?}\"" -msgstr "" - -#: src/std-traits/default.md -msgid "" -"It can be implemented directly or it can be derived via `#[derive(Default)]`." -msgstr "" - -#: src/std-traits/default.md -msgid "" -"A derived implementation will produce a value where all fields are set to " -"their default values." -msgstr "" - -#: src/std-traits/default.md -msgid "This means all types in the struct must implement `Default` too." -msgstr "" - -#: src/std-traits/default.md -msgid "" -"Standard Rust types often implement `Default` with reasonable values (e.g. " -"`0`, `\"\"`, etc)." -msgstr "" - -#: src/std-traits/default.md -msgid "The partial struct initialization works nicely with default." -msgstr "" - -#: src/std-traits/default.md -msgid "" -"The Rust standard library is aware that types can implement `Default` and " -"provides convenience methods that use it." -msgstr "" - -#: src/std-traits/default.md -msgid "" -"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" -"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" -"with-struct-update-syntax)." -msgstr "" - -#: src/std-traits/closures.md -msgid "" -"Closures or lambda expressions have types which cannot be named. However, " -"they implement special [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn." -"html), [`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html), and " -"[`FnOnce`](https://doc.rust-lang.org/std/ops/trait.FnOnce.html) traits:" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"Calling function on {input}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"add_3: {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"accumulate: {}\"" -msgstr "" - -#: src/std-traits/closures.md -msgid "\"multiply_sum: {}\"" +#: src/std-traits/read-and-write.md +msgid "\"Logged: {buffer:?}\"" msgstr "" -#: src/std-traits/closures.md -msgid "" -"An `Fn` (e.g. `add_3`) neither consumes nor mutates captured values, or " -"perhaps captures nothing at all. It can be called multiple times " -"concurrently." +#: src/std-traits/default.md +msgid "The `Default` Trait" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/default.md msgid "" -"An `FnMut` (e.g. `accumulate`) might mutate captured values. You can call it " -"multiple times, but not concurrently." +"The [`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"trait produces a default value for a type." msgstr "" +"[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) " +"özelliği (trait) bir tür için varsayılan bir değer üretir." -#: src/std-traits/closures.md -msgid "" -"If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. It " -"might consume captured values." +#: src/std-traits/default.md +msgid "\"John Smith\"" msgstr "" -#: src/std-traits/closures.md -msgid "" -"`FnMut` is a subtype of `FnOnce`. `Fn` is a subtype of `FnMut` and `FnOnce`. " -"I.e. you can use an `FnMut` wherever an `FnOnce` is called for, and you can " -"use an `Fn` wherever an `FnMut` or `FnOnce` is called for." +#: src/std-traits/default.md +msgid "\"Y is set!\"" msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/default.md msgid "" -"When you define a function that takes a closure, you should take `FnOnce` if " -"you can (i.e. you call it once), or `FnMut` else, and last `Fn`. This allows " -"the most flexibility for the caller." +"It can be implemented directly or it can be derived via `#[derive(Default)]`." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/default.md msgid "" -"In contrast, when you have a closure, the most flexible you can have is `Fn` " -"(it can be passed everywhere), then `FnMut`, and lastly `FnOnce`." +"A derived implementation will produce a value where all fields are set to " +"their default values." msgstr "" -#: src/std-traits/closures.md -msgid "" -"The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " -"`multiply_sum`), depending on what the closure captures." +#: src/std-traits/default.md +msgid "This means all types in the struct must implement `Default` too." msgstr "" -#: src/std-traits/closures.md +#: src/std-traits/default.md msgid "" -"By default, closures will capture by reference if they can. The `move` " -"keyword makes them capture by value." +"Standard Rust types often implement `Default` with reasonable values (e.g. " +"`0`, `\"\"`, etc)." msgstr "" -#: src/std-traits/closures.md src/smart-pointers/trait-objects.md -msgid "\"{} {}\"" +#: src/std-traits/default.md +msgid "The partial struct initialization works nicely with default." msgstr "" -#: src/std-traits/closures.md -msgid "\"Hi\"" +#: src/std-traits/default.md +msgid "" +"The Rust standard library is aware that types can implement `Default` and " +"provides convenience methods that use it." msgstr "" -#: src/std-traits/closures.md -msgid "\"Greg\"" +#: src/std-traits/default.md +msgid "" +"The `..` syntax is called [struct update syntax](https://doc.rust-lang.org/" +"book/ch05-01-defining-structs.html#creating-instances-from-other-instances-" +"with-struct-update-syntax)." msgstr "" #: src/std-traits/exercise.md @@ -7089,10 +7924,6 @@ msgid "" "by 13 characters?" msgstr "" -#: src/std-traits/solution.md -msgid "'A'" -msgstr "" - #: src/welcome-day-3.md msgid "Welcome to Day 3" msgstr "" @@ -7111,57 +7942,21 @@ 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)" -msgstr "" - -#: src/welcome-day-3.md -msgid "[Smart Pointers](./smart-pointers.md) (55 minutes)" -msgstr "" - -#: src/welcome-day-3.md +#: src/welcome-day-3.md src/welcome-day-4-afternoon.md msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " -"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) (5 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)" +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 20 dakika sürmelidir. " +"İçeriği:" -#: src/memory-management.md -msgid "[Drop](./memory-management/drop.md) (10 minutes)" +#: src/memory-management.md src/memory-management/clone.md +msgid "Clone" msgstr "" #: src/memory-management.md -msgid "[Exercise: Builder Type](./memory-management/exercise.md) (20 minutes)" -msgstr "" +msgid "Drop" +msgstr "Drop" #: src/memory-management/review.md msgid "Programs allocate memory in two ways:" @@ -7283,9 +8078,8 @@ msgid "" msgstr "" #: src/memory-management/approaches.md -msgid "" -"Typically implemented with reference counting, garbage collection, or RAII." -msgstr "" +msgid "Typically implemented with reference counting or garbage collection." +msgstr "Genellikle referans sayımı veya çöp toplama ile uygulanır." #: src/memory-management/approaches.md msgid "Rust offers a new mix:" @@ -7336,8 +8130,8 @@ msgid "" "of C, with alloc and free operations precisely where they are required -- " "zero cost. It also provides tools similar to C++'s smart pointers. When " "required, other options such as reference counting are available, and there " -"are even third-party crates available to support runtime garbage collection " -"(not covered in this class)." +"are even crates available to support runtime garbage collection (not covered " +"in this class)." msgstr "" #: src/memory-management/ownership.md @@ -7369,12 +8163,12 @@ msgstr "" msgid "An assignment will transfer _ownership_ between variables:" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md src/concurrency/async-control-flow/select.md msgid "\"Hello!\"" msgstr "\"Merhaba!\"" #: src/memory-management/move.md -msgid "// println!(\"s1: {s1}\");\n" +msgid "// dbg!(s1);\n" msgstr "" #: src/memory-management/move.md @@ -7427,11 +8221,12 @@ msgid "" "parameter. This transfers ownership:" msgstr "" -#: src/memory-management/move.md +#: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" msgstr "\"Merhaba {name}\"" -#: src/memory-management/move.md src/android/interoperability/java.md +#: src/memory-management/move.md src/memory-management/clone.md +#: src/android/aidl/types/parcelables.md src/android/interoperability/java.md msgid "\"Alice\"" msgstr "\"Alice\"" @@ -7550,10 +8345,6 @@ msgid "" "which is being copied or moved." msgstr "" -#: src/memory-management/clone.md -msgid "Clone" -msgstr "" - #: src/memory-management/clone.md msgid "" "Sometimes you _want_ to make a copy of a value. The `Clone` trait " @@ -7563,8 +8354,7 @@ msgstr "" #: src/memory-management/clone.md msgid "" "The idea of `Clone` is to make it easy to spot where heap allocations are " -"occurring. Look for `.clone()` and a few others like `Vec::new` or `Box::" -"new`." +"occurring. Look for `.clone()` and a few others like `vec!` or `Box::new`." msgstr "" #: src/memory-management/clone.md @@ -7573,6 +8363,18 @@ msgid "" "and return later to try to optimize those clones away." msgstr "" +#: src/memory-management/clone.md +msgid "" +"`clone` generally performs a deep copy of the value, meaning that if you e." +"g. clone an array, all of the elements of the array are cloned as well." +msgstr "" + +#: src/memory-management/clone.md +msgid "" +"The behavior for `clone` is user-defined, so it can perform custom cloning " +"logic if needed." +msgstr "" + #: src/memory-management/copy-types.md msgid "" "While move semantics are the default, certain types are copied by default:" @@ -7639,6 +8441,14 @@ msgstr "" msgid "Show that it works if you clone `p1` instead." msgstr "" +#: src/memory-management/copy-types.md +msgid "" +"Shared references are `Copy`/`Clone`, mutable references are not. This is " +"because Rust requires that mutable references be exclusive, so while it's " +"valid to make a copy of a shared reference, creating a copy of a mutable " +"reference would violate Rust's borrowing rules." +msgstr "" + #: src/memory-management/drop.md msgid "The `Drop` Trait" msgstr "" @@ -7653,8 +8463,8 @@ msgstr "" msgid "\"Dropping {}\"" msgstr "" -#: src/memory-management/drop.md src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/memory-management/drop.md src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"a\"" msgstr "" @@ -7671,11 +8481,11 @@ msgid "\"d\"" msgstr "" #: src/memory-management/drop.md -msgid "\"Exiting block B\"" +msgid "\"Exiting innermost block\"" msgstr "" #: src/memory-management/drop.md -msgid "\"Exiting block A\"" +msgid "\"Exiting next block\"" msgstr "" #: src/memory-management/drop.md @@ -7799,10 +8609,6 @@ msgstr "" msgid "\"0.13\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"base64: {base64:?}\"" -msgstr "" - #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log\"" msgstr "" @@ -7811,10 +8617,6 @@ msgstr "" msgid "\"0.4\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"log: {log:?}\"" -msgstr "" - #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" msgstr "" @@ -7827,33 +8629,17 @@ msgstr "" msgid "\"4.0\"" msgstr "" -#: src/memory-management/exercise.md src/memory-management/solution.md -msgid "\"serde: {serde:?}\"" -msgstr "" - #: src/memory-management/solution.md 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 "[Trait Objects](./smart-pointers/trait-objects.md) (10 minutes)" -msgstr "" +msgid "Box" +msgstr "Box" #: src/smart-pointers.md -msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" -msgstr "" +msgid "Rc" +msgstr "Rc" #: src/smart-pointers/box.md msgid "" @@ -7874,7 +8660,8 @@ msgstr "" #: src/smart-pointers/box.md msgid "" -"Recursive data types or data types with dynamic sizes need to use a `Box`:" +"Recursive data types or data types with dynamic sizes cannot be stored " +"inline without a pointer indirection. `Box` accomplishes that indirection:" msgstr "" #: src/smart-pointers/box.md @@ -7923,8 +8710,8 @@ msgstr "" #: src/smart-pointers/box.md msgid "" -"have a type whose size that can't be known at compile time, but the Rust " -"compiler wants to know an exact size." +"have a type whose size can't be known at compile time, but the Rust compiler " +"wants to know an exact size." msgstr "" #: src/smart-pointers/box.md @@ -7955,43 +8742,11 @@ msgid "" "storing the value directly." msgstr "" -#: src/smart-pointers/box.md -msgid "Niche Optimization" -msgstr "Niche Optimizasyonu" - #: src/smart-pointers/box.md msgid "" "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 "" - -#: src/smart-pointers/box.md -msgid "" -"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 -msgid "\"Optional box\"" -msgstr "" - -#: 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: {}\"" +"storage of some enums (the \"niche optimization\")." msgstr "" #: src/smart-pointers/rc.md @@ -8002,16 +8757,14 @@ msgid "" msgstr "" #: src/smart-pointers/rc.md -msgid "\"a: {a}\"" -msgstr "" - -#: src/smart-pointers/rc.md -msgid "\"b: {b}\"" +msgid "" +"Each `Rc` points to the same shared data structure, containing strong and " +"weak pointers and the value:" msgstr "" #: src/smart-pointers/rc.md msgid "" -"See [`Arc`](../concurrency/shared_state/arc.md) and [`Mutex`](https://doc." +"See [`Arc`](../concurrency/shared-state/arc.md) and [`Mutex`](https://doc." "rust-lang.org/std/sync/struct.Mutex.html) if you are in a multi-threaded " "context." msgstr "" @@ -8057,18 +8810,11 @@ msgstr "" #: src/smart-pointers/trait-objects.md msgid "" -"Trait objects allow for values of different types, for instance in a " -"collection:" -msgstr "" - -#: src/smart-pointers/trait-objects.md -msgid "\"Miau!\"" +"We previously saw how trait objects can be used with references, e.g `&dyn " +"Pet`. However, we can also use trait objects with smart pointers like `Box` " +"to create an owned trait object: `Box`." msgstr "" -#: src/smart-pointers/trait-objects.md -msgid "\"Hello, who are you? {}\"" -msgstr "\"Merhaba, nasılsın? {}\"" - #: src/smart-pointers/trait-objects.md msgid "Memory layout after allocating `pets`:" msgstr "" @@ -8077,59 +8823,59 @@ msgstr "" msgid "" "```bob\n" " Stack Heap\n" -".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " -"- -.\n" -": : : :\n" -": \"pets: Vec\" : : \"data: Cat\" +----+----+----" +".- - - - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - " +"- - - -.\n" +": : : :\n" +": \"pets: Vec>\" : : \"data: Cat\" +----+----" +"+----+----+ :\n" +": +-----------+-------+ : : +-------+-------+ | F | i | d " +"| o | :\n" +": | ptr | o---+-------+--. : | lives | 9 | +----+----+----" "+----+ :\n" -": +-----------+-------+ : : +-------+-------+ | F | i | d | " -"o | :\n" -": | ptr | o---+---+--. : | lives | 9 | +----+----+----" -"+----+ :\n" -": | len | 2 | : | : +-------+-------+ " +": | len | 2 | : | : +-------+-------+ " "^ :\n" -": | capacity | 2 | : | : ^ " +": | capacity | 2 | : | : ^ " "| :\n" -": +-----------+-------+ : | : | " +": +-----------+-------+ : | : | " "'-------. :\n" -": : | : | data:" +": : | : | data:" "\"Dog\"| :\n" -": : | : | +-------+--|-------" -"+ :\n" -"`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " -"| :\n" -" `--+-->| o o | o o-|----->| age | 5 " -"| :\n" -" : +-|---+-|---+ +-------+----------" -"+ :\n" -" : | " +": : | : | +-------" +"+--|-------+ :\n" +"`- - - - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, " +"4, 4 | :\n" +" `--+-->| o o | o o-|----->| age " +"| 5 | :\n" +" : +-|---+-|---+ +-------" +"+----------+ :\n" +" : | " "| :\n" -" `- - -| - - |- - - - - - - - - - - - - - - " -"- -'\n" -" | |\n" -" | | " +" `- - -| - - |- - - - - - - - - - - - - " +"- - - -'\n" +" | |\n" +" | | " "\"Program text\"\n" -" .- - -| - - |- - - - - - - - - - - - - - - " -"- -.\n" -" : | | " +" .- - -| - - |- - - - - - - - - - - - - " +"- - - -.\n" +" : | | " "vtable :\n" -" : | | +----------------------" -"+ :\n" -" : | `----->| \"::" +" : | | " +"+----------------------+ :\n" +" : | `----->| \"::" "talk\" | :\n" -" : | +----------------------" -"+ :\n" -" : | " +" : | " +"+----------------------+ :\n" +" : | " "vtable :\n" -" : | +----------------------" -"+ :\n" -" : '----------->| \"::" +" : | " +"+----------------------+ :\n" +" : '----------->| \"::" "talk\" | :\n" -" : +----------------------" -"+ :\n" -" : :\n" -" '- - - - - - - - - - - - - - - - - - - - - " -"- -'\n" +" : " +"+----------------------+ :\n" +" : :\n" +" '- - - - - - - - - - - - - - - - - - - " +"- - - -'\n" "```" msgstr "" @@ -8169,6 +8915,17 @@ msgstr "" msgid "Compare these outputs in the above example:" msgstr "" +#: src/smart-pointers/trait-objects.md +msgid "\"{} {}\"" +msgstr "" + +#: 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/concurrency/async-pitfalls/cancellation.md +msgid "\"{}\"" +msgstr "\"{}\"" + #: src/smart-pointers/exercise.md msgid "" "A binary tree is a tree-type data structure where every node has two " @@ -8181,12 +8938,6 @@ msgstr "" msgid "Implement the following types, so that the given tests pass." msgstr "" -#: src/smart-pointers/exercise.md -msgid "" -"Extra Credit: implement an iterator over a binary tree that returns the " -"values in order." -msgstr "" - #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "/// A node in the binary tree.\n" msgstr "" @@ -8203,47 +8954,20 @@ msgid "" msgstr "" #: src/smart-pointers/exercise.md -msgid "// Implement `new`, `insert`, `len`, and `has`.\n" +msgid "// Implement `new`, `insert`, `len`, and `has` for `Subtree`.\n" msgstr "" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "// not a unique item\n" msgstr "" -#: src/smart-pointers/solution.md src/android/testing/googletest.md -msgid "\"bar\"" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "[Borrowing](./borrowing.md) (50 minutes)" -msgstr "" - -#: src/welcome-day-3-afternoon.md -msgid "[Lifetimes](./lifetimes.md) (50 minutes)" -msgstr "[Ömürler](./lifetimes.md) (50 dakika)" - #: src/welcome-day-3-afternoon.md msgid "" -"Including 10 minute breaks, this session should take about 1 hour and 50 " -"minutes" -msgstr "" -"Bu oturum 10 dakikalık aralar dahil yaklaşık 1 saat 50 dakika sürecektir" - -#: 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) (20 minutes)" +"Including 10 minute breaks, this session should take about 1 hour and 55 " +"minutes. It contains:" msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 1 saat 55 dakika sürmelidir. " +"İçeriği:" #: src/borrowing/shared.md msgid "" @@ -8266,36 +8990,45 @@ msgid "" msgstr "" #: src/borrowing/shared.md -msgid "Notes on stack returns:" +msgid "Notes on stack returns and inlining:" msgstr "" #: src/borrowing/shared.md msgid "" "Demonstrate that the return from `add` is cheap because the compiler can " -"eliminate the copy operation. Change the above code to print stack addresses " -"and run it on the [Playground](https://play.rust-lang.org/?" -"version=stable&mode=release&edition=2021&gist=0cb13be1c05d7e3446686ad9947c4671) " +"eliminate the copy operation, by inlining the call to add into main. Change " +"the above code to print stack addresses and run it on the [Playground]" +"(https://play.rust-lang.org/?" +"version=stable&mode=release&edition=2024&gist=0cb13be1c05d7e3446686ad9947c4671) " "or look at the assembly in [Godbolt](https://rust.godbolt.org/). In the " "\"DEBUG\" optimization level, the addresses should change, while they stay " "the same when changing to the \"RELEASE\" setting:" msgstr "" #: src/borrowing/shared.md -msgid "The Rust compiler can do return value optimization (RVO)." +msgid "" +"The Rust compiler can do automatic inlining, that can be disabled on a " +"function level with `#[inline(never)]`." msgstr "" #: src/borrowing/shared.md msgid "" -"In C++, copy elision has to be defined in the language specification because " -"constructors can have side effects. In Rust, this is not an issue at all. If " -"RVO did not happen, Rust will always perform a simple and efficient `memcpy` " -"copy." +"Once disabled, the printed address will change on all optimization levels. " +"Looking at Godbolt or Playground, one can see that in this case, the return " +"of the value depends on the ABI, e.g. on amd64 the two i32 that is making up " +"the point will be returned in 2 registers (eax and edx)." msgstr "" #: src/borrowing/borrowck.md msgid "" "Rust's _borrow checker_ puts constraints on the ways you can borrow values. " -"For a given value, at any time:" +"We've already seen that a reference cannot _outlive_ the value it borrows:" +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"There's also a second main rule that the borrow checker enforces: The " +"_aliasing_ rule. For a given value, at any time:" msgstr "" #: src/borrowing/borrowck.md @@ -8308,8 +9041,9 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"Note that the requirement is that conflicting references not _exist_ at the " -"same point. It does not matter where the reference is dereferenced." +"The \"outlives\" rule was demonstrated previously when we first looked at " +"references. We review it here to show students that the borrow checking is " +"following a few different rules to validate borrowing." msgstr "" #: src/borrowing/borrowck.md @@ -8320,8 +9054,24 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"Move the `println!` statement for `b` before the scope that introduces `c` " -"to make the code compile." +"Note that the requirement is that conflicting references not _exist_ at the " +"same point. It does not matter where the reference is dereferenced. Try " +"commenting out `*c = 20` and show that the compiler error still occurs even " +"if we never use `c`." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Note that the intermediate reference `c` isn't necessary to trigger a borrow " +"conflict. Replace `c` with a direct mutation of `a` and demonstrate that " +"this produces a similar error. This is because direct mutation of a value " +"effectively creates a temporary mutable reference." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Move the `dbg!` statement for `b` before the scope that introduces `c` to " +"make the code compile." msgstr "" #: src/borrowing/borrowck.md @@ -8333,18 +9083,54 @@ msgstr "" #: src/borrowing/borrowck.md msgid "" -"The exclusive reference constraint is quite strong. Rust uses it to ensure " -"that data races do not occur. Rust also _relies_ on this constraint to " -"optimize code. For example, a value behind a shared reference can be safely " -"cached in a register for the lifetime of that reference." +"Technically multiple mutable references to a piece of data can exist at the " +"same time via re-borrowing. This is what allows you to pass a mutable " +"reference into a function without invaliding the original reference. [This " +"playground example](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=8f5896878611566845fe3b0f4dc5af68) " +"demonstrates that behavior." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Rust uses the exclusive reference constraint to ensure that data races do " +"not occur in multi-threaded code, since only one thread can have mutable " +"access to a piece of data at a time." +msgstr "" + +#: src/borrowing/borrowck.md +msgid "" +"Rust also uses this constraint to optimize code. For example, a value behind " +"a shared reference can be safely cached in a register for the lifetime of " +"that reference." msgstr "" #: src/borrowing/borrowck.md msgid "" -"The borrow checker is designed to accommodate many common patterns, such as " -"taking exclusive references to different fields in a struct at the same " -"time. But, there are some situations where it doesn't quite \"get it\" and " -"this often results in \"fighting with the borrow checker.\"" +"Fields of a struct can be borrowed independently of each other, but calling " +"a method on a struct will borrow the whole struct, potentially invalidating " +"references to individual fields. See [this playground snippet](https://play." +"rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=f293a31f2d4d0d31770486247c2e8437) " +"for an example of this." +msgstr "" + +#: src/borrowing/examples.md +msgid "" +"As a concrete example of how these borrowing rules prevent memory errors, " +"consider the case of modifying a collection while there are references to " +"its elements:" +msgstr "" + +#: src/borrowing/examples.md +msgid "Similarly, consider the case of iterator invalidation:" +msgstr "" + +#: src/borrowing/examples.md +msgid "" +"In both of these cases, modifying the collection by pushing new elements " +"into it can potentially invalidate existing references to the collection's " +"elements if the collection has to reallocate." msgstr "" #: src/borrowing/interior-mutability.md @@ -8362,69 +9148,82 @@ msgid "" msgstr "" #: src/borrowing/interior-mutability.md -msgid "`RefCell`" -msgstr "`RefCell`" +msgid "" +"The main thing to take away from this slide is that Rust provides _safe_ " +"ways to modify data behind a shared reference. There are a variety of ways " +"to ensure that safety, and the next sub-slides present a few of them." +msgstr "" -#: src/borrowing/interior-mutability.md -msgid "\"graph: {root:#?}\"" +#: src/borrowing/interior-mutability/cell.md +msgid "" +"`Cell` wraps a value and allows getting or setting the value using only a " +"shared reference to the `Cell`. However, it does not allow any references to " +"the inner value. Since there are no references, borrowing rules cannot be " +"broken." msgstr "" -#: src/borrowing/interior-mutability.md -msgid "\"graph sum: {}\"" +#: src/borrowing/interior-mutability/cell.md +#: src/borrowing/interior-mutability/refcell.md +msgid "// Note that `cell` is NOT declared as mutable.\n" msgstr "" -#: src/borrowing/interior-mutability.md -msgid "`Cell`" +#: src/borrowing/interior-mutability/cell.md +msgid "" +"`Cell` is a simple means to ensure safety: it has a `set` method that takes " +"`&self`. This needs no runtime check, but requires moving values, which can " +"have its own cost." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`Cell` wraps a value and allows getting or setting the value, even with a " -"shared reference to the `Cell`. However, it does not allow any references to " -"the value. Since there are no references, borrowing rules cannot be broken." +"`RefCell` allows accessing and mutating a wrapped value by providing " +"alternative types `Ref` and `RefMut` that emulate `&T`/`&mut T` without " +"actually being Rust references." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"The main thing to take away from this slide is that Rust provides _safe_ " -"ways to modify data behind a shared reference. There are a variety of ways " -"to ensure that safety, and `RefCell` and `Cell` are two of them." +"These types perform dynamic checks using a counter in the `RefCell` to " +"prevent existence of a `RefMut` alongside another `Ref`/`RefMut`." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`RefCell` enforces Rust's usual borrowing rules (either multiple shared " -"references or a single exclusive reference) with a runtime check. In this " -"case, all borrows are very short and never overlap, so the checks always " -"succeed." +"By implementing `Deref` (and `DerefMut` for `RefMut`), these types allow " +"calling methods on the inner value without allowing references to escape." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`Rc` only allows shared (read-only) access to its contents, since its " -"purpose is to allow (and count) many references. But we want to modify the " -"value, so we need interior mutability." +"// This triggers an error at runtime.\n" +" // let other = cell.borrow();\n" +" // println!(\"{}\", other);\n" msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md +msgid "\"{cell:?}\"" +msgstr "\"{cell:?}\"" + +#: src/borrowing/interior-mutability/refcell.md msgid "" -"`Cell` is a simpler means to ensure safety: it has a `set` method that takes " -"`&self`. This needs no runtime check, but requires moving values, which can " -"have its own cost." +"`RefCell` enforces Rust's usual borrowing rules (either multiple shared " +"references or a single exclusive reference) with a runtime check. In this " +"case, all borrows are very short and never overlap, so the checks always " +"succeed." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"Demonstrate that reference loops can be created by adding `root` to `subtree." -"children`." +"The extra block in the example is to end the borrow created by the call to " +"`borrow_mut` before we print the cell. Trying to print a borrowed `RefCell` " +"just shows the message `\"{borrowed}\"`." msgstr "" -#: src/borrowing/interior-mutability.md +#: src/borrowing/interior-mutability/refcell.md msgid "" -"To demonstrate a runtime panic, add a `fn inc(&mut self)` that increments " -"`self.value` and calls the same method on its children. This will panic in " -"the presence of the reference loop, with `thread 'main' panicked at 'already " -"borrowed: BorrowMutError'`." +"There are also `OnceCell` and `OnceLock`, which allow initialization on " +"first use. Making these useful requires some more knowledge than students " +"have at this time." msgstr "" #: src/borrowing/exercise.md @@ -8456,29 +9255,7 @@ msgstr "" #: src/android/build-rules/library.md #: src/android/aidl/example-service/client.md msgid "\"Bob\"" -msgstr "" - -#: src/borrowing/exercise.md src/borrowing/solution.md -msgid "\"I'm {} and my age is {}\"" -msgstr "" - -#: src/lifetimes.md -msgid "" -"[Lifetime Annotations](./lifetimes/lifetime-annotations.md) (10 minutes)" -msgstr "" -"[Ömür için Ek Açıklamalar](./lifetimes/lifetime-annotations.md) (10 dakika)" - -#: src/lifetimes.md -msgid "[Lifetime Elision](./lifetimes/lifetime-elision.md) (5 minutes)" -msgstr "[Ömür Atlaması (Elision)](./lifetimes/lifetime-elision.md) (5 dakika)" - -#: src/lifetimes.md -msgid "[Struct Lifetimes](./lifetimes/struct-lifetimes.md) (5 minutes)" -msgstr "[Yapı Ömürleri](./lifetimes/struct-lifetimes.md) (5 dakika)" - -#: src/lifetimes.md -msgid "[Exercise: Protobuf Parsing](./lifetimes/exercise.md) (30 minutes)" -msgstr "[Alıştırma: Protobuf Ayrıştırma](./lifetimes/exercise.md) (30 dakika)" +msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" @@ -8496,25 +9273,24 @@ msgstr "" #: 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." +"Only ownership, not lifetime annotations, control when values are destroyed " +"and determine the concrete lifetime of a given value. The borrow checker " +"just validates that borrows never extend beyond the concrete lifetime of the " +"value." msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" -"Lifetimes become more complicated when considering passing values to and " -"returning values from functions." +"Explicit lifetime annotations, like types, are required on function " +"signatures (but can be elided in common cases). These provide information " +"for inference at callsites and within the function body, helping the borrow " +"checker to do its job." msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" msgstr "" -#: src/lifetimes/lifetime-annotations.md -msgid "\"p3: {p3:?}\"" -msgstr "" - #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " @@ -8530,13 +9306,14 @@ msgstr "" #: src/lifetimes/lifetime-annotations.md msgid "" -"This says, \"given p1 and p2 which both outlive `'a`, the return value lives " -"for at least `'a`." +"This says there is some lifetime `'a` which both `p1` and `p2` outlive, and " +"which outlives the return value. The borrow checker verifies this within the " +"function body, and uses this information in `main` to determine a lifetime " +"for `p3`." msgstr "" #: src/lifetimes/lifetime-annotations.md -msgid "" -"In common cases, lifetimes can be elided, as described on the next slide." +msgid "Try dropping `p2` in `main` before printing `p3`." msgstr "" #: src/lifetimes/lifetime-elision.md @@ -8574,7 +9351,8 @@ msgstr "" #: 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." +"references in its arguments that requires explicit annotation. In `main`, " +"the return value is allowed to outlive the query." msgstr "" #: src/lifetimes/lifetime-elision.md @@ -8597,46 +9375,31 @@ msgid "" "just work with owned data by cloning values where necessary." msgstr "" -#: src/lifetimes/struct-lifetimes.md -msgid "Lifetimes in Data Structures" -msgstr "Veri Yapılarında Ömürler" - #: src/lifetimes/struct-lifetimes.md msgid "" "If a data type stores borrowed data, it must be annotated with a lifetime:" msgstr "" -#: src/lifetimes/struct-lifetimes.md -msgid "\"Bye {text}!\"" -msgstr "" - #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "" #: src/lifetimes/struct-lifetimes.md -msgid "// erase(text);\n" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md -msgid "\"{fox:?}\"" -msgstr "" - -#: src/lifetimes/struct-lifetimes.md -msgid "\"{dog:?}\"" +msgid "// drop(doc);\n" msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "" "In the above example, the annotation on `Highlight` enforces that the data " "underlying the contained `&str` lives at least as long as any instance of " -"`Highlight` that uses that data." +"`Highlight` that uses that data. A struct cannot live longer than the data " +"it references." msgstr "" #: src/lifetimes/struct-lifetimes.md msgid "" -"If `text` is consumed before the end of the lifetime of `fox` (or `dog`), " -"the borrow checker throws an error." +"If `doc` is dropped before the end of the lifetime of `noun` or `verb`, the " +"borrow checker throws an error." msgstr "" #: src/lifetimes/struct-lifetimes.md @@ -8678,50 +9441,64 @@ msgstr "" msgid "We'll use the following proto:" msgstr "" +#: src/lifetimes/exercise.md +msgid "Messages" +msgstr "" + #: 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 " "number (e.g., `2` for the `id` field of a `Person` message) and a wire type " -"defining how the payload should be determined from the byte stream." +"defining how the payload should be determined from the byte stream. These " +"are combined into a single integer, as decoded in `unpack_tag` below." msgstr "" #: 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 " -"code also defines callbacks to handle `Person` and `PhoneNumber` fields, and " -"to parse a message into a series of calls to those callbacks." +msgid "Varint" msgstr "" #: src/lifetimes/exercise.md msgid "" -"What remains for you is to implement the `parse_field` function and the " -"`ProtoMessage` trait for `Person` and `PhoneNumber`." +"Integers, including the tag, are represented with a variable-length encoding " +"called VARINT. Luckily, `parse_varint` is defined for you below." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid varint\"" +#: src/lifetimes/exercise.md +msgid "Wire Types" msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid wire-type\"" +#: src/lifetimes/exercise.md +msgid "" +"Proto defines several wire types, only two of which are used in this " +"exercise." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Unexpected EOF\"" +#: src/lifetimes/exercise.md +msgid "" +"The `Varint` wire type contains a single varint, and is used to encode proto " +"values of type `int32` such as `Person.id`." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid length\"" +#: src/lifetimes/exercise.md +msgid "" +"The `Len` wire type contains a length expressed as a varint, followed by a " +"payload of that number of bytes. This is used to encode proto values of type " +"`string` such as `Person.name`. It is also used to encode proto values " +"containing sub-messages such as `Person.phones`, where the payload contains " +"an encoding of the sub-message." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Unexpected wire-type)\"" +#: src/lifetimes/exercise.md +msgid "" +"The given code also defines callbacks to handle `Person` and `PhoneNumber` " +"fields, and to parse a message into a series of calls to those callbacks." msgstr "" -#: src/lifetimes/exercise.md src/lifetimes/solution.md -msgid "\"Invalid string (not UTF-8)\"" +#: 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/lifetimes/exercise.md src/lifetimes/solution.md @@ -8734,7 +9511,10 @@ msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" -"//I64, -- not needed for this exercise\n" +"// The I64 WireType indicates that the value is precisely 8 bytes in\n" +" // little-endian order containing a 64-bit signed integer or double " +"type.\n" +" //I64, -- not needed for this exercise\n" " /// The Len WireType indicates that the value is a length represented as " "a\n" " /// VARINT followed by exactly that number of bytes.\n" @@ -8742,8 +9522,10 @@ msgstr "" #: 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" +"// The I32 WireType indicates that the value is precisely 4 bytes in\n" +" // little-endian order containing a 32-bit signed integer or float " +"type.\n" +" //I32, -- not needed for this exercise\n" msgstr "" #: src/lifetimes/exercise.md src/lifetimes/solution.md @@ -8754,6 +9536,10 @@ msgstr "" msgid "//I64(i64), -- not needed for this exercise\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//I32(i32), -- not needed for this exercise\n" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field, containing the field number and its value.\n" msgstr "" @@ -8762,11 +9548,39 @@ msgstr "" msgid "//1 => WireType::I64, -- not needed for this exercise\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "//5 => WireType::I32, -- not needed for this exercise\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Invalid wire type: {value}\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected string to be a `Len` field\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Invalid string\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected bytes to be a `Len` field\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Expected `u64` to be a `Varint` field\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a VARINT, returning the parsed value and the remaining bytes.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Not enough bytes for varint\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "// This is the last byte of the VARINT, so convert it to\n" @@ -8777,6 +9591,10 @@ msgstr "" msgid "// More than 7 bytes is invalid.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Too many bytes for varint\"" +msgstr "" + #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Convert a tag into a field number and a WireType.\n" msgstr "" @@ -8808,17 +9626,67 @@ msgstr "" msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" msgstr "" +#: src/lifetimes/exercise.md src/lifetimes/solution.md src/modules/exercise.md +#: src/modules/solution.md src/testing/unit-tests.md src/testing/solution.md +msgid "\"\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"beautiful name\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"Evan\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1234-777-9090\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"home\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "// Put that all together into a single parse.\n" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"maxwell\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1202-555-1212\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"+1800-867-5308\"" +msgstr "" + +#: src/lifetimes/exercise.md src/lifetimes/solution.md +msgid "\"mobile\"" +msgstr "" + +#: src/lifetimes/exercise.md +msgid "" +"In this exercise there are various cases where protobuf parsing might fail, " +"e.g. if you try to parse an `i32` when there are fewer than 4 bytes left in " +"the data buffer. In normal Rust code we'd handle this with the `Result` " +"enum, but for simplicity in this exercise we panic if any errors are " +"encountered. On day 4 we'll cover error handling in Rust in more detail." +msgstr "" + #: src/lifetimes/solution.md -msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" +msgid "\"len not a valid `usize`\"" msgstr "" #: src/lifetimes/solution.md -msgid "// skip everything else\n" +msgid "\"Unexpected EOF\"" msgstr "" #: src/lifetimes/solution.md -msgid "b\"hello\"" -msgstr "b\"merhaba\"" +msgid "// skip everything else\n" +msgstr "" #: src/welcome-day-4.md msgid "Welcome to Day 4" @@ -8850,76 +9718,251 @@ 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)" +#: src/iterators.md +msgid "Iterator Trait" +msgstr "Adımlayıcı Özelliği (Iterator Trait)" + +#: src/iterators.md +msgid "Iterator Helper Methods" msgstr "" -#: src/welcome-day-4.md -msgid "[Iterators](./iterators.md) (45 minutes)" +#: src/iterators.md +msgid "collect" +msgstr "collect" + +#: src/iterators.md +msgid "IntoIterator" +msgstr "IntoIterator" + +#: src/iterators/motivation.md +msgid "Motivating Iterators" +msgstr "Adımlayıcılara (Iterators) Motive Edici Şeyler" + +#: src/iterators/motivation.md +msgid "" +"If you want to iterate over the contents of an array, you'll need to define:" msgstr "" -#: src/welcome-day-4.md -msgid "[Modules](./modules.md) (40 minutes)" +#: src/iterators/motivation.md +msgid "" +"Some state to keep track of where you are in the iteration process, e.g. an " +"index." msgstr "" -#: src/welcome-day-4.md -msgid "[Testing](./testing.md) (45 minutes)" +#: src/iterators/motivation.md +msgid "A condition to determine when iteration is done." msgstr "" -#: src/welcome-day-4.md -msgid "" -"Including 10 minute breaks, this session should take about 2 hours and 40 " -"minutes" +#: src/iterators/motivation.md +msgid "Logic for updating the state of iteration each loop." msgstr "" -#: src/iterators.md -msgid "[Iterator](./iterators/iterator.md) (5 minutes)" +#: src/iterators/motivation.md +msgid "Logic for fetching each element using that iteration state." msgstr "" -#: src/iterators.md -msgid "[IntoIterator](./iterators/intoiterator.md) (5 minutes)" +#: src/iterators/motivation.md +msgid "In a C-style for loop you declare these things directly:" msgstr "" -#: src/iterators.md -msgid "[FromIterator](./iterators/fromiterator.md) (5 minutes)" +#: src/iterators/motivation.md +msgid "" +"In Rust we bundle this state and logic together into an object known as an " +"\"iterator\"." msgstr "" -#: src/iterators.md +#: src/iterators/motivation.md +msgid "" +"This slide provides context for what Rust iterators do under the hood. We " +"use the (hopefully) familiar construct of a C-style `for` loop to show how " +"iteration requires some state and some logic, that way on the next slide we " +"can show how an iterator bundles these together." +msgstr "" + +#: src/iterators/motivation.md msgid "" -"[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" +"Rust doesn't have a C-style `for` loop, but we can express the same thing " +"with `while`:" msgstr "" -#: src/iterators.md src/testing.md -msgid "This segment should take about 45 minutes" -msgstr "Bu bölüm yaklaşık 45 dakika sürecektir" +#: src/iterators/motivation.md +msgid "" +"There's another way to express array iteration using `for` in C and C++: You " +"can use a pointer to the front and a pointer to the end of the array and " +"then compare those pointers to determine when the loop should end." +msgstr "" + +#: src/iterators/motivation.md +msgid "" +"If students ask, you can point out that this is how Rust's slice and array " +"iterators work under the hood (though implemented as a Rust iterator)." +msgstr "" #: src/iterators/iterator.md msgid "" "The [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " -"trait supports iterating over values in a collection. It requires a `next` " -"method and provides lots of methods. Many standard library types implement " -"`Iterator`, and you can implement it yourself, too:" +"trait defines how an object can be used to produce a sequence of values. For " +"example, if we wanted to create an iterator that can produce the elements of " +"a slice it might look something like this:" +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"The `SliceIter` example implements the same logic as the C-style `for` loop " +"demonstrated on the last slide." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"Point out to the students that iterators are lazy: Creating the iterator " +"just initializes the struct but does not otherwise do any work. No work " +"happens until the `next` method is called." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"Iterators don't need to be finite! It's entirely valid to have an iterator " +"that will produce values forever. For example, a half open range like `0..` " +"will keep going until integer overflow occurs." +msgstr "" + +#: src/iterators/iterator.md +msgid "" +"The \"real\" version of `SliceIter` is the [`slice::Iter`](https://doc.rust-" +"lang.org/stable/std/slice/struct.Iter.html) type in the standard library, " +"however the real version uses pointers under the hood instead of an index in " +"order to eliminate bounds checks." msgstr "" #: src/iterators/iterator.md -msgid "\"fib({i}): {n}\"" +msgid "" +"The `SliceIter` example is a good example of a struct that contains a " +"reference and therefore uses lifetime annotations." msgstr "" #: src/iterators/iterator.md msgid "" +"You can also demonstrate adding a generic parameter to `SliceIter` to allow " +"it to work with any kind of slice (not just `&[i32]`)." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"In addition to the `next` method that defines how an iterator behaves, the " +"`Iterator` trait provides 70+ helper methods that can be used to build " +"customized iterators." +msgstr "" + +#: src/iterators/helpers.md +msgid "// Create a range from 1 to 10\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Keep only even numbers\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Square each number\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "// Sum up all the squared numbers\n" +msgstr "" + +#: src/iterators/helpers.md +msgid "\"The sum of squares of even numbers from 1 to 10 is: {}\"" +msgstr "" + +#: src/iterators/helpers.md +msgid "" "The `Iterator` trait implements many common functional programming " "operations over collections (e.g. `map`, `filter`, `reduce`, etc). This is " -"the trait where you can find all the documentation about them. In Rust these " -"functions should produce the code as efficient as equivalent imperative " -"implementations." +"the trait where you can find all the documentation about them." msgstr "" -#: src/iterators/iterator.md +#: src/iterators/helpers.md msgid "" -"`IntoIterator` is the trait that makes for loops work. It is implemented by " -"collection types such as `Vec` and references to them such as `&Vec` " -"and `&[T]`. Ranges also implement it. This is why you can iterate over a " -"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +"Many of these helper methods take the original iterator and produce a new " +"iterator with different behavior. These are know as \"iterator adapter " +"methods\"." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"Some methods, like `sum` and `count`, consume the iterator and pull all of " +"the elements out of it." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"These methods are designed to be chained together so that it's easy to build " +"a custom iterator that does exactly what you need." +msgstr "" + +#: src/iterators/helpers.md +msgid "" +"Rust's iterators are extremely efficient and highly optimizable. Even " +"complex iterators made by combining many adapter methods will still result " +"in code as efficient as equivalent imperative implementations." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"The [`collect`](https://doc.rust-lang.org/std/iter/trait.Iterator." +"html#method.collect) method lets you build a collection from an [`Iterator`]" +"(https://doc.rust-lang.org/std/iter/trait.Iterator.html)." +msgstr "" + +#: src/iterators/collect.md +msgid "\"prime_squares: {prime_squares:?}\"" +msgstr "" + +#: src/iterators/collect.md +msgid "" +"Any iterator can be collected in to a `Vec`, `VecDeque`, or `HashSet`. " +"Iterators that produce key-value pairs (i.e. a two-element tuple) can also " +"be collected into `HashMap` and `BTreeMap`." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"Show the students the definition for `collect` in the standard library docs. " +"There are two ways to specify the generic type `B` for this method:" +msgstr "" + +#: src/iterators/collect.md +msgid "" +"With the \"turbofish\": `some_iterator.collect::()`, as " +"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " +"elements." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " +"Rewrite the example to use this form." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"If students are curious about how this works, you can bring up the " +"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " +"trait, which defines how each type of collection gets built from an iterator." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"In addition to the basic implementations of `FromIterator` for `Vec`, " +"`HashMap`, etc., there are also more specialized implementations which let " +"you do cool things like convert an `Iterator>` into a " +"`Result, E>`." +msgstr "" + +#: src/iterators/collect.md +msgid "" +"The reason type annotations are often needed with `collect` is because it's " +"generic over its return type. This makes it harder for the compiler to infer " +"the correct type in a lot of cases." msgstr "" #: src/iterators/intoiterator.md @@ -8934,6 +9977,14 @@ msgstr "" msgid "\"point = {x}, {y}\"" msgstr "" +#: src/iterators/intoiterator.md +msgid "" +"`IntoIterator` is the trait that makes for loops work. It is implemented by " +"collection types such as `Vec` and references to them such as `&Vec` " +"and `&[T]`. Ranges also implement it. This is why you can iterate over a " +"vector with `for i in some_vec { .. }` but `some_vec.next()` doesn't exist." +msgstr "" + #: src/iterators/intoiterator.md msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " @@ -8966,8 +10017,10 @@ msgstr "" #: src/iterators/intoiterator.md msgid "" -"Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " -"reference to the `Grid` in `GridIter`." +"Fix this issue by implementing `IntoIterator` for `&Grid` and creating a " +"`GridRefIter` that iterates by reference. A version with both `GridIter` and " +"`GridRefIter` is available [in this playground](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=947e371c7295af758504f01f149023a1)." msgstr "" #: src/iterators/intoiterator.md @@ -8975,50 +10028,7 @@ msgid "" "The same problem can occur for standard library types: `for e in " "some_vector` will take ownership of `some_vector` and iterate over owned " "elements from that vector. Use `for e in &some_vector` instead, to iterate " -"over references to elements of `some_vector`." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "FromIterator" -msgstr "FromIterator" - -#: src/iterators/fromiterator.md -msgid "" -"[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " -"lets you build a collection from an [`Iterator`](https://doc.rust-lang.org/" -"std/iter/trait.Iterator.html)." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "\"prime_squares: {prime_squares:?}\"" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "`Iterator` implements" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "There are two ways to specify `B` for this method:" -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"With the \"turbofish\": `some_iterator.collect::()`, as " -"shown. The `_` shorthand used here lets Rust infer the type of the `Vec` " -"elements." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " -"Rewrite the example to use this form." -msgstr "" - -#: src/iterators/fromiterator.md -msgid "" -"There are basic implementations of `FromIterator` for `Vec`, `HashMap`, etc. " -"There are also more specialized implementations which let you do cool things " -"like convert an `Iterator>` into a `Result, E>`." +"over references to elements of `some_vector`." msgstr "" #: src/iterators/exercise.md @@ -9044,25 +10054,8 @@ msgid "" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" -#: src/modules.md -msgid "[Modules](./modules/modules.md) (3 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)" +#: src/modules.md src/modules/paths.md +msgid "use, super, self" msgstr "" #: src/modules/modules.md @@ -9104,7 +10097,7 @@ msgstr "" #: src/modules/filesystem.md msgid "" -"This tells rust that the `garden` module content is found at `src/garden." +"This tells Rust that the `garden` module content is found at `src/garden." "rs`. Similarly, a `garden::vegetables` module can be found at `src/garden/" "vegetables.rs`." msgstr "" @@ -9243,8 +10236,80 @@ msgid "" "its descendants)." msgstr "" -#: src/modules/paths.md -msgid "use, super, self" +#: src/modules/encapsulation.md +msgid "Visibility and Encapsulation" +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Like with items in a module, struct fields are also private by default. " +"Private fields are likewise visible within the rest of the module (including " +"child modules). This allows us to encapsulate implementation details of " +"struct, controlling what data and functionality is visible externally." +msgstr "" + +#: src/modules/encapsulation.md +msgid "\"Is {} big? {}\"" +msgstr "\"{} büyük mü? {}\"" + +#: src/modules/encapsulation.md +msgid "\"foo.val = {}\"" +msgstr "" + +#: src/modules/encapsulation.md +msgid "// let foo = Foo { val: 42, is_big: true };\n" +msgstr "" + +#: src/modules/encapsulation.md +msgid "// println!(\"Is {} big? {}\", foo.val, foo.is_big);\n" +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"This slide demonstrates how privacy in structs is module-based. Students " +"coming from object oriented languages may be used to types being the " +"encapsulation boundary, so this demonstrates how Rust behaves differently " +"while showing how we can still achieve encapsulation." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Note how the `is_big` field is fully controlled by `Foo`, allowing `Foo` to " +"control how it's initialized and enforce any invariants it needs to (e.g. " +"that `is_big` is only `true` if `val > 100`)." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Point out how helper functions can be defined in the same module (including " +"child modules) in order to get access to the type's private fields/methods." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"The first commented out line demonstrates that you cannot initialize a " +"struct with private fields. The second one demonstrates that you also can't " +"directly access private fields." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Enums do not support privacy: Variants and data within those variants is " +"always public." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"If students want more information about privacy (or lack thereof) in enums, " +"you can bring up `#[doc_hidden]` and `#[non_exhaustive]` and show how " +"they're used to limit what can be done with an enum." +msgstr "" + +#: src/modules/encapsulation.md +msgid "" +"Module privacy still applies when there are `impl` blocks in other modules " +"[(example in the playground)](https://play.rust-lang.org/?" +"version=stable&mode=debug&edition=2024&gist=3e61f43c88de12bcdf69c1d6df9ab3da)." msgstr "" #: src/modules/paths.md @@ -9381,11 +10446,6 @@ msgstr "" msgid "\"+-{:-` in the public API of a library, but it " -"can be a good option in a program where you just want to display the error " -"message somewhere." -msgstr "" - -#: src/error-handling/error.md -msgid "" -"Make sure to implement the `std::error::Error` trait when defining a custom " -"error type so it can be boxed. But if you need to support the `no_std` " -"attribute, keep in mind that the `std::error::Error` trait is currently " -"compatible with `no_std` in [nightly](https://github.com/rust-lang/rust/" -"issues/103765) only." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs.rs/" -"anyhow/) crates are widely used to simplify error handling." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`thiserror` is often used in libraries to create custom error types that " -"implement `From`." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`anyhow` is often used by applications to help with error handling in " -"functions, including adding contextual information to your errors." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Found no username in {0}\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to open {path}\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Failed to read\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Username: {username}\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "\"Error: {err:?}\"" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "`thiserror`" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"The `Error` derive macro is provided by `thiserror`, and has lots of useful " -"attributes to help define error types in a compact way." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "The `std::error::Error` trait is derived automatically." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "The message from `#[error]` is used to derive the `Display` trait." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "`anyhow`" -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"`anyhow::Error` is essentially a wrapper around `Box`. As such " -"it's again generally not a good choice for the public API of a library, but " -"is widely used in applications." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "`anyhow::Result` is a type alias for `Result`." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"Actual error type inside of it can be extracted for examination if necessary." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md -msgid "" -"Functionality provided by `anyhow::Result` may be familiar to Go " -"developers, as it provides similar usage patterns and ergonomics to `(T, " -"error)` from Go." -msgstr "" - -#: src/error-handling/thiserror-and-anyhow.md +#: src/error-handling/try-conversions.md msgid "" -"`anyhow::Context` is a trait implemented for the standard `Result` and " -"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " -"and `.with_context()` on those types." +"A function that returns `Result` cannot use `?` on `Option` and vice versa. " +"However, `Option::ok_or` converts `Option` to `Result` whereas `Result::ok` " +"turns `Result` into `Option`." msgstr "" -#: src/error-handling/exercise.md -msgid "Exercise: Rewriting with Result" -msgstr "" +#: src/error-handling/error.md +msgid "Dynamic Error Types" +msgstr "Dinamik Hata Türleri" -#: src/error-handling/exercise.md +#: src/error-handling/error.md msgid "" -"The following implements a very simple parser for an expression language. " -"However, it handles errors by panicking. Rewrite it to instead use idiomatic " -"error handling and propagate errors to a return from `main`. Feel free to " -"use `thiserror` and `anyhow`." +"Sometimes we want to allow any type of error to be returned without writing " +"our own enum covering all the different possibilities. The `std::error::" +"Error` trait makes it easy to create a trait object that can contain any " +"error." msgstr "" -#: src/error-handling/exercise.md -msgid "" -"HINT: start by fixing error handling in the `parse` function. Once that is " -"working correctly, update `Tokenizer` to implement " -"`Iterator>` and handle that in the parser." +#: src/error-handling/error.md +msgid "\"count.dat\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An arithmetic operator.\n" +#: src/error-handling/error.md +msgid "\"1i3\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A token in the expression language.\n" +#: src/error-handling/error.md +msgid "\"Count: {count}\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// An expression in the expression language.\n" +#: src/error-handling/error.md +msgid "\"Error: {err}\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A reference to a variable.\n" +#: src/error-handling/error.md +msgid "" +"The `read_count` function can return `std::io::Error` (from file operations) " +"or `std::num::ParseIntError` (from `String::parse`)." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A literal number.\n" +#: src/error-handling/error.md +msgid "" +"Boxing errors saves on code, but gives up the ability to cleanly handle " +"different error cases differently in the program. As such it's generally not " +"a good idea to use `Box` in the public API of a library, but it " +"can be a good option in a program where you just want to display the error " +"message somewhere." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "/// A binary operation.\n" +#: src/error-handling/error.md +msgid "" +"Make sure to implement the `std::error::Error` trait when defining a custom " +"error type so it can be boxed." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'_'" +#: src/error-handling/thiserror.md +msgid "" +"The [`thiserror`](https://docs.rs/thiserror/) crate provides macros to help " +"avoid boilerplate when defining error types. It provides derive macros that " +"assist in implementing `From`, `Display`, and the `Error` trait." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'+'" +#: src/error-handling/thiserror.md +msgid "\"I/O error: {0}\"" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "'-'" +#: src/error-handling/thiserror.md src/error-handling/anyhow.md +msgid "\"Found no username in {0}\"" msgstr "" -#: src/error-handling/exercise.md -msgid "\"Unexpected character {c}\"" +#: src/error-handling/thiserror.md src/error-handling/anyhow.md +msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"Unexpected end of input\"" +#: src/error-handling/thiserror.md src/error-handling/anyhow.md +msgid "\"Username: {username}\"" msgstr "" -#: src/error-handling/exercise.md -msgid "\"Invalid 32-bit integer'\"" +#: src/error-handling/thiserror.md src/error-handling/anyhow.md +msgid "\"Error: {err:?}\"" msgstr "" -#: src/error-handling/exercise.md -msgid "\"Unexpected token {tok:?}\"" +#: src/error-handling/thiserror.md +msgid "" +"The `Error` derive macro is provided by `thiserror`, and has lots of useful " +"attributes to help define error types in a compact way." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "// Look ahead to parse a binary operation if present.\n" +#: src/error-handling/thiserror.md +msgid "The message from `#[error]` is used to derive the `Display` trait." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"10+foo+20-30\"" +#: src/error-handling/thiserror.md +msgid "" +"Note that the (`thiserror::`)`Error` derive macro, while it has the effect " +"of implementing the (`std::error::`)`Error` trait, is not the same this; " +"traits and macros do not share a namespace." msgstr "" -#: src/error-handling/exercise.md src/error-handling/solution.md -msgid "\"{expr:?}\"" +#: src/error-handling/anyhow.md +msgid "" +"The [`anyhow`](https://docs.rs/anyhow/) crate provides a rich error type " +"with support for carrying additional contextual information, which can be " +"used to provide a semantic trace of what the program was doing leading up to " +"the error." msgstr "" -#: src/error-handling/solution.md -msgid "\"Unexpected character '{0}' in input\"" +#: src/error-handling/anyhow.md +msgid "" +"This can be combined with the convenience macros from [`thiserror`](https://" +"docs.rs/thiserror/) to avoid writing out trait impls explicitly for custom " +"error types." msgstr "" -#: src/error-handling/solution.md -msgid "\"Tokenizer error: {0}\"" +#: src/error-handling/anyhow.md +msgid "\"Failed to open {path}\"" msgstr "" -#: src/error-handling/solution.md -msgid "\"Unexpected token {0:?}\"" +#: src/error-handling/anyhow.md +msgid "\"Failed to read\"" msgstr "" -#: src/error-handling/solution.md -msgid "\"Invalid number\"" +#: src/error-handling/anyhow.md +msgid "" +"`anyhow::Error` is essentially a wrapper around `Box`. As such " +"it's again generally not a good choice for the public API of a library, but " +"is widely used in applications." msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe](./unsafe-rust/unsafe.md) (5 minutes)" +#: src/error-handling/anyhow.md +msgid "`anyhow::Result` is a type alias for `Result`." msgstr "" -#: src/unsafe-rust.md +#: src/error-handling/anyhow.md msgid "" -"[Dereferencing Raw Pointers](./unsafe-rust/dereferencing.md) (10 minutes)" +"Functionality provided by `anyhow::Error` may be familiar to Go developers, " +"as it provides similar behavior to the Go `error` type and `Result` is much like a Go `(T, error)` (with the convention that " +"only one element of the pair is meaningful)." msgstr "" -#: src/unsafe-rust.md -msgid "[Mutable Static Variables](./unsafe-rust/mutable-static.md) (5 minutes)" +#: src/error-handling/anyhow.md +msgid "" +"`anyhow::Context` is a trait implemented for the standard `Result` and " +"`Option` types. `use anyhow::Context` is necessary to enable `.context()` " +"and `.with_context()` on those types." msgstr "" -#: src/unsafe-rust.md -msgid "[Unions](./unsafe-rust/unions.md) (5 minutes)" +#: src/error-handling/anyhow.md +msgid "" +"`anyhow::Error` has support for downcasting, much like `std::any::Any`; the " +"specific error type stored inside can be extracted for examination if " +"desired with [`Error::downcast`](https://docs.rs/anyhow/latest/anyhow/struct." +"Error.html#method.downcast)." msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe Functions](./unsafe-rust/unsafe-functions.md) (5 minutes)" +#: src/error-handling/exercise.md +msgid "" +"In this exercise we're revisiting the expression evaluator exercise that we " +"did in day 2. Our initial solution ignores a possible error case: Dividing " +"by zero! Rewrite `eval` to instead use idiomatic error handling to handle " +"this error case and return an error when it occurs. We provide a simple " +"`DivideByZeroError` type to use as the error type for `eval`." msgstr "" -#: src/unsafe-rust.md -msgid "[Unsafe Traits](./unsafe-rust/unsafe-traits.md) (5 minutes)" +#: src/error-handling/exercise.md +msgid "" +"// The original implementation of the expression evaluator. Update this to\n" +"// return a `Result` and produce an error when dividing by 0.\n" msgstr "" -#: src/unsafe-rust.md -msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" +#: src/error-handling/exercise.md +msgid "\"Cannot divide by zero!\"" msgstr "" -#: src/unsafe-rust.md -msgid "This segment should take about 1 hour and 5 minutes" +#: src/error-handling/exercise.md +msgid "" +"The starting code here isn't exactly the same as the previous exercise's " +"solution: We've added in an explicit panic to show students where the error " +"case is. Point this out if students get confused." msgstr "" +#: src/unsafe-rust.md +msgid "This segment should take about 1 hour and 15 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat 15 dakika sürmelidir. İçeriği:" + #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" msgstr "" @@ -10331,39 +11280,34 @@ msgstr "" msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" msgstr "" -#: src/unsafe-rust/dereferencing.md -msgid "\"careful!\"" -msgstr "" - #: src/unsafe-rust/dereferencing.md msgid "" -"// Safe because r1 and r2 were obtained from references and so are\n" -" // guaranteed to be non-null and properly aligned, the objects " -"underlying\n" -" // the references from which they were obtained are live throughout the\n" -" // whole unsafe block, and they are not accessed either through the\n" -" // references or concurrently through any other pointers.\n" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "\"r1 is: {}\"" -msgstr "" - -#: src/unsafe-rust/dereferencing.md -msgid "\"uhoh\"" +"// SAFETY: p1 and p2 were created by taking raw pointers to a local, so " +"they\n" +" // are guaranteed to be non-null, aligned, and point into a single " +"(stack-)\n" +" // allocated object.\n" +" //\n" +" // The object underlying the raw pointers lives for the entire function, " +"so\n" +" // it is not deallocated while the raw pointers still exist. It is not\n" +" // accessed through references while the raw pointers exist, nor is it\n" +" // accessed from other threads concurrently.\n" msgstr "" #: src/unsafe-rust/dereferencing.md -msgid "\"r2 is: {}\"" +msgid "// Mutation may soundly be observed through a raw pointer, like in C.\n" msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"// NOT SAFE. DO NOT DO THIS.\n" +"// UNSOUND. DO NOT DO THIS.\n" " /*\n" -" let r3: &String = unsafe { &*r1 };\n" -" drop(s);\n" -" println!(\"r3 is: {}\", *r3);\n" +" let r: &i32 = unsafe { &*p1 };\n" +" dbg!(r);\n" +" x = 50;\n" +" dbg!(r); // Object underlying the reference has been mutated. This is " +"UB.\n" " */" msgstr "" @@ -10410,9 +11354,12 @@ msgstr "" #: src/unsafe-rust/dereferencing.md msgid "" -"The \"NOT SAFE\" section gives an example of a common kind of UB bug: `*r1` " -"has the `'static` lifetime, so `r3` has type `&'static String`, and thus " -"outlives `s`. Creating a reference from a pointer requires _great care_." +"The \"UNSOUND\" section gives an example of a common kind of UB bug: naïvely " +"taking a reference to the dereference of a raw pointer sidesteps the " +"compiler's knowledge of what object the reference is actually pointing to. " +"As such, the borrow checker does not freeze `x` and so we are able to modify " +"it despite the existence of a reference to it. Creating a reference from a " +"pointer requires _great care_." msgstr "" #: src/unsafe-rust/mutable-static.md @@ -10429,27 +11376,47 @@ msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"However, since data races can occur, it is unsafe to read and write mutable " -"static variables:" +"However, mutable static variables are unsafe to read and write because " +"multiple threads could do so concurrently without synchronization, " +"constituting a data race." +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"Using mutable statics soundly requires reasoning about concurrency without " +"the compiler's help:" +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"// SAFETY: There are no other threads which could be accessing `COUNTER`.\n" +msgstr "" + +#: src/unsafe-rust/mutable-static.md +msgid "" +"The program here is sound because it is single-threaded. However, the Rust " +"compiler reasons about functions individually so can't assume that. Try " +"removing the `unsafe` and see how the compiler explains that it is undefined " +"behavior to access a mutable static from multiple threads." msgstr "" #: src/unsafe-rust/mutable-static.md -msgid "\"COUNTER: {COUNTER}\"" +msgid "" +"The 2024 Rust edition goes further and makes accessing a mutable static by " +"reference an error by default." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"The program here is safe because it is single-threaded. However, the Rust " -"compiler is conservative and will assume the worst. Try removing the " -"`unsafe` and see how the compiler explains that it is undefined behavior to " -"mutate a static from multiple threads." +"Using a mutable static is almost always a bad idea, you should use interior " +"mutability instead." msgstr "" #: src/unsafe-rust/mutable-static.md msgid "" -"Using a mutable static is generally a bad idea, but there are some cases " -"where it might make sense in low-level `no_std` code, such as implementing a " -"heap allocator or working with some C APIs." +"There are some cases where it might be necessary in low-level `no_std` code, " +"such as implementing a heap allocator or working with some C APIs. In this " +"case you should use pointers rather than references." msgstr "" #: src/unsafe-rust/unions.md @@ -10482,115 +11449,205 @@ msgid "" "crates/zerocopy) crate." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "Calling Unsafe Functions" -msgstr "Emniyetsiz (Unsafe) Fonksiyonları Çağırma" - #: src/unsafe-rust/unsafe-functions.md msgid "" "A function or method can be marked `unsafe` if it has extra preconditions " -"you must uphold to avoid undefined behaviour:" +"you must uphold to avoid undefined behaviour." msgstr "" -#: src/unsafe-rust/unsafe-functions.md src/unsafe-rust/exercise.md -#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md -#: src/android/interoperability/with-c/rust.md -#: 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/solutions-afternoon.md -msgid "\"C\"" +#: src/unsafe-rust/unsafe-functions.md +msgid "Unsafe functions may come from two places:" msgstr "" #: src/unsafe-rust/unsafe-functions.md -msgid "\"🗻∈🌏\"" +#, fuzzy +msgid "Rust functions declared unsafe." +msgstr "Rust fonksiyonları `unsafe fn` ile emniyetli olmadığı bildirildi." + +#: src/unsafe-rust/unsafe-functions.md +msgid "Unsafe foreign functions in `extern \"C\"` blocks." msgstr "" #: src/unsafe-rust/unsafe-functions.md +msgid "We will look at the two kinds of unsafe functions next." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/rust.md msgid "" -"// Safe because the indices are in the correct order, within the bounds of\n" -" // the string slice, and lie on UTF-8 sequence boundaries.\n" +"You can mark your own functions as `unsafe` if they require particular " +"preconditions to avoid undefined behaviour." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"emoji: {}\"" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"/// Swaps the values pointed to by the given pointers.\n" +"///\n" +"/// # Safety\n" +"///\n" +"/// The pointers must be valid, properly aligned, and not otherwise accessed " +"for\n" +"/// the duration of the function call.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"char count: {}\"" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"// SAFETY: Our caller promised that the pointers are valid, properly " +"aligned\n" +" // and have no other access.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "// Undefined behavior if abs misbehaves.\n" -msgstr "// Undefined behavior if abs misbehaves.\n" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"// SAFETY: The pointers must be valid, aligned and unique because they came\n" +" // from references.\n" +msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"Absolute value of -3 according to C: {}\"" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "\"a = {}, b = {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/rust.md msgid "" -"// Not upholding the UTF-8 encoding requirement breaks memory safety!\n" -" // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" -" // println!(\"char count: {}\", count_chars(unsafe {\n" -" // emojis.get_unchecked(0..3) }));\n" +"We wouldn't actually use pointers for a `swap` function --- it can be done " +"safely with references." msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "Writing Unsafe Functions" -msgstr "Emniyetsiz (Unsafe) Fonksiyonlar Yazma" +#: src/unsafe-rust/unsafe-functions/rust.md +msgid "" +"Note that Rust 2021 and earlier allow unsafe code within an unsafe function " +"without an `unsafe` block. This changed in the 2024 edition. We can prohibit " +"it in older editions with `#[deny(unsafe_op_in_unsafe_fn)]`. Try adding it " +"and see what happens." +msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" -"You can mark your own functions as `unsafe` if they require particular " -"conditions to avoid undefined behaviour." +"You can declare foreign functions for access from Rust with `unsafe extern`. " +"This is unsafe because the compiler has to way to reason about their " +"behavior. Functions declared in an `extern` block must be marked as `safe` " +"or `unsafe`, depending on whether they have preconditions for safe use:" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md src/unsafe-rust/exercise.md +#: src/unsafe-rust/solution.md src/android/interoperability/with-c.md +#: src/android/interoperability/with-c/rust-library.md +#: src/android/interoperability/cpp/cpp-bridge.md +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md +msgid "\"C\"" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"// `abs` doesn't deal with pointers and doesn't have any safety " +"requirements.\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" -"/// Swaps the values pointed to by the given pointers.\n" -"///\n" "/// # Safety\n" -"///\n" -"/// The pointers must be valid and properly aligned.\n" +" ///\n" +" /// `s` must be a pointer to a NUL-terminated C string which is valid " +"and\n" +" /// not modified for the duration of this function call.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "// Safe because ...\n" +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"Absolute value of -3 according to C: {}\"" msgstr "" -#: src/unsafe-rust/unsafe-functions.md -msgid "\"a = {}, b = {}\"" +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"// SAFETY: We pass a pointer to a C string literal which is valid for\n" +" // the duration of the program.\n" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"String length: {}\"" +msgstr "\"Dize uzunluğu: {}\"" + +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "\"String\"" +msgstr "\"String\"" + +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" -"`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " -"create UB if the range is incorrect. `abs` is incorrect for a different " -"reason: it is an external function (FFI). Calling external functions is " -"usually only a problem when those functions do things with pointers which " -"might violate Rust's memory model, but in general any C function might have " -"undefined behaviour under any arbitrary circumstances." +"Rust used to consider all extern functions unsafe, but this changed in Rust " +"1.82 with `unsafe extern` blocks." msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md +msgid "" +"`abs` must be explicitly marked as `safe` because it is an external function " +"(FFI). Calling external functions is usually only a problem when those " +"functions do things with pointers which might violate Rust's memory model, " +"but in general any C function might have undefined behaviour under any " +"arbitrary circumstances." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" "The `\"C\"` in this example is the ABI; [other ABIs are available too]" "(https://doc.rust-lang.org/reference/items/external-blocks.html)." msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/extern-c.md msgid "" -"We wouldn't actually use pointers for a `swap` function - it can be done " -"safely with references." +"Note that there is no verification that the Rust function signature matches " +"that of the function definition -- that's up to you!" msgstr "" -#: src/unsafe-rust/unsafe-functions.md +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "Failing to uphold the safety requirements breaks memory safety!" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "// 8 bytes\n" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "\"{pk:?}\"" +msgstr "\"{pk:?}\"" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"Always include a safety comment for each `unsafe` block. It must explain why " +"the code is actually safe. This example is missing a safety comment and is " +"unsound." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"The second argument to `slice::from_raw_parts` is the number of _elements_, " +"not bytes! This example demonstrates unexpected behavior by reading past the " +"end of one array and into another." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"This is undefined behavior because we're reading past the end of the array " +"that the pointer was derived from." +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"`log_public_key` should be unsafe, because `pk_ptr` must meet certain " +"prerequisites to avoid undefined behaviour. A safe function which can cause " +"undefined behaviour is said to be `unsound`. What should its safety " +"documentation say?" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md msgid "" -"Note that unsafe code is allowed within an unsafe function without an " -"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. " -"Try adding it and see what happens. This will likely change in a future Rust " -"edition." +"The standard library contains many low-level unsafe functions. Prefer the " +"safe alternatives when possible!" +msgstr "" + +#: src/unsafe-rust/unsafe-functions/calling.md +msgid "" +"If you use an unsafe function as an optimization, make sure to add a " +"benchmark to demonstrate the gain." msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10606,7 +11663,7 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" "For example, the `zerocopy` crate has an unsafe trait that looks [something " -"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):" +"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.IntoBytes.html):" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10617,7 +11674,7 @@ msgid "" msgstr "" #: src/unsafe-rust/unsafe-traits.md -msgid "// Safe because u32 has a defined representation and no padding.\n" +msgid "// SAFETY: `u32` has a defined representation and no padding.\n" msgstr "" #: src/unsafe-rust/unsafe-traits.md @@ -10628,7 +11685,7 @@ msgstr "" #: src/unsafe-rust/unsafe-traits.md msgid "" -"The actual safety section for `AsBytes` is rather longer and more " +"The actual safety section for `IntoBytes` is rather longer and more " "complicated." msgstr "" @@ -10638,7 +11695,7 @@ msgstr "" #: src/unsafe-rust/exercise.md msgid "Safe FFI Wrapper" -msgstr "Güvenli FFI Sarıcı (Wrapper)" +msgstr "Emniyetli FFI Sarıcı (Wrapper)" #: src/unsafe-rust/exercise.md msgid "" @@ -10770,6 +11827,11 @@ msgid "" "functions and methods:" msgstr "" +#: src/unsafe-rust/exercise.md +msgid "// TODO: remove this when you're done with your implementation.\n" +msgstr "" +"// TODO: uyarlamanız (implementation) bittiğinde bu yorum satırını silin.\n" + #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" msgstr "" @@ -10818,12 +11880,12 @@ msgstr "" msgid "// Keep calling readdir until we get a NULL pointer back.\n" msgstr "" -#: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md +#: src/unsafe-rust/exercise.md msgid "// Call closedir as needed.\n" msgstr "" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\".\"" msgstr "" @@ -10840,7 +11902,7 @@ msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" msgstr "" #: src/unsafe-rust/solution.md -msgid "\"Could not open {:?}\"" +msgid "\"Could not open {path:?}\"" msgstr "" #: src/unsafe-rust/solution.md @@ -10860,7 +11922,9 @@ msgid "" msgstr "" #: src/unsafe-rust/solution.md -msgid "// SAFETY: self.dir is not NULL.\n" +msgid "" +"// Call closedir as needed.\n" +" // SAFETY: self.dir is never NULL.\n" msgstr "" #: src/unsafe-rust/solution.md @@ -10914,14 +11978,6 @@ msgid "" "existing code as needed)." msgstr "" -#: src/android.md -msgid "" -"We will attempt to call Rust from one of your own projects today. So try to " -"find a little corner of your code base where we can move some lines of code " -"to Rust. The fewer dependencies and \"exotic\" types the better. Something " -"that parses some raw bytes would be ideal." -msgstr "" - #: src/android.md msgid "" "The speaker may mention any of the following given the increased use of Rust " @@ -10931,25 +11987,25 @@ msgstr "" #: src/android.md msgid "" "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" -"over-http3-in-android.html)" +"over-http3-in-android.html)." msgstr "" #: src/android.md msgid "" "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" -"appendix/rutabaga_gfx.html)" +"appendix/rutabaga_gfx.html)." msgstr "" #: src/android.md msgid "" "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" -"rust-binder-v1-0-08ba9197f637@google.com/)" +"rust-binder-v1-0-08ba9197f637@google.com/)." msgstr "" #: src/android.md msgid "" "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" -"rust-in-android.html)" +"rust-in-android.html)." msgstr "" #: src/android/setup.md @@ -10964,6 +12020,14 @@ msgid "" "setup/start) for details." msgstr "" +#: src/android/setup.md +msgid "" +"The code on the following pages can be found in the [`src/android/` " +"directory](https://github.com/google/comprehensive-rust/tree/main/src/" +"android) of the course material. Please `git clone` the repository to follow " +"along." +msgstr "" + #: src/android/setup.md msgid "" "Cuttlefish is a reference Android device designed to work on generic Linux " @@ -11082,20 +12146,8 @@ msgstr "" #: src/android/build-rules.md msgid "" -"Soong has many similarities to Bazel, which is the open-source variant of " -"Blaze (used in google3)." -msgstr "" - -#: src/android/build-rules.md -msgid "" -"There is a plan to transition [Android](https://source.android.com/docs/" -"setup/build/bazel/introduction), [ChromeOS](https://chromium.googlesource." -"com/chromiumos/bazel/), and [Fuchsia](https://source.android.com/docs/setup/" -"build/bazel/introduction) to Bazel." -msgstr "" - -#: src/android/build-rules.md -msgid "Learning Bazel-like build rules is useful for all Rust OS developers." +"Soong has many similarities to [Bazel](https://bazel.build/), which is the " +"open-source variant of Blaze (used in google3)." msgstr "" #: src/android/build-rules.md @@ -11137,21 +12189,39 @@ msgstr "" msgid "/// Prints a greeting to standard output.\n" msgstr "" -#: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md -msgid "\"Hello from Rust!\"" -msgstr "\"Rust dilinden merhaba!\"" - +#: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md +msgid "\"Hello from Rust!\"" +msgstr "\"Rust dilinden merhaba!\"" + +#: src/android/build-rules/binary.md +msgid "You can now build, push, and run the binary:" +msgstr "" + +#: src/android/build-rules/binary.md +msgid "" +"```shell\n" +"m hello_rust\n" +"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust\" /data/local/tmp\n" +"adb shell /data/local/tmp/hello_rust\n" +"```" +msgstr "" + +#: src/android/build-rules/binary.md src/android/build-rules/library.md +msgid "" +"Go through the build steps and demonstrate them running in your emulator." +msgstr "" + #: src/android/build-rules/binary.md -msgid "You can now build, push, and run the binary:" +msgid "" +"Notice the extensive documentation comments? The Android build rules enforce " +"that all modules have documentation. Try removing it and see what error you " +"get." msgstr "" #: src/android/build-rules/binary.md msgid "" -"```shell\n" -"m hello_rust\n" -"adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust\" /data/local/tmp\n" -"adb shell /data/local/tmp/hello_rust\n" -"```" +"Stress that the Rust build rules look like the other Soong rules. This is on " +"purpose to make it as easy to use Rust as C++ or Java." msgstr "" #: src/android/build-rules/library.md @@ -11172,9 +12242,9 @@ msgstr "" #: src/android/build-rules/library.md msgid "" -"`libtextwrap`, which is a crate already vendored in [`external/rust/crates/`]" -"(https://cs.android.com/android/platform/superproject/+/master:external/rust/" -"crates/)." +"`libtextwrap`, which is a crate already vendored in [`external/rust/android-" +"crates-io/crates/`](https://cs.android.com/android/platform/superproject/" +"main/+/main:external/rust/android-crates-io/crates/)." msgstr "" #: src/android/build-rules/library.md @@ -11233,6 +12303,19 @@ msgid "" "```" msgstr "" +#: src/android/build-rules/library.md +msgid "" +"A Rust crate named `greetings` must be built by a rule called " +"`libgreetings`. Note how the Rust code uses the crate name, as is normal in " +"Rust." +msgstr "" + +#: src/android/build-rules/library.md +msgid "" +"Again, the build rules enforce that we add documentation comments to all " +"public items." +msgstr "" + #: src/android/aidl.md msgid "" "The [Android Interface Definition Language (AIDL)](https://developer.android." @@ -11247,6 +12330,16 @@ msgstr "" msgid "You can create new AIDL servers in Rust." msgstr "" +#: src/android/aidl.md +msgid "AIDL is what enables Android apps to interact with each other." +msgstr "" + +#: src/android/aidl.md +msgid "" +"Since Rust is supported as a first-class citizen in this ecosystem, Rust " +"services can be called by any other process on the phone." +msgstr "" + #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " @@ -11264,6 +12357,8 @@ msgstr "" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" msgstr "" @@ -11308,14 +12403,12 @@ 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." +msgid "Binder generates a trait for each interface definition." msgstr "" #: src/android/aidl/example-service/service-bindings.md -msgid "_Generated trait_:" -msgstr "_Generated trait_:" +msgid "_out/soong/.intermediates/.../com_example_birthdayservice.rs_:" +msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" @@ -11323,12 +12416,6 @@ msgid "" "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 " @@ -11351,9 +12438,14 @@ msgstr "" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/file-descriptor.md msgid "_birthday_service/src/lib.rs_:" msgstr "" +#: src/android/aidl/example-service/service.md +msgid "//! Implementation of the `IBirthdayService` AIDL interface.\n" +msgstr "" + #: src/android/aidl/example-service/service.md msgid "/// The `IBirthdayService` implementation.\n" msgstr "" @@ -11399,6 +12491,31 @@ msgid "" "why each of the segments is necessary." msgstr "" +#: src/android/aidl/example-service/service.md +msgid "" +"Note that `wishHappyBirthday` and other AIDL IPC methods take `&self` " +"(instead of `&mut self`)." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"This is necessary because binder responds to incoming requests on a thread " +"pool, allowing for multiple requests to be processed in parallel. This " +"requires that the service methods only get a shared reference to `self`." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"Any state that needs to be modified by the service will have to be put in " +"something like a `Mutex` to allow for safe mutation." +msgstr "" + +#: src/android/aidl/example-service/service.md +msgid "" +"The correct approach for managing service state depends heavily on the " +"details of your service." +msgstr "" + #: src/android/aidl/example-service/service.md msgid "" "TODO: What does the `binder::Interface` trait do? Are there methods to " @@ -11509,6 +12626,8 @@ msgstr "" #: src/android/aidl/example-service/client.md #: src/android/aidl/example-service/changing-implementation.md +#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md +#: src/android/aidl/types/file-descriptor.md msgid "_birthday_service/src/client.rs_:" msgstr "" @@ -11777,8 +12896,8 @@ msgstr "`Vec`" 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." +"`int[3][4]`). In the Java backend, fixed-size arrays are represented as " +"array types." msgstr "" #: src/android/aidl/types/arrays.md @@ -11793,14 +12912,8 @@ msgstr "" #: src/android/aidl/types/objects.md msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." -"aidl**:" -msgstr "" - -#: src/android/aidl/types/objects.md src/android/aidl/types/parcelables.md -#: src/android/aidl/types/file-descriptor.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl**:" +"_birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." +"aidl_:" msgstr "" #: src/android/aidl/types/objects.md @@ -11811,11 +12924,6 @@ msgstr "" 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 -msgid "**birthday_service/src/client.rs**:" -msgstr "" - #: src/android/aidl/types/objects.md msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" msgstr "" @@ -11844,8 +12952,7 @@ msgid "Binder for Rust supports sending parcelables directly:" msgstr "" #: src/android/aidl/types/parcelables.md -msgid "" -"**birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl**:" +msgid "_birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl_:" msgstr "" #: src/android/aidl/types/parcelables.md @@ -11882,10 +12989,6 @@ msgstr "" msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" msgstr "" -#: src/android/aidl/types/file-descriptor.md -msgid "**birthday_service/src/lib.rs**:" -msgstr "" - #: src/android/aidl/types/file-descriptor.md msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" @@ -11941,10 +13044,42 @@ msgstr "" msgid "\"leftpad_test\"" msgstr "" -#: src/android/testing.md src/android/interoperability/with-c/bindgen.md +#: src/android/testing.md src/android/interoperability/with-c/run-our-binary.md msgid "\"general-tests\"" msgstr "\"general-tests\"" +#: src/android/testing.md +msgid "\"libgoogletest_example\"" +msgstr "" + +#: src/android/testing.md +msgid "\"googletest_example\"" +msgstr "" + +#: src/android/testing.md +msgid "\"googletest.rs\"" +msgstr "\"googletest.rs\"" + +#: src/android/testing.md +msgid "\"libgoogletest_rust\"" +msgstr "" + +#: src/android/testing.md +msgid "\"libmockall_example\"" +msgstr "\"libmockall_example\"" + +#: src/android/testing.md +msgid "\"mockall_example\"" +msgstr "\"mockall_example\"" + +#: src/android/testing.md +msgid "\"mockall.rs\"" +msgstr "" + +#: src/android/testing.md +msgid "\"libmockall\"" +msgstr "\"libmockall\"" + #: src/android/testing.md msgid "_testing/src/lib.rs_:" msgstr "" @@ -12003,6 +13138,10 @@ msgid "" "assertions using _matchers_:" msgstr "" +#: src/android/testing/googletest.md +msgid "\"bar\"" +msgstr "" + #: src/android/testing/googletest.md msgid "\"baz\"" msgstr "" @@ -12032,7 +13171,13 @@ msgid "" msgstr "" #: src/android/testing/googletest.md -msgid "This just scratches the surface, there are many builtin matchers." +msgid "" +"This just scratches the surface, there are many builtin matchers. Consider " +"going through the first chapter of [\"Advanced testing for Rust " +"applications\"](https://rust-exercises.com/advanced-testing/), a self-guided " +"Rust course: it provides a guided introduction to the library, with " +"exercises to help you get comfortable with `googletest` macros, its matchers " +"and its overall philosophy." msgstr "" #: src/android/testing/googletest.md @@ -12175,7 +13320,7 @@ msgstr "" msgid "\"Something went wrong!\"" msgstr "" -#: src/android/logging.md src/android/interoperability/with-c/bindgen.md +#: src/android/logging.md src/android/interoperability/with-c/run-our-binary.md #: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" msgstr "" @@ -12194,6 +13339,12 @@ msgstr "" msgid "The logs show up in `adb logcat`:" msgstr "" +#: src/android/logging.md +msgid "" +"The logger implementation in `liblogger` is only needed in the final binary, " +"if you're logging from a library you only need the `log` facade crate." +msgstr "" + #: src/android/interoperability.md msgid "" "Rust has excellent support for interoperability with other languages. This " @@ -12214,6 +13365,19 @@ msgid "" "_foreign function interface_, also known as FFI." msgstr "" +#: src/android/interoperability.md +msgid "" +"This is a key ability of Rust: compiled code becomes indistinguishable from " +"compiled C or C++ code." +msgstr "" + +#: src/android/interoperability.md +msgid "" +"Technically, we say that Rust can be compiled to the same [ABI](https://en." +"wikipedia.org/wiki/Application_binary_interface) (application binary " +"interface) as C code." +msgstr "" + #: src/android/interoperability/with-c.md msgid "Interoperability with C" msgstr "" @@ -12234,8 +13398,8 @@ msgstr "" #: src/android/interoperability/with-c.md msgid "" -"We already saw this in the [Safe FFI Wrapper exercise](../../exercises/day-3/" -"safe-ffi-wrapper.md)." +"We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" +"exercise.md)." msgstr "" #: src/android/interoperability/with-c.md @@ -12248,76 +13412,91 @@ msgstr "" msgid "We will look at better options next." msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "Using Bindgen" +#: src/android/interoperability/with-c.md +msgid "" +"The [`\"C\"` part](https://doc.rust-lang.org/reference/items/external-blocks." +"html#abi) of the `extern` block tells Rust that `abs` can be called using " +"the C [ABI](https://en.wikipedia.org/wiki/Application_binary_interface) " +"(application binary interface)." msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c.md msgid "" -"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " -"tool can auto-generate bindings from a C header file." +"The `safe fn abs` part tells that Rust that `abs` is a safe function. By " +"default, extern functions are considered unsafe, but since `abs(x)` is valid " +"for any `x`, we can declare it safe." msgstr "" -#: src/android/interoperability/with-c/bindgen.md -msgid "First create a small C library:" +#: src/android/interoperability/with-c/c-library.md +msgid "Let's first create a small C library:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "_interoperability/bindgen/libbirthday.h_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "_interoperability/bindgen/libbirthday.c_:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "" msgstr "" +#: src/android/interoperability/with-c/c-library.md #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday.h\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "\"+--------------\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "\"| Happy Birthday %s!\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "\"| Congratulations with the %i years!\\n\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "Add this to your `Android.bp` file:" msgstr "" +#: src/android/interoperability/with-c/c-library.md #: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "_interoperability/bindgen/Android.bp_:" msgstr "" +#: src/android/interoperability/with-c/c-library.md #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/c-library.md msgid "\"libbirthday.c\"" msgstr "" +#: src/android/interoperability/with-c/bindgen.md +msgid "Using Bindgen" +msgstr "" + #: src/android/interoperability/with-c/bindgen.md msgid "" -"Create a wrapper header file for the library (not strictly needed in this " -"example):" +"The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " +"tool can auto-generate bindings from a C header file." msgstr "" #: src/android/interoperability/with-c/bindgen.md -msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" +msgid "" +"Create a wrapper header file for the library (not strictly needed in this " +"example):" msgstr "" #: src/android/interoperability/with-c/bindgen.md -msgid "You can now auto-generate the bindings:" +msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" msgstr "" #: src/android/interoperability/with-c/bindgen.md @@ -12357,11 +13536,30 @@ msgid "//! Bindgen demo.\n" msgstr "" #: src/android/interoperability/with-c/bindgen.md -msgid "// SAFETY: `print_card` is safe to call with a valid `card` pointer.\n" +msgid "" +"// SAFETY: The pointer we pass is valid because it came from a Rust\n" +" // reference, and the `name` it contains refers to `name` above which " +"also\n" +" // remains valid. `print_card` doesn't store either pointer to use " +"later\n" +" // after it returns.\n" +msgstr "" + +#: src/android/interoperability/with-c/bindgen.md +msgid "" +"The Android build rules will automatically call `bindgen` for you behind the " +"scenes." msgstr "" #: src/android/interoperability/with-c/bindgen.md msgid "" +"Notice that the Rust code in `main` is still hard to write. It is good " +"practice to encapsulate the output of `bindgen` in a Rust library which " +"exposes a safe interface to caller." +msgstr "" + +#: src/android/interoperability/with-c/run-our-binary.md +msgid "" "```shell\n" "m print_birthday_card\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" @@ -12370,78 +13568,90 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\"libbirthday_bindgen_test\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\":libbirthday_bindgen\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "\"none\"" msgstr "" -#: src/android/interoperability/with-c/bindgen.md +#: src/android/interoperability/with-c/run-our-binary.md msgid "// Generated file, skip linting\n" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "Calling Rust" -msgstr "" - -#: src/android/interoperability/with-c/rust.md -msgid "Exporting Rust functions and types to C is easy:" +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"Exporting Rust functions and types to C is easy. Here's a simple Rust " +"library:" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "_interoperability/rust/libanalyze/analyze.rs_" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "//! Rust FFI demo.\n" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "/// Analyze the numbers.\n" +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"/// Analyze the numbers.\n" +"// SAFETY: There is no other global function of this name.\n" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\"x ({x}) is smallest!\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\"y ({y}) is probably larger than x ({x})\"" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "_interoperability/rust/libanalyze/analyze.h_" -msgstr "" - -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "" +#: src/android/interoperability/with-c/rust-library.md #: src/android/interoperability/with-c/rust.md msgid "\"libanalyze_ffi\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\"analyze_ffi\"" msgstr "" -#: src/android/interoperability/with-c/rust.md +#: src/android/interoperability/with-c/rust-library.md msgid "\"analyze.rs\"" msgstr "" +#: src/android/interoperability/with-c/rust-library.md +msgid "" +"`#[unsafe(no_mangle)]` disables Rust's usual name mangling, so the exported " +"symbol will just be the name of the function. You can also use " +"`#[unsafe(export_name = \"some_name\")]` to specify whatever name you want." +msgstr "" + +#: src/android/interoperability/with-c/rust.md +msgid "Calling Rust" +msgstr "" + #: src/android/interoperability/with-c/rust.md msgid "We can now call this from a C binary:" msgstr "" +#: src/android/interoperability/with-c/rust.md +msgid "_interoperability/rust/libanalyze/analyze.h_" +msgstr "" + #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/main.c_" msgstr "" @@ -12472,13 +13682,6 @@ msgid "" "```" msgstr "" -#: src/android/interoperability/with-c/rust.md -msgid "" -"`#[no_mangle]` disables Rust's usual name mangling, so the exported symbol " -"will just be the name of the function. You can also use `#[export_name = " -"\"some_name\"]` to specify whatever name you want." -msgstr "" - #: src/android/interoperability/cpp.md msgid "" "The [CXX crate](https://cxx.rs/) makes it possible to do safe " @@ -12788,115 +13991,115 @@ msgid "" "semantics, so a `std::string` can't be passed by value to Rust." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md msgid "Building in Android" msgstr "Android'de İnşa Etme (Build)" -#: src/android/interoperability/cpp/android-build-cpp.md +#: src/android/interoperability/cpp/android-cpp-genrules.md msgid "" -"Create a `cc_library_static` to build the C++ library, including the CXX " -"generated header and source file." +"Create two genrules: One to generate the CXX header, and one to generate the " +"CXX source file. These are then used as inputs to the `cc_library_static`." msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -#: src/android/interoperability/cpp/android-build-rust.md -msgid "\"libcxx_test_cpp\"" +#: src/android/interoperability/cpp/android-cpp-genrules.md +msgid "" +"// Generate a C++ header containing the C++ bindings\n" +"// to the Rust exported functions in lib.rs.\n" msgstr "" +#: src/android/interoperability/cpp/android-cpp-genrules.md #: src/android/interoperability/cpp/android-build-cpp.md -msgid "\"cxx_test.cpp\"" +msgid "\"libcxx_test_bridge_header\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "\"cxx-bridge-header\"" +#: src/android/interoperability/cpp/android-cpp-genrules.md +msgid "\"cxxbridge\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"libcxx_test_bridge_header\"" +msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"libcxx_test_bridge_code\"" +#: src/android/interoperability/cpp/android-build-rust.md +msgid "\"lib.rs\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " -"the dependencies for the CXX-generated C++ bindings. We'll show how these " -"are setup on the next slide." +#: src/android/interoperability/cpp/android-cpp-genrules.md +msgid "\"lib.rs.h\"" msgstr "" -#: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Note that you also need to depend on the `cxx-bridge-header` library in " -"order to pull in common CXX definitions." +#: src/android/interoperability/cpp/android-cpp-genrules.md +msgid "// Generate the C++ code that Rust calls into.\n" msgstr "" +#: src/android/interoperability/cpp/android-cpp-genrules.md #: src/android/interoperability/cpp/android-build-cpp.md -msgid "" -"Full docs for using CXX in Android can be found in [the Android docs]" -"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" -"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " -"that link with the class so that students know where they can find these " -"instructions again in the future." +msgid "\"libcxx_test_bridge_code\"" msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "" -"Create two genrules: One to generate the CXX header, and one to generate the " -"CXX source file. These are then used as inputs to the `cc_library_static`." +msgid "\"$(location cxxbridge) $(in) > $(out)\"" msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "" -"// Generate a C++ header containing the C++ bindings\n" -"// to the Rust exported functions in lib.rs.\n" +msgid "\"lib.rs.cc\"" msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"cxxbridge\"" +msgid "" +"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " +"bridge module. It is included in Android and available as a Soong tool." msgstr "" #: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" +msgid "" +"By convention, if your Rust source file is `lib.rs` your header file will be " +"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " +"convention isn't enforced, though." +msgstr "" + +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Create a `cc_library_static` to build the C++ library, including the CXX " +"generated header and source file." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md -msgid "\"lib.rs\"" -msgstr "" - -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"lib.rs.h\"" +msgid "\"libcxx_test_cpp\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "// Generate the C++ code that Rust calls into.\n" +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"cxx_test.cpp\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"$(location cxxbridge) $(in) > $(out)\"" +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "\"cxx-bridge-header\"" msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md -msgid "\"lib.rs.cc\"" +#: src/android/interoperability/cpp/android-build-cpp.md +msgid "" +"Point out that `libcxx_test_bridge_header` and `libcxx_test_bridge_code` are " +"the dependencies for the CXX-generated C++ bindings. We'll show how these " +"are setup on the next slide." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"The `cxxbridge` tool is a standalone tool that generates the C++ side of the " -"bridge module. It is included in Android and available as a Soong tool." +"Note that you also need to depend on the `cxx-bridge-header` library in " +"order to pull in common CXX definitions." msgstr "" -#: src/android/interoperability/cpp/android-cpp-genrules.md +#: src/android/interoperability/cpp/android-build-cpp.md msgid "" -"By convention, if your Rust source file is `lib.rs` your header file will be " -"named `lib.rs.h` and your source file will be named `lib.rs.cc`. This naming " -"convention isn't enforced, though." +"Full docs for using CXX in Android can be found in [the Android docs]" +"(https://source.android.com/docs/setup/build/rust/building-rust-modules/" +"android-rust-patterns#rust-cpp-interop-using-cxx). You may want to share " +"that link with the class so that students know where they can find these " +"instructions again in the future." msgstr "" #: src/android/interoperability/cpp/android-build-rust.md @@ -12936,7 +14139,9 @@ msgid "//! Rust <-> Java FFI demo.\n" msgstr "" #: src/android/interoperability/java.md -msgid "/// HelloWorld::hello method implementation.\n" +msgid "" +"/// HelloWorld::hello method implementation.\n" +"// SAFETY: There is no other global function of this name.\n" msgstr "" #: src/android/interoperability/java.md @@ -12987,24 +14192,17 @@ msgstr "\"HelloWorld\"" msgid "Finally, you can build, sync, and run the binary:" msgstr "" -#: src/exercises/android/morning.md +#: src/android/interoperability/java.md msgid "" -"This is a group exercise: We will look at one of the projects you work with " -"and try to integrate some Rust into it. Some suggestions:" -msgstr "" - -#: src/exercises/android/morning.md -msgid "Call your AIDL service with a client written in Rust." +"The `unsafe(no_mangle)` attribute instructs Rust to emit the " +"`Java_HelloWorld_hello` symbol exactly as written. This is important so that " +"Java can recognize the symbol as a `hello` method on the `HelloWorld` class." msgstr "" -#: src/exercises/android/morning.md -msgid "Move a function from your project to Rust and call it." -msgstr "" - -#: src/exercises/android/morning.md +#: src/android/interoperability/java.md msgid "" -"No solution is provided here since this is open-ended: it relies on someone " -"in the class having a piece of code which you can turn in to Rust on the fly." +"By default, Rust will mangle (rename) symbols so that a binary can link in " +"two versions of the same Rust crate." msgstr "" #: src/chromium.md @@ -13277,25 +14475,38 @@ msgstr "" #: src/chromium/policy.md msgid "" -"Chromium does not yet allow first-party Rust except in rare cases as " -"approved by Chromium's [Area Tech Leads](https://source.chromium.org/" -"chromium/chromium/src/+/main:ATL_OWNERS)." +"Chromium's Rust policy can be found [here](https://source.chromium.org/" +"chromium/chromium/src/+/main:docs/rust.md;l=22). Rust can be used for both " +"first-party and third-party code." +msgstr "" + +#: src/chromium/policy.md +msgid "Using Rust for pure first-party code looks like this:" msgstr "" #: src/chromium/policy.md msgid "" -"Chromium's policy on third party libraries is outlined [here](https://" -"chromium.googlesource.com/chromium/src/+/main/docs/adding_to_third_party." -"md#rust) - Rust is allowed for third party libraries under various " -"circumstances, including if they're the best option for performance or for " -"security." +"```bob\n" +"\"C++\" Rust\n" +".- - - - - - - - - -. .- - - - - - - - - - -.\n" +": : : :\n" +": Existing Chromium : : Chromium Rust :\n" +": \"C++\" : : code :\n" +": +---------------+ : : +----------------+ :\n" +": | | : : | | :\n" +": | o-----+-+-----------+-+-> | :\n" +": | | : Language : | | :\n" +": +---------------+ : boundary : +----------------+ :\n" +": : : :\n" +"`- - - - - - - - - -' `- - - - - - - - - - -'\n" +"```" msgstr "" #: src/chromium/policy.md msgid "" -"Very few Rust libraries directly expose a C/C++ API, so that means that " -"nearly all such libraries will require a small amount of first-party glue " -"code." +"The third-party case is also common. It's likely that you'll also need a " +"small amount of first-party glue code, because very few Rust libraries " +"directly expose a C/C++ API." msgstr "" #: src/chromium/policy.md @@ -13327,12 +14538,8 @@ msgstr "" #: src/chromium/policy.md msgid "" -"First-party Rust glue code for a particular third-party crate should " -"normally be kept in `third_party/rust///wrapper`." -msgstr "" - -#: src/chromium/policy.md -msgid "Because of this, today's course will be heavily focused on:" +"The scenario of using a third-party crate is the more complex one, so " +"today's course will focus on:" msgstr "" #: src/chromium/policy.md @@ -13340,11 +14547,9 @@ msgid "Bringing in third-party Rust libraries (\"crates\")" msgstr "" #: src/chromium/policy.md -msgid "Writing glue code to be able to use those crates from Chromium C++." -msgstr "" - -#: src/chromium/policy.md -msgid "If this policy changes over time, the course will evolve to keep up." +msgid "" +"Writing glue code to be able to use those crates from Chromium C++. (The " +"same techniques are used when working with first-party Rust code)." msgstr "" #: src/chromium/build-rules.md @@ -13523,7 +14728,7 @@ msgstr "" #: src/chromium/build-rules/vscode.md msgid "" -"Demo **type annotations** (there are quote a few nice examples in the " +"Demo **type annotations** (there are quite a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" @@ -13544,6 +14749,12 @@ msgid "" "containing:" msgstr "" +#: src/exercises/chromium/build-rules.md src/bare-metal/aps/inline-assembly.md +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md +msgid "// SAFETY: There is no other global function of this name.\n" +msgstr "" + #: src/exercises/chromium/build-rules.md msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " @@ -13587,8 +14798,8 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"Information about [`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/" -"abi.html#the-no_mangle-attribute)" +"Information about [`#[unsafe(no_mangle)]`](https://doc.rust-lang.org/beta/" +"reference/abi.html#the-no_mangle-attribute)" msgstr "" #: src/exercises/chromium/build-rules.md @@ -13619,9 +14830,9 @@ msgstr "" #: src/exercises/chromium/build-rules.md msgid "" -"`allow_unsafe = true` is required here because `#[no_mangle]` might allow " -"Rust to generate two functions with the same name, and Rust can no longer " -"guarantee that the right one is called." +"`allow_unsafe = true` is required here because `#[unsafe(no_mangle)]` might " +"allow Rust to generate two functions with the same name, and Rust can no " +"longer guarantee that the right one is called." msgstr "" #: src/exercises/chromium/build-rules.md @@ -14223,7 +15434,7 @@ msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " -"`#[no_mangle]`. This is now just a standard Rust function." +"`#[unsafe(no_mangle)]`. This is now just a standard Rust function." msgstr "" #: src/exercises/chromium/interoperability-with-cpp.md @@ -15091,7 +16302,7 @@ msgstr "" msgid "" "For the microcontroller part of the course we will use the [BBC micro:bit]" "(https://microbit.org/) v2 as an example. It's a [development board](https://" -"tech.microbit.org/hardware/) based on the Nordic nRF51822 microcontroller " +"tech.microbit.org/hardware/) based on the Nordic nRF52833 microcontroller " "with some LEDs and buttons, an I2C-connected accelerometer and compass, and " "an on-board SWD debugger." msgstr "" @@ -15106,6 +16317,14 @@ msgid "" "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" +#: src/bare-metal.md +msgid "" +"You should see \"NXP ARM mbed\" in the output of `lsusb` if the device is " +"available. If you are using a Linux environment on a Chromebook, you will " +"need to share the USB device with Linux, via `chrome://os-settings/crostini/" +"sharedUsbDevices`." +msgstr "" + #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" msgstr "" @@ -15134,6 +16353,14 @@ msgstr "" msgid "`Display`, `Debug`, `write!`..." msgstr "" +#: src/bare-metal/no_std.md +msgid "`Iterator`" +msgstr "`Iterator`" + +#: src/bare-metal/no_std.md +msgid "`Error`" +msgstr "" + #: src/bare-metal/no_std.md msgid "`panic!`, `assert_eq!`..." msgstr "" @@ -15166,10 +16393,6 @@ msgstr "" msgid "`String`, `CString`, `format!`" msgstr "" -#: src/bare-metal/no_std.md -msgid "`Error`" -msgstr "" - #: src/bare-metal/no_std.md msgid "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" msgstr "" @@ -15246,8 +16469,7 @@ msgid "" msgstr "" #: src/bare-metal/alloc.md -msgid "" -"// Safe because `HEAP` is only used here and `entry` is only called once.\n" +msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" msgstr "" #: src/bare-metal/alloc.md @@ -15264,9 +16486,9 @@ msgstr "" #: src/bare-metal/alloc.md msgid "" -"`buddy_system_allocator` is a third-party crate implementing a basic buddy " -"system allocator. Other crates are available, or you can write your own or " -"hook into your existing allocator." +"`buddy_system_allocator` is a crate implementing a basic buddy system " +"allocator. Other crates are available, or you can write your own or hook " +"into your existing allocator." msgstr "" #: src/bare-metal/alloc.md @@ -15340,8 +16562,8 @@ msgstr "" #: src/bare-metal/microcontrollers/mmio.md msgid "" -"// Safe because the pointers are to valid peripheral control registers, and\n" -" // no aliases exist.\n" +"// SAFETY: The pointers are to valid peripheral control registers, and no\n" +" // aliases exist.\n" msgstr "" #: src/bare-metal/microcontrollers/mmio.md @@ -15502,7 +16724,7 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " -"number of traits covering common microcontroller peripherals." +"number of traits covering common microcontroller peripherals:" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -15510,30 +16732,37 @@ msgid "GPIO" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "ADC" +msgid "PWM" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "I2C, SPI, UART, CAN" +msgid "Delay timers" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "RNG" +msgid "I2C and SPI buses and devices" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Timers" +msgid "" +"Similar traits for byte streams (e.g. UARTs), CAN buses and RNGs and broken " +"out into [`embedded-io`](https://crates.io/crates/embedded-io), [`embedded-" +"can`](https://crates.io/crates/embedded-can) and [`rand_core`](https://" +"crates.io/crates/rand_core) respectively." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md -msgid "Watchdogs" +msgid "" +"Other crates then implement [drivers](https://github.com/rust-embedded/" +"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " +"accelerometer driver might need an I2C or SPI device instance." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"Other crates then implement [drivers](https://github.com/rust-embedded/" -"awesome-embedded-rust#driver-crates) in terms of these traits, e.g. an " -"accelerometer driver might need an I2C or SPI bus implementation." +"The traits cover using the peripherals but not initialising or configuring " +"them, as initialisation and configuration is usually highly platform-" +"specific." msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md @@ -15544,8 +16773,15 @@ msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" -"There is work in progress on an `async` version of `embedded-hal`, but it " -"isn't stable yet." +"[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " +"async versions of the traits." +msgstr "" + +#: src/bare-metal/microcontrollers/embedded-hal.md +msgid "" +"[`embedded-hal-nb`](https://crates.io/crates/embedded-hal-nb) provides " +"another approach to non-blocking I/O, based on the [`nb`](https://crates.io/" +"crates/nb) crate." msgstr "" #: src/bare-metal/microcontrollers/probe-rs.md @@ -15647,12 +16883,12 @@ msgid "[RTIC](https://rtic.rs/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "\"Real-Time Interrupt-driven Concurrency\"" +msgid "\"Real-Time Interrupt-driven Concurrency\"." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" -"Shared resource management, message passing, task scheduling, timer queue" +"Shared resource management, message passing, task scheduling, timer queue." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15660,7 +16896,7 @@ msgid "[Embassy](https://embassy.dev/)" msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "`async` executors with priorities, timers, networking, USB" +msgid "`async` executors with priorities, timers, networking, USB." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15670,7 +16906,7 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " -"support" +"support." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15680,11 +16916,11 @@ msgstr "" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Microkernel RTOS from Oxide Computer Company with memory protection, " -"unprivileged drivers, IPC" +"unprivileged drivers, IPC." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md -msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)" +msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)." msgstr "" #: src/bare-metal/microcontrollers/other-projects.md @@ -15728,7 +16964,7 @@ msgid "" "serial port." msgstr "" -#: src/exercises/bare-metal/morning.md src/exercises/concurrency/morning.md +#: src/exercises/bare-metal/morning.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "morning.md) provided." @@ -15765,9 +17001,9 @@ msgstr "" #: src/exercises/bare-metal/compass.md msgid "" -"The LSM303AGR driver needs something implementing the `embedded_hal::" -"blocking::i2c::WriteRead` trait. The [`microbit::hal::Twim`](https://docs.rs/" -"microbit-v2/latest/microbit/hal/struct.Twim.html) struct implements this." +"The LSM303AGR driver needs something implementing the `embedded_hal::i2c::" +"I2c` trait. The [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" +"microbit/hal/struct.Twim.html) struct implements this." msgstr "" #: src/exercises/bare-metal/compass.md @@ -15872,16 +17108,31 @@ msgstr "" #: src/bare-metal/aps.md msgid "" "So far we've talked about microcontrollers, such as the Arm Cortex-M series. " -"Now let's try writing something for Cortex-A. For simplicity we'll just work " -"with QEMU's aarch64 ['virt'](https://qemu-project.gitlab.io/qemu/system/arm/" -"virt.html) board." +"These are typically small systems with very limited resources." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"Larger systems with more resources are typically called application " +"processors, built around processors such as the ARM Cortex-A or Intel Atom." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"For simplicity we'll just work with QEMU's aarch64 ['virt'](https://qemu-" +"project.gitlab.io/qemu/system/arm/virt.html) board." msgstr "" #: src/bare-metal/aps.md msgid "" "Broadly speaking, microcontrollers don't have an MMU or multiple levels of " -"privilege (exception levels on Arm CPUs, rings on x86), while application " -"processors do." +"privilege (exception levels on Arm CPUs, rings on x86)." +msgstr "" + +#: src/bare-metal/aps.md +msgid "" +"Application processors have more resources, and often run an operating " +"system, instead of directly executing the target application on startup." msgstr "" #: src/bare-metal/aps.md @@ -15891,6 +17142,12 @@ msgid "" "hardware, but is designed purely for virtual machines." msgstr "" +#: src/bare-metal/aps.md +msgid "" +"We will still address this board as bare-metal, as if we were writing an " +"operating system." +msgstr "" + #: src/bare-metal/aps/entry-point.md msgid "" "Before we can start running Rust code, we need to do some initialisation." @@ -15899,13 +17156,28 @@ msgstr "" #: src/bare-metal/aps/entry-point.md msgid "" "```armasm\n" +"/**\n" +" * This is a generic entry point for an image. It carries out the\n" +" * operations required to prepare the loaded image to be run.\n" +" * Specifically, it\n" +" *\n" +" * - sets up the MMU with an identity map of virtual to physical\n" +" * addresses, and enables caching\n" +" * - enables floating point\n" +" * - zeroes the bss section using registers x25 and above\n" +" * - prepares the stack, pointing to a section within the image\n" +" * - sets up the exception vector\n" +" * - branches to the Rust `main` function\n" +" *\n" +" * It preserves x0-x3 for the Rust entry point, as these may contain\n" +" * boot parameters.\n" +" */\n" ".section .init.entry, \"ax\"\n" ".global entry\n" "entry:\n" " /*\n" -" * Load and apply the memory management configuration, ready to enable " -"MMU and\n" -" * caches.\n" +" * Load and apply the memory management configuration, ready to\n" +" * enable MMU and caches.\n" " */\n" " adrp x30, idmap\n" " msr ttbr0_el1, x30\n" @@ -15923,9 +17195,9 @@ msgid "" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" -" * Ensure everything before this point has completed, then invalidate " -"any\n" -" * potentially stale local TLB entries before they start being used.\n" +" * Ensure everything before this point has completed, then\n" +" * invalidate any potentially stale local TLB entries before they\n" +" * start being used.\n" " */\n" " isb\n" " tlbi vmalle1\n" @@ -15934,9 +17206,8 @@ msgid "" " isb\n" "\n" " /*\n" -" * Configure sctlr_el1 to enable MMU and cache and don't proceed until " -"this\n" -" * has completed.\n" +" * Configure sctlr_el1 to enable MMU and cache and don't proceed\n" +" * until this has completed.\n" " */\n" " msr sctlr_el1, x30\n" " isb\n" @@ -15972,6 +17243,13 @@ msgid "" "```" msgstr "" +#: src/bare-metal/aps/entry-point.md +msgid "" +"This code is in `src/bare-metal/aps/examples/src/entry.S`. It's not " +"necessary to understand this in detail -- the takeaway is that typically " +"some low-level setup is needed to meet Rust's expectations of the system." +msgstr "" + #: src/bare-metal/aps/entry-point.md msgid "" "This is the same as it would be for C: initialising the processor state, " @@ -16052,8 +17330,8 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"// Safe because this only uses the declared registers and doesn't do\n" -" // anything with memory.\n" +"// SAFETY: this only uses the declared registers and doesn't do anything\n" +" // with memory.\n" msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -16115,8 +17393,16 @@ msgstr "" #: src/bare-metal/aps/inline-assembly.md msgid "" -"This `main` function needs to be `#[no_mangle]` and `extern \"C\"` because " -"it is called from our entry point in `entry.S`." +"This `main` function needs to be `#[unsafe(no_mangle)]` and `extern \"C\"` " +"because it is called from our entry point in `entry.S`." +msgstr "" + +#: src/bare-metal/aps/inline-assembly.md +msgid "" +"Just `#[no_mangle]` would be sufficient but [RFC3325](https://rust-lang." +"github.io/rfcs/3325-unsafe-attributes.html) uses this notation to draw " +"reviewer attention to attributes which might cause undefined behavior if " +"used incorrectly." msgstr "" #: src/bare-metal/aps/inline-assembly.md @@ -16140,19 +17426,29 @@ msgid "Volatile memory access for MMIO" msgstr "" #: src/bare-metal/aps/mmio.md -msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." +msgid "" +"Use [`pointer::read_volatile`](https://doc.rust-lang.org/stable/core/" +"primitive.pointer.html#method.read_volatile) and [`pointer::write_volatile`]" +"(https://doc.rust-lang.org/stable/core/primitive.pointer.html#method." +"write_volatile)." msgstr "" #: src/bare-metal/aps/mmio.md -msgid "Never hold a reference." +msgid "" +"Never hold a reference to a location being accessed with these methods. Rust " +"may read from (or write to, for `&mut`) a reference at any time." msgstr "" #: src/bare-metal/aps/mmio.md msgid "" -"`addr_of!` lets you get fields of structs without creating an intermediate " +"Use `&raw` to get fields of structs without creating an intermediate " "reference." msgstr "" +#: src/bare-metal/aps/mmio.md +msgid "// SAFETY: Some device is mapped at this address.\n" +msgstr "" + #: src/bare-metal/aps/mmio.md msgid "" "Volatile access: read or write operations may have side-effects, so prevent " @@ -16173,10 +17469,14 @@ msgid "" "dereference it." msgstr "" +#: src/bare-metal/aps/mmio.md +msgid "Use `&raw` to get struct field pointers from a pointer to the struct." +msgstr "" + #: src/bare-metal/aps/mmio.md msgid "" -"Use the `addr_of!` macro to get struct field pointers from a pointer to the " -"struct." +"For compatibility with old versions of Rust you can use the [`addr_of!`]" +"(https://doc.rust-lang.org/stable/core/ptr/macro.addr_of.html) macro instead." msgstr "" #: src/bare-metal/aps/uart.md @@ -16193,7 +17493,7 @@ msgstr "" msgid "/// Minimal driver for a PL011 UART.\n" msgstr "" -#: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/uart.md msgid "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" " /// given base address.\n" @@ -16208,24 +17508,28 @@ msgid "" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.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/bare-metal/aps/safemmio/driver.md msgid "// Wait until there is room in the TX buffer.\n" msgstr "" #: src/bare-metal/aps/uart.md msgid "" -"// Safe because we know that the base address points to the control\n" +"// SAFETY: We know that the base address points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// Write to the TX buffer.\n" msgstr "" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "// Wait until the UART is no longer busy.\n" msgstr "" @@ -16264,9 +17568,8 @@ msgid "" msgstr "" #: 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" +"// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" @@ -16278,6 +17581,47 @@ msgstr "" #: src/bare-metal/aps/uart/traits.md msgid "" +"`Send` is an auto-trait, but not implemented automatically because it is not " +"implemented for pointers." +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/logging/using.md +msgid "Using it" +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" +"Let's write a small program using our driver to write to the serial console." +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Base address of the primary PL011 UART.\n" +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "" +"// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" +" // nothing else accesses that address range.\n" +msgstr "" + +#: src/bare-metal/aps/uart/using.md src/bare-metal/aps/safemmio/using.md +#: src/bare-metal/aps/logging/using.md src/bare-metal/aps/aarch64-rt.md +msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" +"As in the [inline assembly](../inline-assembly.md) example, this `main` " +"function is called from our entry point code in `entry.S`. See the speaker " +"notes there for details." +msgstr "" + +#: src/bare-metal/aps/uart/using.md +msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" @@ -16327,6 +17671,10 @@ msgstr "" msgid "RSR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "4" +msgstr "4" + #: src/bare-metal/aps/better-uart.md msgid "0x18" msgstr "" @@ -16347,6 +17695,10 @@ msgstr "" msgid "ILPR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "8" +msgstr "8" + #: src/bare-metal/aps/better-uart.md msgid "0x24" msgstr "" @@ -16367,6 +17719,10 @@ msgstr "" msgid "FBRD" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "6" +msgstr "6" + #: src/bare-metal/aps/better-uart.md msgid "0x2c" msgstr "" @@ -16435,6 +17791,10 @@ msgstr "" msgid "DMACR" msgstr "" +#: src/bare-metal/aps/better-uart.md +msgid "3" +msgstr "3" + #: src/bare-metal/aps/better-uart.md msgid "There are also some ID registers which have been omitted for brevity." msgstr "" @@ -16487,8 +17847,8 @@ msgstr "" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" -"The `bitflags!` macro creates a newtype something like `Flags(u16)`, along " -"with a bunch of method implementations to get and set flags." +"The `bitflags!` macro creates a newtype something like `struct Flags(u16)`, " +"along with a bunch of method implementations to get and set flags." msgstr "" #: src/bare-metal/aps/better-uart/registers.md @@ -16510,87 +17870,227 @@ msgid "" msgstr "" #: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "Now let's use the new `Registers` struct in our driver." msgstr "" #: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/driver.md msgid "/// Driver for a PL011 UART.\n" msgstr "" #: 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" +"/// Constructs a new instance of the UART driver for a PL011 device with " +"the\n" +" /// given set of registers.\n" +" ///\n" +" /// # Safety\n" +" ///\n" +" /// The given pointer must point to the 8 MMIO control registers of a " +"PL011\n" +" /// device, which must be mapped into the address space of the process " +"as\n" +" /// device memory and not have any other aliases.\n" +msgstr "" + +#: src/bare-metal/aps/better-uart/driver.md +msgid "" +"// SAFETY: We know that self.registers points to the control registers\n" +" // of a PL011 device which is appropriately mapped.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md +#: src/bare-metal/aps/safemmio/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 +msgid "" +"// SAFETY: 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/bare-metal/aps/safemmio/driver.md msgid "// TODO: Check for error conditions in bits 8-11.\n" msgstr "" #: src/bare-metal/aps/better-uart/driver.md msgid "" -"Note the use of `addr_of!` / `addr_of_mut!` to get pointers to individual " +"Note the use of `&raw const` / `&raw mut` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -msgid "Using it" +#: src/bare-metal/aps/better-uart/driver.md +msgid "" +"The example isn't included in the slides because it is very similar to the " +"`safe-mmio` example which comes next. You can run it in QEMU with `make " +"qemu` under `src/bare-metal/aps/examples` if you need to." msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/registers.md msgid "" -"Let's write a small program using our driver to write to the serial console, " -"and echo incoming bytes." +"The [`safe-mmio`](https://crates.io/crates/safe-mmio) crate provides types " +"to wrap registers which can be read or written safely." msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "/// Base address of the primary PL011 UART.\n" +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can't read" msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -#: src/exercises/bare-metal/solutions-afternoon.md +#: src/bare-metal/aps/safemmio/registers.md +msgid "Read has no side-effects" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Read has side-effects" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can't write" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md msgid "" -"// Safe because `PL011_BASE_ADDRESS` is the base address of a PL011 device,\n" -" // and nothing else accesses that address range.\n" +"[`ReadPure`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadPure.html)" msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md -msgid "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadOnly`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadOnly.html)" msgstr "" -#: src/bare-metal/aps/better-uart/using.md -msgid "b'\\r'" +#: src/bare-metal/aps/safemmio/registers.md +msgid "Can write" msgstr "" -#: src/bare-metal/aps/better-uart/using.md src/async/pitfalls/cancellation.md -msgid "b'\\n'" +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`WriteOnly`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"WriteOnly.html)" msgstr "" -#: src/bare-metal/aps/better-uart/using.md -msgid "b'q'" +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadPureWrite`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadPureWrite.html)" msgstr "" -#: src/bare-metal/aps/better-uart/using.md -msgid "\"Bye!\"" +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"[`ReadWrite`](https://docs.rs/safe-mmio/latest/safe_mmio/fields/struct." +"ReadWrite.html)" +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "Reading `dr` has a side effect: it pops a byte from the receive FIFO." msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/registers.md msgid "" -"As in the [inline assembly](../inline-assembly.md) example, this `main` " -"function is called from our entry point code in `entry.S`. See the speaker " -"notes there for details." +"Reading `rsr` (and other registers) has no side-effects. It is a 'pure' read." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"There are a number of different crates providing safe abstractions around " +"MMIO operations; we recommend the `safe-mmio` crate." +msgstr "" + +#: src/bare-metal/aps/safemmio/registers.md +msgid "" +"The difference between `ReadPure` or `ReadOnly` (and likewise between " +"`ReadPureWrite` and `ReadWrite`) is whether reading a register can have side-" +"effects which change the state of the device. E.g. reading the data register " +"pops a byte from the receive FIFO. `ReadPure` means that reads have no side-" +"effects, they are purely reading data." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"/// Constructs a new instance of the UART driver for a PL011 device with " +"the\n" +" /// given set of registers.\n" +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "The driver no longer needs any unsafe code!" +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`UniqueMmioPointer` is a wrapper around a raw pointer to an MMIO device or " +"register. The caller of `UniqueMmioPointer::new` promises that it is valid " +"and unique for the given lifetime, so it can provide safe methods to read " +"and write fields." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"Note that `Uart::new` is now safe; `UniqueMmioPointer::new` is unsafe " +"instead." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"These MMIO accesses are generally a wrapper around `read_volatile` and " +"`write_volatile`, though on aarch64 they are instead implemented in assembly " +"to work around a bug where the compiler can emit instructions that prevent " +"MMIO virtualisation." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"The `field!` and `field_shared!` macros internally use `&raw mut` and `&raw " +"const` to get pointers to individual fields without creating an intermediate " +"reference, which would be unsound." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`field!` needs a mutable reference to a `UniqueMmioPointer`, and returns a " +"`UniqueMmioPointer` which allows reads with side effects and writes." +msgstr "" + +#: src/bare-metal/aps/safemmio/driver.md +msgid "" +"`field_shared!` works with a shared reference to either a " +"`UniqueMmioPointer` or a `SharedMmioPointer`. It returns a " +"`SharedMmioPointer` which only allows pure reads." +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md +msgid "" +"Let's write a small program using our driver to write to the serial console, " +"and echo incoming bytes." +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md +msgid "b'\\r'" +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md +#: src/concurrency/async-pitfalls/cancellation.md +msgid "b'\\n'" +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md +msgid "b'q'" +msgstr "" + +#: src/bare-metal/aps/safemmio/using.md +msgid "\"\\n\\nBye!\"" msgstr "" -#: src/bare-metal/aps/better-uart/using.md +#: src/bare-metal/aps/safemmio/using.md msgid "" -"Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." +"Run the example in QEMU with `make qemu_safemmio` under `src/bare-metal/aps/" +"examples`." msgstr "" #: src/bare-metal/aps/logging.md @@ -16610,8 +18110,9 @@ msgstr "" #: src/bare-metal/aps/logging.md msgid "" -"The unwrap in `log` is safe because we initialise `LOGGER` before calling " -"`set_logger`." +"The first unwrap in `log` will succeed because we initialise `LOGGER` before " +"calling `set_logger`. The second will succeed because `Uart::write_str` " +"always returns `Ok`." msgstr "" #: src/bare-metal/aps/logging/using.md @@ -16668,12 +18169,67 @@ msgid "" "it in something like a `Mutex` and put it in a static." msgstr "" +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"The `aarch64-rt` crate provides the assembly entry point and exception " +"vector that we implemented before. We just need to mark our main function " +"with the `entry!` macro." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"It also provides the `initial_pagetable!` macro to let us define an initial " +"static pagetable in Rust, rather than in assembly code like we did before." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"We can also use the UART driver from the `arm-pl011-uart` crate rather than " +"writing our own." +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Attributes to use for device memory in the initial identity map.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "/// Attributes to use for normal memory in the initial identity map.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// 1 GiB of device memory.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// 1 GiB of normal memory.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "// Another 1 GiB of device memory starting at 256 GiB.\n" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +#: src/exercises/bare-metal/solutions-afternoon.md +msgid "\"system_off returned\"" +msgstr "" + +#: src/bare-metal/aps/aarch64-rt.md +msgid "" +"Run the example in QEMU with `make qemu_rt` under `src/bare-metal/aps/" +"examples`." +msgstr "" + #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" msgstr "" #: src/bare-metal/aps/other-projects.md -msgid "\"coreboot without the C\"" +msgid "\"coreboot without the C\"." msgstr "" #: src/bare-metal/aps/other-projects.md @@ -16693,7 +18249,7 @@ msgstr "" #: src/bare-metal/aps/other-projects.md msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " -"exception handling, page tables" +"exception handling, page tables." msgstr "" #: src/bare-metal/aps/other-projects.md @@ -16713,26 +18269,9 @@ msgstr "" #: src/bare-metal/aps/other-projects.md msgid "" "The RaspberryPi OS tutorial runs Rust code before the MMU and caches are " -"enabled. This will read and write memory (e.g. the stack). However:" -msgstr "" - -#: src/bare-metal/aps/other-projects.md -msgid "" -"Without the MMU and cache, unaligned accesses will fault. It builds with " -"`aarch64-unknown-none` which sets `+strict-align` to prevent the compiler " -"generating unaligned accesses so it should be alright, but this is not " -"necessarily the case in general." -msgstr "" - -#: src/bare-metal/aps/other-projects.md -msgid "" -"If it were running in a VM, this can lead to cache coherency issues. The " -"problem is that the VM is accessing memory directly with the cache disabled, " -"while the host has cacheable aliases to the same memory. Even if the host " -"doesn't explicitly access the memory, speculative accesses can lead to cache " -"fills, and then changes from one or the other will get lost. Again this is " -"alright in this particular case (running directly on the hardware with no " -"hypervisor), but isn't a good pattern in general." +"enabled. This will read and write memory (e.g. the stack). However, this has " +"the problems mentioned at the beginning of this session regarding unaligned " +"access and cache coherency." msgstr "" #: src/bare-metal/useful-crates.md @@ -16741,7 +18280,7 @@ msgstr "Kullanışlı kasalar (crates)" #: src/bare-metal/useful-crates.md msgid "" -"We'll go over a few crates which solve some common problems in bare-metal " +"We'll look at a few crates which solve some common problems in bare-metal " "programming." msgstr "" @@ -16803,35 +18342,30 @@ msgstr "" msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "" -#: src/bare-metal/useful-crates/aarch64-paging.md -msgid "" -"For now it only supports EL1, but support for other exception levels should " -"be straightforward to add." -msgstr "" - #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "This is used in Android for the [Protected VM Firmware](https://cs.android." -"com/android/platform/superproject/+/master:packages/modules/Virtualization/" -"pvmfw/)." +"com/android/platform/superproject/main/+/main:packages/modules/" +"Virtualization/guest/pvmfw/)." msgstr "" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" -"There's no easy way to run this example, as it needs to run on real hardware " -"or under QEMU." +"There's no easy way to run this example by itself, as it needs to run on " +"real hardware or under QEMU." msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" "[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " -"is a third-party crate implementing a basic buddy system allocator. It can " -"be used both for [`LockedHeap`](https://docs.rs/buddy_system_allocator/0.9.0/" -"buddy_system_allocator/struct.LockedHeap.html) implementing [`GlobalAlloc`]" -"(https://doc.rust-lang.org/core/alloc/trait.GlobalAlloc.html) so you can use " -"the standard `alloc` crate (as we saw [before](../alloc.md)), or for " -"allocating other address space. For example, we might want to allocate MMIO " -"space for PCI BARs:" +"is a crate implementing a basic buddy system allocator. It can be used both " +"to implement [`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/trait." +"GlobalAlloc.html) (using [`LockedHeap`](https://docs.rs/" +"buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html)) " +"so you can use the standard `alloc` crate (as we saw [before](../alloc.md)), " +"or for allocating other address space (using [`FrameAllocator`](https://docs." +"rs/buddy_system_allocator/0.9.0/buddy_system_allocator/struct.FrameAllocator." +"html)) . For example, we might want to allocate MMIO space for PCI BARs:" msgstr "" #: src/bare-metal/useful-crates/buddy_system_allocator.md @@ -16915,9 +18449,9 @@ msgstr "vmbase" #: src/bare-metal/android/vmbase.md msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." -"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/" -"master/vmbase/) library provides a linker script and useful defaults for the " -"build rules, along with an entry point, UART console logging and more." +"googlesource.com/platform/packages/modules/Virtualization/+/refs/heads/main/" +"libs/libvmbase/) library provides a linker script and useful defaults for " +"the build rules, along with an entry point, UART console logging and more." msgstr "" #: src/bare-metal/android/vmbase.md @@ -16936,7 +18470,7 @@ msgstr "" msgid "We will write a driver for the PL031 real-time clock device." msgstr "" -#: src/exercises/bare-metal/afternoon.md src/exercises/concurrency/afternoon.md +#: src/exercises/bare-metal/afternoon.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." @@ -17000,28 +18534,12 @@ msgstr "" msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "" -#: src/exercises/bare-metal/rtc.md -msgid "_src/pl011.rs_ (you shouldn't need to change this):" -msgstr "" - #: src/exercises/bare-metal/rtc.md msgid "_build.rs_ (you shouldn't need to change this):" msgstr "" #: src/exercises/bare-metal/rtc.md -msgid "_entry.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_exceptions.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_idmap.S_ (you shouldn't need to change this):" -msgstr "" - -#: src/exercises/bare-metal/rtc.md -msgid "_image.ld_ (you shouldn't need to change this):" +msgid "_memory.ld_ (you shouldn't need to change this):" msgstr "" #: src/exercises/bare-metal/rtc.md @@ -17062,15 +18580,15 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"// Safe because `GICD_BASE_ADDRESS` and `GICR_BASE_ADDRESS` are the base\n" +"// SAFETY: `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 msgid "" -"// Safe because `PL031_BASE_ADDRESS` is the base address of a PL031 device,\n" -" // and nothing else accesses that address range.\n" +"// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" +" // nothing else accesses that address range.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md @@ -17139,28 +18657,14 @@ msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" -"/// Constructs a new instance of the RTC driver for a PL031 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" -" /// PL031 device, which must be mapped into the address space of the " -"process\n" -" /// as device memory and not have any other aliases.\n" +"/// Constructs a new instance of the RTC driver for a PL031 device with the\n" +" /// given set of registers.\n" msgstr "" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Reads the current RTC value.\n" msgstr "" -#: src/exercises/bare-metal/solutions-afternoon.md -msgid "" -"// Safe because we know that self.registers points to the control\n" -" // registers of a PL031 device which is appropriately mapped.\n" -msgstr "" - #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" @@ -17195,235 +18699,253 @@ msgstr "" msgid "/// Clears a pending interrupt, if any.\n" msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "The Rust type system plays an important role in making many concurrency bugs " "compile time bugs. This is often referred to as _fearless concurrency_ since " "you can rely on the compiler to ensure correctness at runtime." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 20 " +"minutes. It contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 3 saat 20 dakika sürmelidir. " +"İçeriği:" + +#: src/concurrency/welcome.md msgid "" "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." msgstr "" -#: src/concurrency.md +#: src/concurrency/welcome.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 +#: src/concurrency/threads/plain.md msgid "Rust threads work similarly to threads in other languages:" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "\"Count in thread: {i}!\"" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "\"Main thread: {i}\"" msgstr "" -#: src/concurrency/threads.md -msgid "Threads are all daemon threads, the main thread does not wait for them." +#: src/concurrency/threads/plain.md +msgid "" +"Spawning new threads does not automatically delay program termination at the " +"end of `main`." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Thread panics are independent of each other." msgstr "" -#: src/concurrency/threads.md -msgid "Panics can carry a payload, which can be unpacked with `downcast_ref`." -msgstr "" - -#: src/concurrency/threads.md -msgid "Rust thread APIs look not too different from e.g. C++ ones." +#: src/concurrency/threads/plain.md +msgid "" +"Panics can carry a payload, which can be unpacked with [`Any::downcast_ref`]" +"(https://doc.rust-lang.org/std/any/trait.Any.html#method.downcast_ref)." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Run the example." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "5ms timing is loose enough that main and spawned threads stay mostly in " "lockstep." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" -"This is because main ends the program and spawned threads do not make it " +"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." +#: src/concurrency/threads/plain.md +msgid "Compare to `pthreads`/C++ `std::thread`/`boost::thread` if desired." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "How do we wait around for the spawned thread to complete?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. Look at the docs." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` has a [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) method that blocks." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Use `let handle = thread::spawn(...)` and later `handle.join()` to wait for " "the thread to finish and have the program count all the way to 10." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Look at docs again:" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "`JoinHandle` [`.join()`](https://doc.rust-lang.org/std/thread/struct." "JoinHandle.html#method.join) returns `thread::Result`" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Use the `Result` return value from `handle.join()` to get access to the " "returned value." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Access the panic payload. This is a good time to talk about [`Any`](https://" "doc.rust-lang.org/std/any/index.html)." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "An error message indicates we must move it." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "If we want to borrow?" msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.md msgid "" "Main kills child threads when it returns, but another function would just " "return and leave them running." msgstr "" -#: src/concurrency/threads.md +#: src/concurrency/threads/plain.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." +#: src/concurrency/threads/plain.md +msgid "How do we avoid this? See next slide." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "Normal threads cannot borrow from their environment:" msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "However, you can use a [scoped thread](https://doc.rust-lang.org/std/thread/" "fn.scope.html) for this:" msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "The reason for that is that when the `thread::scope` function completes, all " "the threads are guaranteed to be joined, so they can return borrowed data." msgstr "" -#: src/concurrency/scoped-threads.md +#: src/concurrency/threads/scoped.md msgid "" "Normal Rust borrowing rules apply: you can either borrow mutably by one " "thread, or immutably by any number of threads." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels.md src/concurrency/async-control-flow.md +msgid "This segment should take about 20 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 20 dakika sürmelidir. İçeriği:" + +#: src/concurrency/channels/senders-receivers.md msgid "" -"Rust channels have two parts: a `Sender` and a `Receiver`. The two " -"parts are connected via the channel, but you only see the end-points." +"Rust channels have two parts: a [`Sender`](https://doc.rust-lang.org/std/" +"sync/mpsc/struct.Sender.html) and a [`Receiver`](https://doc.rust-lang." +"org/std/sync/mpsc/struct.Receiver.html). The two parts are connected via the " +"channel, but you only see the end-points." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "" -"`mpsc` stands for Multi-Producer, Single-Consumer. `Sender` and `SyncSender` " -"implement `Clone` (so you can make multiple producers) but `Receiver` does " -"not." +"[`mpsc`](https://doc.rust-lang.org/std/sync/mpsc/index.html) stands for " +"Multi-Producer, Single-Consumer. `Sender` and `SyncSender` implement `Clone` " +"(so you can make multiple producers) but `Receiver` does not." msgstr "" -#: src/concurrency/channels.md +#: src/concurrency/channels/senders-receivers.md msgid "" -"`send()` and `recv()` return `Result`. If they return `Err`, it means the " +"[`send()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Sender.html#method." +"send) and [`recv()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver." +"html#method.recv) return `Result`. If they return `Err`, it means the " "counterpart `Sender` or `Receiver` is dropped and the channel is closed." msgstr "" #: src/concurrency/channels/unbounded.md -msgid "You get an unbounded and asynchronous channel with `mpsc::channel()`:" +msgid "" +"You get an unbounded and asynchronous channel with [`mpsc::channel()`]" +"(https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html):" msgstr "" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md @@ -17442,63 +18964,88 @@ msgstr "" msgid "\"Main: got {msg}\"" msgstr "" +#: src/concurrency/channels/unbounded.md +msgid "" +"An unbounded channel will allocate as much space as is necessary to store " +"pending messages. The `send()` method will not block the calling thread." +msgstr "" + +#: src/concurrency/channels/unbounded.md +msgid "" +"A call to `send()` will abort with an error (that is why it returns " +"`Result`) if the channel is closed. A channel is closed when the receiver is " +"dropped." +msgstr "" + #: src/concurrency/channels/bounded.md msgid "" -"With bounded (synchronous) channels, `send` can block the current thread:" +"With bounded (synchronous) channels, [`send()`](https://doc.rust-lang.org/" +"std/sync/mpsc/struct.SyncSender.html#method.send) can block the current " +"thread:" msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"Calling `send` will block the current thread until there is space in the " +"Calling `send()` will block the current thread until there is space in the " "channel for the new message. The thread can be blocked indefinitely if there " "is nobody who reads from the channel." msgstr "" #: src/concurrency/channels/bounded.md msgid "" -"A call to `send` will abort with an error (that is why it returns `Result`) " -"if the channel is closed. A channel is closed when the receiver is dropped." +"Like unbounded channels, a call to `send()` will abort with an error if the " +"channel is closed." 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 `recv`." +"Every send will block the current thread until another thread calls " +"[`recv()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver." +"html#method.recv)." msgstr "" #: src/concurrency/send-sync.md +msgid "Send" +msgstr "Send" + +#: src/concurrency/send-sync.md +msgid "Sync" +msgstr "Sync" + +#: src/concurrency/send-sync/marker-traits.md msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): a type `T` " "is `Send` if it is safe to move a `T` across a thread boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): a type `T` " "is `Sync` if it is safe to move a `&T` across a thread boundary." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" -"`Send` and `Sync` are [unsafe traits](../unsafe/unsafe-traits.md). The " -"compiler will automatically derive them for your types as long as they only " -"contain `Send` and `Sync` types. You can also implement them manually when " -"you know it is valid." +"`Send` and `Sync` are [unsafe traits](../../unsafe-rust/unsafe-traits.md). " +"The compiler will automatically derive them for your types as long as they " +"only contain `Send` and `Sync` types. You can also implement them manually " +"when you know it is valid." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "" "One can think of these traits as markers that the type has certain thread-" "safety properties." msgstr "" -#: src/concurrency/send-sync.md +#: src/concurrency/send-sync/marker-traits.md msgid "They can be used in the generic constraints as normal traits." msgstr "" @@ -17621,13 +19168,15 @@ msgstr "" #: src/concurrency/send-sync/examples.md msgid "" -"These types are thread-safe, but they cannot be moved to another thread:" +"These types are safe to access (via shared references) from multiple " +"threads, but they cannot be moved to another thread:" msgstr "" #: src/concurrency/send-sync/examples.md msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " -"the thread which created them." +"the thread which created them. However, an already-locked mutex can have its " +"guarded variable read by any thread with which the guard is shared." msgstr "" #: src/concurrency/send-sync/examples.md @@ -17650,119 +19199,125 @@ msgid "" "considerations." msgstr "" -#: src/concurrency/shared_state.md +#: src/concurrency/shared-state.md +msgid "Arc" +msgstr "Arc" + +#: src/concurrency/shared-state.md +msgid "Mutex" +msgstr "Mutex" + +#: src/concurrency/shared-state/arc.md msgid "" -"Rust uses the type system to enforce synchronization of shared data. This is " -"primarily done via two types:" +"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows " +"shared, read-only ownership via `Arc::clone`:" msgstr "" -#: src/concurrency/shared_state.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html), atomic " -"reference counted `T`: handles sharing between threads and takes care to " -"deallocate `T` when the last reference is dropped," +#: src/concurrency/shared-state/arc.md +msgid "/// A struct that prints which thread drops it.\n" msgstr "" -#: src/concurrency/shared_state.md -msgid "" -"[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): ensures " -"mutually exclusive access to the `T` value." +#: src/concurrency/shared-state/arc.md +msgid "\"Dropped by {:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md -msgid "" -"[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " -"read-only access via `Arc::clone`:" +#: src/concurrency/shared-state/arc.md +msgid "// Sleep for 0-500ms.\n" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" msgstr "" -#: src/concurrency/shared_state/arc.md src/concurrency/shared_state/example.md -msgid "\"v: {v:?}\"" +#: src/concurrency/shared-state/arc.md +msgid "// Now only the spawned threads will hold clones of `v`.\n" +msgstr "" + +#: src/concurrency/shared-state/arc.md +msgid "" +"// When the last spawned thread finishes, it will drop `v`'s contents.\n" msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "`Arc` implements `Clone` whether or not `T` does. It implements `Send` " "and `Sync` if and only if `T` implements them both." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "`Arc::clone()` has the cost of atomic operations that get executed, but " "after that the use of the `T` is free." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" -#: src/concurrency/shared_state/arc.md +#: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) ensures " "mutual exclusion _and_ allows mutable access to `T` behind a read-only " "interface (another form of [interior mutability](../../borrowing/interior-" -"mutability)):" +"mutability.md)):" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "Notice how we have a [`impl Sync for Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) blanket " "implementation." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "It is not possible to forget to acquire the mutex before accessing the " "protected data." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "You can get an `&mut T` from an `&Mutex` by taking the lock. The " "`MutexGuard` ensures that the `&mut T` doesn't outlive the lock being held." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" -"`Mutex` implements both `Send` and `Sync` iff (if and only if) `T` " -"implements `Send`." +"`Mutex` implements both `Send` and `Sync` if and only if `T` implements " +"`Send`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "Why does `lock()` return a `Result`?" msgstr "" -#: src/concurrency/shared_state/mutex.md +#: src/concurrency/shared-state/mutex.md msgid "" "If the thread that held the `Mutex` panicked, the `Mutex` becomes " "\"poisoned\" to signal that the data it protected might be in an " @@ -17771,182 +19326,181 @@ msgid "" "You can call `into_inner()` on the error to recover the data regardless." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "// use std::sync::{Arc, Mutex};\n" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md +msgid "\"v: {v:?}\"" +msgstr "" + +#: src/concurrency/shared-state/example.md msgid "Possible solution:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "Notable parts:" msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" -"`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " +"`v: Arc<_>` needs to be cloned to make a new reference for each new spawned " "thread. Note `move` was added to the lambda signature." msgstr "" -#: src/concurrency/shared_state/example.md +#: src/concurrency/shared-state/example.md msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "" -#: src/exercises/concurrency/morning.md -msgid "Let us practice our new concurrency skills with" -msgstr "" - -#: src/exercises/concurrency/morning.md -msgid "Dining philosophers: a classic problem in concurrency." -msgstr "" - -#: src/exercises/concurrency/morning.md -msgid "" -"Multi-threaded link checker: a larger project where you'll use Cargo to " -"download dependencies and then check links in parallel." -msgstr "" +#: src/concurrency/sync-exercises.md src/concurrency/async-exercises.md +msgid "This segment should take about 1 hour and 10 minutes. It contains:" +msgstr "Bu bölüm yaklaşık 1 saat 10 dakika sürmelidir. İçeriği:" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "The dining philosophers problem is a classic problem in concurrency:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "Five philosophers dine together at the same table. Each philosopher has " -"their own place at the table. There is a fork between each plate. The dish " -"served is a kind of spaghetti which has to be eaten with two forks. Each " +"their own place at the table. There is a chopstick between each plate. The " +"dish served is spaghetti which requires two chopsticks to eat. Each " "philosopher can only alternately think and eat. Moreover, a philosopher can " -"only eat their spaghetti when they have both a left and right fork. Thus two " -"forks will only be available when their two nearest neighbors are thinking, " -"not eating. After an individual philosopher finishes eating, they will put " -"down both forks." +"only eat their spaghetti when they have both a left and right chopstick. " +"Thus two chopsticks will only be available when their two nearest neighbors " +"are thinking, not eating. After an individual philosopher finishes eating, " +"they will put down both chopsticks." msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "You will need a local [Cargo installation](../../cargo/running-locally.md) " "for this exercise. Copy the code below to a file called `src/main.rs`, fill " "out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"// left_fork: ...\n" -" // right_fork: ...\n" +"// left_chopstick: ...\n" +" // right_chopstick: ...\n" " // thoughts: ...\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Eureka! {} has a new idea!\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Pick up forks...\n" +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "// Pick up chopsticks...\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"{} is eating...\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Socrates\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Hypatia\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Plato\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Aristotle\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/solutions-morning.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Pythagoras\"" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Create forks\n" +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md +msgid "// Create chopsticks\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Create philosophers\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "// Make each of them think and eat 100 times\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/sync-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Output their thoughts\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers.md +#: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" "name = \"dining-philosophers\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "" +"Encourage students to focus first on implementing a solution that \"mostly\" " +"works." +msgstr "" + +#: src/concurrency/sync-exercises/dining-philosophers.md +msgid "" +"The deadlock in the simplest solution is a general concurrency problem and " +"highlights that Rust does not automatically prevent this sort of bug." +msgstr "" + +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Let us use our new knowledge to create a multi-threaded link checker. It " "should start at a webpage and check that links on the page are valid. It " @@ -17954,7 +19508,7 @@ msgid "" "until all pages have been validated." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "For this, you will need an HTTP client such as [`reqwest`](https://docs.rs/" "reqwest/). You will also need a way to find links, we can use [`scraper`]" @@ -17962,28 +19516,28 @@ msgid "" "we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "If `cargo add` fails with `error: no such subcommand`, then please edit the " "`Cargo.toml` file by hand. Add the dependencies listed below." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "```toml\n" "[package]\n" "name = \"link-checker\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "publish = false\n" "\n" "[dependencies]\n" @@ -17994,130 +19548,126 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "You can now download the start page. Try with a small site such as `https://" "www.google.org/`." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"bad http response: {0}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/link-checker.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Links: {links:#?}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "\"Could not extract links: {err:#}\"" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "Run the code in `src/main.rs` with" msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Use threads to check the links in parallel: send the URLs to be checked to a " "channel and let a few threads check the URLs in parallel." msgstr "" -#: src/exercises/concurrency/link-checker.md +#: src/concurrency/sync-exercises/link-checker.md msgid "" "Extend this to recursively extract links from all pages on the `www.google." "org` domain. Put an upper limit of 100 pages or so so that you don't end up " "being blocked by the site." msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "Concurrency Morning Exercise" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](dining-philosophers.md))" +#: src/concurrency/sync-exercises/link-checker.md +msgid "" +"This is a complex exercise and intended to give students an opportunity to " +"work on a larger project than others. A success condition for this exercise " +"is to get stuck on some \"real\" issue and work through it with the support " +"of other students or the instructor." msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "// To avoid a deadlock, we have to break the symmetry\n" -" // somewhere. This will swap the forks without deinitializing\n" +" // somewhere. This will swap the chopsticks without deinitializing\n" " // either of them.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"{thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "Link Checker" msgstr "" -#: src/exercises/concurrency/solutions-morning.md -msgid "([back to exercise](link-checker.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "/// Determine whether links within the given page should be extracted.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "" "/// Mark the given page as visited, returning false if it had already\n" " /// been visited.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md +msgid "// To multiplex the non-cloneable Receiver, wrap it in Arc>.\n" +msgstr "" + +#: src/concurrency/sync-exercises/solutions.md msgid "// The sender got dropped. No more commands coming in.\n" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Got crawling error: {:#}\"" msgstr "" -#: src/exercises/concurrency/solutions-morning.md +#: src/concurrency/sync-exercises/solutions.md msgid "\"Bad URLs: {:#?}\"" msgstr "" -#: src/async.md -msgid "Async Rust" -msgstr "" - -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "\"Async\" is a concurrency model where multiple tasks are executed " "concurrently by executing each task until it would block, then switching to " @@ -18127,88 +19677,92 @@ msgid "" "primitives for efficiently identifying I/O that is able to proceed." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Rust's asynchronous operation is based on \"futures\", which represent work " "that may be completed in the future. Futures are \"polled\" until they " "signal that they are complete." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "Python has a similar model in its `asyncio`. However, its `Future` type is " "callback-based, and not polled. Async Python programs require a \"loop\", " "similar to a runtime in Rust." msgstr "" -#: src/async.md +#: src/concurrency/welcome-async.md msgid "" "JavaScript's `Promise` is similar, but again callback-based. The language " "runtime implements the event loop, so many of the details of Promise " "resolution are hidden." msgstr "" -#: src/async/async-await.md +#: src/concurrency/welcome-async.md +msgid "" +"Including 10 minute breaks, this session should take about 3 hours and 30 " +"minutes. It contains:" +msgstr "" +"Bu oturum 10 dakikalık aralar dahil yaklaşık 3 saat 30 dakika sürmelidir. " +"İçeriği:" + +#: src/concurrency/async.md +msgid "async/await" +msgstr "async/await" + +#: src/concurrency/async/async-await.md msgid "" "At a high level, async Rust code looks very much like \"normal\" sequential " "code:" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "\"Count is: {i}!\"" msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "Note that this is a simplified example to show the syntax. There is no long " "running operation or any real concurrency in it!" msgstr "" -#: src/async/async-await.md -msgid "What is the return type of an async call?" -msgstr "" - -#: src/async/async-await.md -msgid "Use `let future: () = async_main(10);` in `main` to see the type." -msgstr "" - -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "You cannot make `main` async, without additional instructions to the " "compiler on how to use the returned future." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "`.await` asynchronously waits for the completion of another operation. " "Unlike `block_on`, `.await` doesn't block the current thread." msgstr "" -#: src/async/async-await.md +#: src/concurrency/async/async-await.md msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html) is a " "trait, implemented by objects that represent an operation that may not be " @@ -18216,7 +19770,7 @@ msgid "" "doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "An async function returns an `impl Future`. It's also possible (but " "uncommon) to implement `Future` for your own types. For example, the " @@ -18224,76 +19778,175 @@ msgid "" "joining to it." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "The `.await` keyword, applied to a Future, causes the current async function " "to pause until that Future is ready, and then evaluates to its output." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "The `Future` and `Poll` types are implemented exactly as shown; click the " "links to show the implementations in the docs." msgstr "" -#: src/async/futures.md -msgid "" -"We will not get to `Pin` and `Context`, as we will focus on writing async " -"code, rather than building new async primitives. Briefly:" -msgstr "" - -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "`Context` allows a Future to schedule itself to be polled again when an " -"event occurs." +"event such as a timeout occurs." msgstr "" -#: src/async/futures.md +#: src/concurrency/async/futures.md msgid "" "`Pin` ensures that the Future isn't moved in memory, so that pointers into " "that future remain valid. This is required to allow references to remain " -"valid after an `.await`." +"valid after an `.await`. We will address `Pin` in the \"Pitfalls\" segment." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Rust transforms an async function or block to a hidden type that implements " +"`Future`, using a state machine to track the function's progress. The " +"details of this transform are complex, but it helps to have a schematic " +"understanding of what is happening. The following function" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "/// Sum two D10 rolls plus a modifier.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "is transformed to something like" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Function has not begun yet.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Waitig for first `.await` to complete.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Waitig for second `.await` to complete.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Create future for first dice roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Poll sub-future for first dice roll.\n" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/state-machine.md +msgid "// Create future for second roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "// Poll sub-future for second dice roll.\n" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"This example is illustrative, and isn't an accurate representation of the " +"Rust compiler's transformation. The important things to notice here are:" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Calling an async function does nothing but construct and return a future." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"All local variables are stored in the function's future, using an enum to " +"identify where execution is currently suspended." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"An `.await` in the async function is translated into an a new state " +"containing all live variables and the awaited future. The `loop` then " +"handles that updated state, polling the future until it returns `Poll::" +"Ready`." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Execution continues eagerly until a `Poll::Pending` occurs. In this simple " +"example, every future is ready immediately." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"`main` contains a naïve executor, which just busy-loops until the future is " +"ready. We will discuss real executors shortly." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"Imagine the `Future` data structure for a deeply nested stack of async " +"functions. Each function's `Future` contains the `Future` structures for the " +"functions it calls. This can result in unexpectedly large compiler-generated " +"`Future` types." +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"This also means that recursive async functions are challenging. Compare to " +"the common error of building recursive type, such as" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "" +"The fix for a recursive type is to add a layer of indrection, such as with " +"`Box`. Similarly, a recursive async function must box the recursive future:" +msgstr "" + +#: src/concurrency/async/state-machine.md +msgid "\"{n}\"" +msgstr "\"{n}\"" + +#: src/concurrency/async/runtimes.md msgid "" "A _runtime_ provides support for performing operations asynchronously (a " "_reactor_) and is responsible for executing futures (an _executor_). Rust " "does not have a \"built-in\" runtime, but several options are available:" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "[Tokio](https://tokio.rs/): performant, with a well-developed ecosystem of " "functionality like [Hyper](https://hyper.rs/) for HTTP or [Tonic](https://" "github.com/hyperium/tonic) for gRPC." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "[async-std](https://async.rs/): aims to be a \"std for async\", and includes " "a basic runtime in `async::task`." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Several larger applications have their own runtimes. For example, [Fuchsia]" "(https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/lib/fuchsia-" "async/src/lib.rs) already has one." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Note that of the listed runtimes, only Tokio is supported in the Rust " "playground. The playground also does not permit any I/O, so most interesting " "async things can't run in the playground." msgstr "" -#: src/async/runtimes.md +#: src/concurrency/async/runtimes.md msgid "" "Futures are \"inert\" in that they do not do anything (not even start an I/O " "operation) unless there is an executor polling them. This differs from JS " @@ -18301,66 +19954,66 @@ msgid "" "used." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Tokio provides:" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "A large ecosystem of libraries." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "\"Count in task: {i}!\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "\"Main task: {i}\"" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "With the `tokio::main` macro we can now make `main` async." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "The `spawn` function creates a new, concurrent \"task\"." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "" "Why does `count_to` not (usually) get to 10? This is an example of async " "cancellation. `tokio::spawn` returns a handle which can be awaited to wait " "until it finishes." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." msgstr "" -#: src/async/runtimes/tokio.md +#: src/concurrency/async/runtimes/tokio.md msgid "Try awaiting the task returned from `tokio::spawn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "Rust has a task system, which is a form of lightweight threading." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "A task has a single top-level future which the executor polls to make " "progress. That future may have one or more nested futures that its `poll` " @@ -18369,170 +20022,155 @@ msgid "" "and an I/O operation." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"listening on port {}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"connection from {addr:?}\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "b\"Who are you?\\n\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"socket error\"" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "" -#: src/async/tasks.md src/async/control-flow/join.md +#: src/concurrency/async/tasks.md src/concurrency/async-control-flow/join.md msgid "" "Copy this example into your prepared `src/main.rs` and run it from there." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Try connecting to it with a TCP connection tool like [nc](https://www.unix." "com/man-page/linux/1/nc/) or [telnet](https://www.unix.com/man-page/linux/1/" "telnet/)." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Ask students to visualize what the state of the example server would be with " "a few connected clients. What tasks exist? What are their Futures?" msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "This is the first time we've seen an `async` block. This is similar to a " "closure, but does not take any arguments. Its return value is a Future, " "similar to an `async fn`." msgstr "" -#: src/async/tasks.md +#: src/concurrency/async/tasks.md msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"ping_handler complete\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Failed to send ping.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Sent {} pings so far.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "\"Something went wrong in ping handler task.\"" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " -"[morning class](concurrency/channels.md)." +"[morning class](../channels.md)." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "The [Flume](https://docs.rs/flume/latest/flume/) crate has channels that " "implement both `sync` and `async` `send` and `recv`. This can be convenient " "for complex applications with both IO and heavy CPU processing tasks." msgstr "" -#: src/async/channels.md +#: src/concurrency/async-control-flow/channels.md msgid "" "What makes working with `async` channels preferable is the ability to " "combine them with other `future`s to combine them and create complex control " "flow." msgstr "" -#: src/async/control-flow.md -msgid "Futures Control Flow" -msgstr "" - -#: src/async/control-flow.md -msgid "" -"Futures can be combined together to produce concurrent compute flow graphs. " -"We have already seen tasks, that function as independent threads of " -"execution." -msgstr "" - -#: src/async/control-flow.md -msgid "[Join](control-flow/join.md)" -msgstr "" - -#: src/async/control-flow.md -msgid "[Select](control-flow/select.md)" -msgstr "" - -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "A join operation waits until all of a set of futures are ready, and returns " "a collection of their results. This is similar to `Promise.all` in " "JavaScript or `asyncio.gather` in Python." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://httpbin.org/ip\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"https://play.rust-lang.org/\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "\"BAD_URL\"" msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md +msgid "\"{page_sizes_dict:?}\"" +msgstr "" + +#: src/concurrency/async-control-flow/join.md msgid "" "For multiple futures of disjoint types, you can use `std::future::join!` but " "you must know how many futures you will have at compile time. This is " "currently in the `futures` crate, soon to be stabilised in `std::future`." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." msgstr "" -#: src/async/control-flow/join.md +#: src/concurrency/async-control-flow/join.md msgid "" "You can also combine `join_all` with `join!` for instance to join all " "requests to an http service as well as a database query. Try adding a " @@ -18541,7 +20179,7 @@ msgid "" "demonstrates `join!`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" "A select operation waits until any of a set of futures is ready, and " "responds to that future's result. In JavaScript, this is similar to `Promise." @@ -18549,7 +20187,7 @@ msgid "" "FIRST_COMPLETED)`." msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" "Similar to a match statement, the body of `select!` has a number of arms, " "each of the form `pattern = future => statement`. When a `future` is ready, " @@ -18558,91 +20196,53 @@ msgid "" "of the `select!` macro." msgstr "" -#: src/async/control-flow/select.md -msgid "\"Felix\"" -msgstr "" - -#: src/async/control-flow/select.md -msgid "\"Failed to send cat.\"" -msgstr "" - -#: src/async/control-flow/select.md -msgid "\"Failed to send dog.\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"got: {msg}\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Failed to receive winner\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"timeout\"" msgstr "" -#: src/async/control-flow/select.md -msgid "\"Winner is {winner:?}\"" +#: src/concurrency/async-control-flow/select.md +msgid "\"Failed to send greeting\"" msgstr "" -#: src/async/control-flow/select.md -msgid "" -"In this example, we have a race between a cat and a dog. " -"`first_animal_to_finish_race` listens to both channels and will pick " -"whichever arrives first. Since the dog takes 50ms, it wins against the cat " -"that take 500ms." -msgstr "" - -#: src/async/control-flow/select.md -msgid "" -"You can use `oneshot` channels in this example as the channels are supposed " -"to receive only one `send`." +#: src/concurrency/async-control-flow/select.md +msgid "\"Listener failed\"" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" -"Try adding a deadline to the race, demonstrating selecting different sorts " -"of futures." +"The `listener` async block here is a common form: wait for some async event, " +"or for a timeout. Change the `sleep` to sleep longer to see it fail. Why " +"does the `send` also fail in this situation?" msgstr "" -#: src/async/control-flow/select.md +#: src/concurrency/async-control-flow/select.md msgid "" -"Note that `select!` drops unmatched branches, which cancels their futures. " -"It is easiest to use when every execution of `select!` creates new futures." -msgstr "" - -#: src/async/control-flow/select.md -msgid "" -"An alternative is to pass `&mut future` instead of the future itself, but " -"this can lead to issues, further discussed in the pinning slide." -msgstr "" - -#: src/async/pitfalls.md -msgid "Pitfalls of async/await" +"`select!` is also often used in a loop in \"actor\" architectures, where a " +"task reacts to events in a loop. That has some pitfalls, which will be " +"discussed in the next segment." msgstr "" -#: src/async/pitfalls.md +#: src/concurrency/async-pitfalls.md msgid "" "Async / await provides convenient and efficient abstraction for concurrent " "asynchronous programming. However, the async/await model in Rust also comes " "with its share of pitfalls and footguns. We illustrate some of them in this " -"chapter:" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Blocking the Executor](pitfalls/blocking-executor.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Pin](pitfalls/pin.md)" -msgstr "" - -#: src/async/pitfalls.md -msgid "[Async Traits](pitfalls/async-traits.md)" +"chapter." msgstr "" -#: src/async/pitfalls.md -msgid "[Cancellation](pitfalls/cancellation.md)" -msgstr "" +#: src/concurrency/async-pitfalls.md +msgid "Pin" +msgstr "Pin" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "Blocking the executor" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Most async runtimes only allow IO tasks to run concurrently. This means that " "CPU blocking tasks will block the executor and prevent other tasks from " @@ -18650,39 +20250,39 @@ msgid "" "possible." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"current_thread\"" msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "The `\"current_thread\"` flavor puts all tasks on a single thread. This " "makes the effect more obvious, but the bug is still present in the multi-" "threaded flavor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Another fix would be to `tokio::task::spawn_blocking` which spawns an actual " "thread and transforms its handle into a future without blocking the executor." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "You should not think of tasks as OS threads. They do not map 1 to 1 and most " "executors will allow many tasks to run on a single OS thread. This is " @@ -18692,27 +20292,21 @@ msgid "" "situations." msgstr "" -#: src/async/pitfalls/blocking-executor.md +#: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Use sync mutexes with care. Holding a mutex over an `.await` may cause " "another task to block, and that task may be running on the same thread." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" -"Async blocks and functions return types implementing the `Future` trait. The " -"type returned is the result of a compiler transformation which turns local " -"variables into data stored inside the future." +"Recall an async function or block creates a type implementing `Future` and " +"containing all of the local variables. Some of those variables can hold " +"references (pointers) to other local variables. To ensure those remain " +"valid, the future can never be moved to a different memory location." msgstr "" -#: src/async/pitfalls/pin.md -msgid "" -"Some of those variables can hold pointers to other local variables. Because " -"of that, the future should never be moved to a different memory location, as " -"it would invalidate those pointers." -msgstr "" - -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "To prevent moving the future type in memory, it can only be polled through a " "pinned pointer. `Pin` is a wrapper around a reference that disallows all " @@ -18720,95 +20314,95 @@ msgid "" "location." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "// A work item. In this case, just sleep for the given time and respond\n" "// with a message on the `respond_on` channel.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// A worker which listens for work on a queue and performs it.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// Pretend to work.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send response\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// TODO: report number of iterations every 100ms\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "// A requester which requests work and waits for it to complete.\n" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send on work queue\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"failed waiting for response\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "\"work result for iteration {i}: {resp}\"" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "You may recognize this as an example of the actor pattern. Actors typically " "call `select!` in a loop." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This serves as a summation of a few of the previous lessons, so take your " "time with it." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This still doesn't work. Follow the compiler errors, adding `&mut` to the " "`timeout_fut` in the `select!` to work around the move, then using `Box::" "pin`:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "This compiles, but once the timeout expires it is `Poll::Ready` on every " "iteration (a fused future would help with this). Update to reset " -"`timeout_fut` every time it expires." +"`timeout_fut` every time it expires:" msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Box allocates on the heap. In some cases, `std::pin::pin!` (only recently " "stabilized, with older code often using `tokio::pin!`) is also an option, " "but that is difficult to use for a future that is reassigned." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Another alternative is to not use `pin` at all but spawn another task that " "will send to a `oneshot` channel every 100ms." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "Data that contains pointers to itself is called self-referential. Normally, " "the Rust borrow checker would prevent self-referential data from being " @@ -18817,83 +20411,94 @@ msgid "" "borrow checker." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "`Pin` is a wrapper around a reference. An object cannot be moved from its " "place using a pinned pointer. However, it can still be moved through an " "unpinned pointer." msgstr "" -#: src/async/pitfalls/pin.md +#: src/concurrency/async-pitfalls/pin.md msgid "" "The `poll` method of the `Future` trait uses `Pin<&mut Self>` instead of " "`&mut Self` to refer to the instance. That's why it can only be called on a " "pinned pointer." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"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`." +"Async methods in traits were stabilized in the 1.75 release. This required " +"support for using return-position `impl Trait` in traits, as the desugaring " +"for `async fn` includes `-> impl Future`." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"However, even with the native support today there are some pitfalls around " -"`async fn` and RPIT in traits:" +"However, even with the native support, there are some pitfalls around `async " +"fn`:" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Return-position impl Trait captures all in-scope lifetimes (so some patterns " -"of borrowing cannot be expressed)" +"Return-position `impl Trait` captures all in-scope lifetimes (so some " +"patterns of borrowing cannot be expressed)." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"Traits whose methods use return-position `impl trait` or `async` are not " -"`dyn` compatible." +"Async traits cannot be used with [trait objects](../../smart-pointers/trait-" +"objects.md) (`dyn Trait` support)." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"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:" +"The [async_trait](https://docs.rs/async-trait/) crate provides a workaround " +"for `dyn` support through a macro, with some caveats:" msgstr "" -#: src/async/pitfalls/async-traits.md -msgid "\"running all sleepers..\"" +#: src/concurrency/async-pitfalls/async-traits.md +msgid "\"Running all sleepers...\"" msgstr "" -#: src/async/pitfalls/async-traits.md -msgid "\"slept for {}ms\"" +#: src/concurrency/async-pitfalls/async-traits.md +msgid "\"Slept for {} ms\"" msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "`async_trait` is easy to use, but note that it's using heap allocations to " "achieve this. This heap allocation has performance overhead." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md +msgid "" +"The challenges in language support for `async trait` are too deep to " +"describe in-depth in this class. See [this blog post](https://" +"smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-are-" +"hard/) by Niko Matsakis if you are interested in digging deeper. See also " +"these keywords:" +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md +msgid "" +"[RPIT](https://doc.rust-lang.org/reference/types/impl-trait.html#abstract-" +"return-types): short for [return-position `impl Trait`](../../generics/impl-" +"trait.md)." +msgstr "" + +#: src/concurrency/async-pitfalls/async-traits.md msgid "" -"The challenges in language support for `async trait` are deep Rust and " -"probably not worth describing in-depth. Niko Matsakis did a good job of " -"explaining them in [this post](https://smallcultfollowing.com/babysteps/" -"blog/2019/10/26/async-fn-in-traits-are-hard/) if you are interested in " -"digging deeper." +"[RPITIT](https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits." +"html): short for return-position `impl Trait` in trait (RPIT in trait)." msgstr "" -#: src/async/pitfalls/async-traits.md +#: src/concurrency/async-pitfalls/async-traits.md msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " -"time and adding it to the Vec." +"time and adding it to the `Vec`." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Dropping a future implies it can never be polled again. This is called " "_cancellation_ and it can occur at any `await` point. Care is needed to " @@ -18901,129 +20506,116 @@ msgid "" "example, it shouldn't deadlock or lose data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"not UTF-8\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"hi\\nthere\\n\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "\"tick!\"" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "The compiler doesn't help with cancellation-safety. You need to read API " "documentation and consider what state your `async fn` holds." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "// prefix buf and bytes with self.\n" msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." "html#method.tick) is cancellation-safe because it keeps track of whether a " "tick has been 'delivered'." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncReadExt.html#method.read) is cancellation-safe because it either " "returns or doesn't read data." msgstr "" -#: src/async/pitfalls/cancellation.md +#: src/concurrency/async-pitfalls/cancellation.md msgid "" "[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncBufReadExt.html#method.read_line) is similar to the example and _isn't_ " "cancellation-safe. See its documentation for details and alternatives." msgstr "" -#: src/exercises/concurrency/afternoon.md -msgid "" -"To practice your Async Rust skills, we have again two exercises for you:" -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"Dining philosophers: we already saw this problem in the morning. This time " -"you are going to implement it with Async Rust." -msgstr "" - -#: src/exercises/concurrency/afternoon.md -msgid "" -"A Broadcast Chat Application: this is a larger project that allows you " -"experiment with more advanced Async Rust features." -msgstr "" - -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "Dining Philosophers --- Async" msgstr "Filozofların Akşam Yemeği --- Async" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" -"See [dining philosophers](dining-philosophers.md) for a description of the " -"problem." +"See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " +"description of the problem." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "As before, you will need a local [Cargo installation](../../cargo/running-" "locally.md) for this exercise. Copy the code below to a file called `src/" "main.rs`, fill out the blanks, and test that `cargo run` does not deadlock:" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md -msgid "// Keep trying until we have both forks\n" +#: src/concurrency/async-exercises/dining-philosophers.md +msgid "// Keep trying until we have both chopsticks\n" +msgstr "" + +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md +msgid "// tokio scheduler doesn't deadlock with 5 philosophers, so have 2.\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/dining-philosophers.md +#: src/concurrency/async-exercises/solutions.md msgid "// Make them think and eat\n" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Since this time you are using Async Rust, you'll need a `tokio` dependency. " "You can use the following `Cargo.toml`:" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" "name = \"dining-philosophers-async-dine\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "\n" "[dependencies]\n" "tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " @@ -19031,17 +20623,17 @@ msgid "" "```" msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "" "Also note that this time you have to use the `Mutex` and the `mpsc` module " "from the `tokio` crate." msgstr "" -#: src/exercises/concurrency/dining-philosophers-async.md +#: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "In this exercise, we want to use our new knowledge to implement a broadcast " "chat application. We have a chat server that the clients connect to and " @@ -19050,7 +20642,7 @@ msgid "" "that it receives to all the clients." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "For this, we use [a broadcast channel](https://docs.rs/tokio/latest/tokio/" "sync/broadcast/fn.channel.html) on the server, and [`tokio_websockets`]" @@ -19058,74 +20650,74 @@ msgid "" "and the server." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "_Cargo.toml_:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "```toml\n" "[package]\n" "name = \"chat-async\"\n" "version = \"0.1.0\"\n" -"edition = \"2021\"\n" +"edition = \"2024\"\n" "\n" "[dependencies]\n" -"futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" -"http = \"1.1.0\"\n" -"tokio = { version = \"1.37.0\", features = [\"full\"] }\n" -"tokio-websockets = { version = \"0.7.0\", features = [\"client\", " +"futures-util = { version = \"0.3.31\", features = [\"sink\"] }\n" +"http = \"1.3.1\"\n" +"tokio = { version = \"1.45.1\", features = [\"full\"] }\n" +"tokio-websockets = { version = \"0.11.4\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "The required APIs" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "You are going to need the following functions from `tokio` and " "[`tokio_websockets`](https://docs.rs/tokio-websockets/). Spend a few minutes " "to familiarize yourself with the API." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[StreamExt::next()](https://docs.rs/futures-util/0.3.28/futures_util/stream/" "trait.StreamExt.html#method.next) implemented by `WebSocketStream`: for " "asynchronously reading messages from a Websocket Stream." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[SinkExt::send()](https://docs.rs/futures-util/0.3.28/futures_util/sink/" "trait.SinkExt.html#method.send) implemented by `WebSocketStream`: for " "asynchronously sending messages on a Websocket Stream." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." "html#method.next_line): for asynchronously reading user messages from the " "standard input." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): for subscribing to a broadcast channel." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Normally in a Cargo project, you can have only one binary, and one `src/main." "rs` file. In this project, we need two binaries. One for the client, and one " @@ -19136,149 +20728,131 @@ msgid "" "targets.html#binaries))." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Copy the following server and client code into `src/bin/server.rs` and `src/" "bin/client.rs`, respectively. Your task is to complete these files as " "described below." msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"listening on port 2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"New connection from {addr:?}\"" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "" -#: src/exercises/concurrency/chat-app.md -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md +#: src/concurrency/async-exercises/solutions.md msgid "\"ws://127.0.0.1:2000\"" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Running the binaries" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Run the server with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "and the client with:" msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: Use `tokio::select!` for concurrently performing two tasks in a " "continuous loop. One task receives messages from the client and broadcasts " "them. The other sends messages received by the server to the client." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." msgstr "" -#: src/exercises/concurrency/chat-app.md +#: src/concurrency/async-exercises/chat-app.md msgid "" "Hint: As before, use `tokio::select!` in a continuous loop for concurrently " -"performing two tasks: (1) reading user messages from standard input and " -"sending them to the server, and (2) receiving messages from the server, and " -"displaying them for the user." -msgstr "" - -#: src/exercises/concurrency/chat-app.md -msgid "" -"Optional: Once you are done, change the code to broadcast messages to all " -"clients, but the sender of the message." -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md -msgid "Concurrency Afternoon Exercise" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](dining-philosophers-async.md))" +"performing two tasks: (1) reading user messages from standard input and " +"sending them to the server, and (2) receiving messages from the server, and " +"displaying them for the user." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/chat-app.md msgid "" -"// If we didn't get the left fork, drop the right fork if we\n" -" // have it and let other tasks make progress.\n" +"Optional: Once you are done, change the code to broadcast messages to all " +"clients, but the sender of the message." msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "" -"// If we didn't get the right fork, drop the left fork and let\n" -" // other tasks make progress.\n" +"// Keep trying until we have both chopsticks\n" +" // Pick up chopsticks...\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// The locks are dropped here\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Here is a thought: {thought}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md -msgid "([back to exercise](chat-app.md))" -msgstr "" - -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"Welcome to chat! Type a message\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "" "// A continuous loop for concurrently performing two tasks: (1) receiving\n" " // messages from `ws_stream` and broadcasting them, and (2) receiving\n" " // messages on `bcast_rx` and sending them to the client.\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"From client {addr:?} {text:?}\"" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "// Continuous loop for concurrently sending and receiving messages.\n" msgstr "" -#: src/exercises/concurrency/solutions-afternoon.md +#: src/concurrency/async-exercises/solutions.md msgid "\"From server: {}\"" msgstr "" @@ -19296,6 +20870,14 @@ msgid "" "comprehensive-rust/discussions). We would love to hear from you." msgstr "" +#: src/thanks.md +msgid "" +"Thank you for reading the speaker notes! We hope they have been useful. If " +"you find pages without notes, please send us a PR and link it to [issue " +"#1083](https://github.com/google/comprehensive-rust/issues/1083). We are " +"also very grateful for fixes and improvements to the existing notes." +msgstr "" + #: src/glossary.md msgid "" "The following is a glossary which aims to give a short definition of many " @@ -19303,10 +20885,11 @@ msgid "" "the English original." msgstr "" +#. Please add the English term in italic after your translated term. Also, please keep the hard line breaks to ensure a nice formatting. #: src/glossary.md msgid "" "allocate: \n" -"Dynamic memory allocation on [the heap](memory-management/stack-vs-heap.md)." +"Dynamic memory allocation on [the heap](memory-management/review.md)." msgstr "" #: src/glossary.md @@ -19315,6 +20898,13 @@ msgid "" "Information that is passed into a function or method." msgstr "" +#: src/glossary.md +msgid "" +"associated type: \n" +"A type associated with a specific trait. Useful for defining the " +"relationship between types." +msgstr "" + #: src/glossary.md msgid "" "Bare-metal Rust: \n" @@ -19325,13 +20915,13 @@ msgstr "" #: src/glossary.md msgid "" "block: \n" -"See [Blocks](control-flow/blocks.md) and _scope_." +"See [Blocks](control-flow-basics/blocks-and-scopes.md) and _scope_." msgstr "" #: src/glossary.md msgid "" "borrow: \n" -"See [Borrowing](ownership/borrowing.md)." +"See [Borrowing](borrowing/shared.md)." msgstr "" #: src/glossary.md @@ -19380,7 +20970,7 @@ msgstr "" #: src/glossary.md msgid "" "Concurrency in Rust: \n" -"See [Concurrency in Rust](concurrency.md)." +"See [Concurrency in Rust](concurrency/welcome.md)." msgstr "" #: src/glossary.md @@ -19648,8 +21238,8 @@ msgstr "" #: src/glossary.md msgid "" "string: \n" -"A data type storing textual data. See [`String` vs `str`](basic-syntax/" -"string-slices.html) for more." +"A data type storing textual data. See [Strings](references/strings.html) for " +"more." msgstr "" #: src/glossary.md @@ -19744,7 +21334,7 @@ msgstr "" msgid "" "unsafe: \n" "The subset of Rust which allows you to trigger _undefined behavior_. See " -"[Unsafe Rust](unsafe.html)." +"[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" #: src/glossary.md @@ -19839,9 +21429,9 @@ msgstr "" #: src/other-resources.md msgid "" -"[Rust for Embedded C Programmers](https://docs.opentitan.org/doc/ug/" -"rust_for_c/): covers Rust from the perspective of developers who write " -"firmware in C." +"[Rust for Embedded C Programmers](https://opentitan.org/book/doc/" +"rust_for_c_devs.html): covers Rust from the perspective of developers who " +"write firmware in C." msgstr "" #: src/other-resources.md @@ -19865,6 +21455,14 @@ msgid "" "and async/await are also covered." msgstr "" +#: src/other-resources.md +msgid "" +"[Advanced testing for Rust applications](https://rust-exercises.com/advanced-" +"testing/): a self-paced workshop that goes beyond Rust's built-in testing " +"framework. It covers `googletest`, snapshot testing, mocking as well as how " +"to write your own custom test harness." +msgstr "" + #: src/other-resources.md msgid "" "[Beginner's Series to Rust](https://docs.microsoft.com/en-us/shows/beginners-" @@ -19935,6 +21533,611 @@ msgid "" "directory for details, including the license terms." msgstr "" +#~ msgid "Scopes and Shadowing" +#~ msgstr "Kapsamlar (Scopes) ve Gölgeleme (Shadowing)" + +#~ msgid "Struct Lifetimes" +#~ msgstr "Yapıların Ömürleri" + +#~ msgid "`FromIterator`" +#~ msgstr "`FromIterator`" + +#~ msgid "Test Modules" +#~ msgstr "Test Modülleri" + +#~ msgid "Calling C with Bindgen" +#~ msgstr "Bindgen ile Rust Tarafından C'yi Kullanma" + +#~ msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" +#~ msgstr "2. Gün Öğleden Sonra (3 saat 15 dakika, aralar dahil)" + +#~ msgid "" +#~ "[Farsi](https://google.github.io/comprehensive-rust/fa/) by [@DannyRavi]" +#~ "(https://github.com/DannyRavi), [@javad-jafari](https://github.com/javad-" +#~ "jafari), [@Alix1383](https://github.com/alix1383), [@moaminsharifi]" +#~ "(https://github.com/moaminsharifi), [@hamidrezakp](https://github.com/" +#~ "hamidrezakp) and [@mehrad77](https://github.com/mehrad77)." +#~ msgstr "" +#~ "[Farsça](https://google.github.io/comprehensive-rust/fa/) yazanlar: " +#~ "[@DannyRavi](https://github.com/DannyRavi), [@javad-jafari](https://" +#~ "github.com/javad-jafari), [@Alix1383](https://github.com/alix1383), " +#~ "[@moaminsharifi](https://github.com/moaminsharifi), [@hamidrezakp]" +#~ "(https://github.com/hamidrezakp) ve [@mehrad77](https://github.com/" +#~ "mehrad77)." + +#~ msgid "Pattern matching: destructuring enums, structs, and arrays." +#~ msgstr "" +#~ "Desen eşleştirme: numaralandırmaların (enums), yapıların ve dizilerin " +#~ "çözümlenmesi (destructuring)." + +#~ msgid "\"Final x: {x}\"" +#~ msgstr "\"Son x: {x}\"" + +#~ msgid "\"elem: {elem}\"" +#~ msgstr "\"elem: {elem}\"" + +#~ msgid "\"{i}\"" +#~ msgstr "\"{i}\"" + +#~ msgid "\"elements searched: {elements_searched}\"" +#~ msgstr "\"aranan öğeler: {elements_searched}\"" + +#~ msgid "Blocks" +#~ msgstr "Bloklar" + +#~ msgid "\"y: {y}\"" +#~ msgstr "\"y: {y}\"" + +#~ msgid "" +#~ "You can shadow variables, both those from outer scopes and variables from " +#~ "the same scope:" +#~ msgstr "" +#~ "Hem dış kapsamlardaki (outer scopes) değişkenleri hem de aynı kapsamdaki " +#~ "değişkenleri gölgeleyebilirsiniz (shadow):" + +#~ msgid "\"before: {a}\"" +#~ msgstr "\"önce: {a}\"" + +#~ msgid "\"inner scope: {a}\"" +#~ msgstr "\"iç kapsam: {a}\"" + +#~ msgid "\"shadowed in inner scope: {a}\"" +#~ msgstr "\"iç kapsamda gölgelendi: {a}\"" + +#~ msgid "\"after: {a}\"" +#~ msgstr "\"sonra: {a}\"" + +#~ 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 "" +#~ "Son örnekte iç bloğa (inner block) bir `b` ekleyerek ve ardından bu " +#~ "bloğun dışından ona erişmeye çalışarak bir değişkenin kapsamının (scope) " +#~ "sınırlı olduğunu gösterin." + +#~ msgid "" +#~ "Shadowing is different from mutation, because after shadowing both " +#~ "variables' memory locations exist at the same time. Both are available " +#~ "under the same name, depending where you use it in the code." +#~ msgstr "" +#~ "Gölgeleme (shadowing) mutasyondan (mutation) farklıdır çünkü gölgeleme " +#~ "sonrasında her iki değişkenin de bellek konumları aynı anda mevcuttur. " +#~ "Her ikisi de kodda nerede kullandığınıza bağlı olarak aynı ad altında " +#~ "mevcuttur." + +#~ msgid "A shadowing variable can have a different type." +#~ msgstr "Bir gölgeleme (shadowing) değişkeni farklı bir türe sahip olabilir." + +#~ msgid "" +#~ "Shadowing looks obscure at first, but is convenient for holding on to " +#~ "values after `.unwrap()`." +#~ msgstr "" +#~ "Gölgelendirme ilk başta anlaşılmaz görünebilir, ancak `.unwrap()` " +#~ "sonrasındaki değerleri korumak için kullanışlıdır." + +#~ msgid "" +#~ "`unreachable!()` marks a bit of code as unreachable. If executed, it will " +#~ "panic." +#~ msgstr "" +#~ "`unreachable!()` kodun bir kısmını erişilemez (unreachable) olarak " +#~ "işaretler. Eğer yürütülürse, paniğe neden olur." + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 35 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "10 dakikalık aralar, bu oturum yaklaşık 2 saat 35 dakika sürmelidir. " +#~ "İçeriği:" + +#~ 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 "" +#~ "Sınırların dışında bir dizi öğesine erişmeyi deneyin. Dizi erişimleri " +#~ "çalışma zamanında (runtime) kontrol edilir. Rust genellikle bu " +#~ "kontrolleri optimize edebilir ve emniyetsiz Rust (unsafe Rust) " +#~ "kullanılarak bu kontrollerden kaçınılabilir." + +#~ msgid "" +#~ "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 "" +#~ "Demetler (tuples) ve diğer yapılandırılmış değerlerle (structured values) " +#~ "çalışırken, içteki değerleri yerel (local) değişkenlere çıkarmayı istemek " +#~ "yaygındır. Bu, doğrudan iç değerlere erişilerek elle yapılabilir:" + +#~ msgid "\"left: {left}, right: {right}\"" +#~ msgstr "\"sol: {left}, sağ: {right}\"" + +#~ msgid "//\n" +#~ msgstr "//\n" + +#~ msgid "\"matrix: {:#?}\"" +#~ msgstr "\"matrix: {:#?}\"" + +#~ msgid "\"transposed: {:#?}\"" +#~ msgstr "\"transposed: {:#?}\"" + +#~ msgid "Rust will statically forbid dangling references:" +#~ msgstr "" +#~ "Rust, boşa düşen referansları (dangling references) statik olarak " +#~ "yasaklayacaktır:" + +#~ msgid "" +#~ "Rust does not automatically create references for you - the `&` is always " +#~ "required." +#~ msgstr "" +#~ "Rust sizin için otomatik olarak referans oluşturmaz. `&` her zaman " +#~ "gereklidir." + +#~ 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 "" +#~ "Çalışma zamanında değerlendirilen (evaluate) bir sabite (constant) " +#~ "ihtiyaç duyulması çok yaygın bir durum değildir, ancak statik " +#~ "kullanmaktan daha yararlı ve daha emniyetlidir." + +#~ msgid "while-let" +#~ msgstr "while-let" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 3 hours and 15 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 15 dakika sürmelidir. " +#~ "İçeriği:" + +#~ msgid "\"{elem}\"" +#~ msgstr "\"{elem}\"" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 40 " +#~ "minutes. It contains:" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 40 dakika sürmelidir. " +#~ "İçeriği:" + +#~ msgid "FromIterator" +#~ msgstr "FromIterator" + +#~ msgid "Writing Unsafe Functions" +#~ msgstr "Emniyetsiz (Unsafe) Fonksiyonlar Yazma" + +#~ msgid "Slices: `&[T]`" +#~ msgstr "Dilimler: `&[T]`" + +#~ msgid "`thiserror` and `anyhow`" +#~ msgstr "`thiserror` ve `anyhow`" + +#~ msgid "Control Flow" +#~ msgstr "Kontrol Akışı" + +#~ msgid "[Welcome](../welcome-day-1.md) (5 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-1.md) (5 dakika)" + +#~ msgid "[Hello, World](../hello-world.md) (15 minutes)" +#~ msgstr "[Merhaba, Dünya](../hello-world.md) (15 dakika)" + +#~ msgid "[Types and Values](../types-and-values.md) (40 minutes)" +#~ msgstr "[Türler ve Değerler](../types-and-values.md) (40 dakika)" + +#~ msgid "[Control Flow Basics](../control-flow-basics.md) (40 minutes)" +#~ msgstr "[Kontrol Akışı Temelleri](../control-flow-basics.md) (40 dakika)" + +#~ msgid "[Tuples and Arrays](../tuples-and-arrays.md) (35 minutes)" +#~ msgstr "[Demetler ve Diziler](../tuples-and-arrays.md) (35 dakika)" + +#~ msgid "[References](../references.md) (55 minutes)" +#~ msgstr "[Referanslar](../references.md) (55 dakika)" + +#~ msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" +#~ msgstr "[Kullanıcı Tanımlı Türler](../user-defined-types.md) (50 dakika)" + +#~ msgid "[Welcome](../welcome-day-2.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-2.md) (3 dakika)" + +#~ msgid "[Pattern Matching](../pattern-matching.md) (1 hour)" +#~ msgstr "[Desen Eşleştirme](../pattern-matching.md) (1 saat)" + +#~ msgid "[Methods and Traits](../methods-and-traits.md) (50 minutes)" +#~ msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" + +#~ msgid "Day 2 Afternoon (4 hours, including breaks)" +#~ msgstr "2. Gün Öğleden Sonra (4 saat, aralar dahil)" + +#~ msgid "[Generics](../generics.md) (40 minutes)" +#~ msgstr "[Jenerikler](../generics.md) (40 dakika)" + +#~ msgid "[Standard Library Types](../std-types.md) (1 hour and 20 minutes)" +#~ msgstr "[Standart Kütüphanedeki Türler](../std-types.md) (1 saat 20 dakika)" + +#~ msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" +#~ msgstr "" +#~ "[Standart Kütüphanedeki Özellikler](../std-traits.md) (1 saat 40 dakika)" + +#~ msgid "[Welcome](../welcome-day-3.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-3.md) (3 dakika)" + +#~ msgid "[Memory Management](../memory-management.md) (1 hour)" +#~ msgstr "[Bellek Yönetimi](../memory-management.md) (1 saat)" + +#~ msgid "[Smart Pointers](../smart-pointers.md) (55 minutes)" +#~ msgstr "[Akıllı Göstericiler](../smart-pointers.md) (55 dakika)" + +#~ msgid "[Borrowing](../borrowing.md) (55 minutes)" +#~ msgstr "[Ödünç Alma](../borrowing.md) (55 dakika)" + +#~ msgid "[Lifetimes](../lifetimes.md) (50 minutes)" +#~ msgstr "[Ömürler](../lifetimes.md) (50 dakika)" + +#~ msgid "[Welcome](../welcome-day-4.md) (3 minutes)" +#~ msgstr "[Hoş Geldiniz](../welcome-day-4.md) (3 dakika)" + +#~ msgid "[Iterators](../iterators.md) (45 minutes)" +#~ msgstr "[Adımlayıcılar](../iterators.md) (45 dakika)" + +#~ msgid "[Modules](../modules.md) (40 minutes)" +#~ msgstr "[Modüller](../modules.md) (40 dakika)" + +#~ msgid "[Testing](../testing.md) (45 minutes)" +#~ msgstr "[Test Etme](../testing.md) (45 dakika)" + +#~ msgid "[Error Handling](../error-handling.md) (55 minutes)" +#~ msgstr "[Hata İşleme](../error-handling.md) (55 dakika)" + +#~ msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" +#~ msgstr "[Emniyetsiz Rust](../unsafe-rust.md) (1 saat 5 dakika)" + +#~ msgid "Arrow-Left" +#~ msgstr "Yön Oku-Sol" + +#~ msgid "Arrow-Right" +#~ msgstr "Yön Oku-Sağ" + +#~ msgid "Ctrl + Enter" +#~ msgstr "Ctrl + Enter" + +#~ msgid "s" +#~ msgstr "s" + +#~ msgid "You can use " +#~ msgstr "Odak metin kutusundayken kodu yürütmek için " + +#~ msgid "In this session:" +#~ msgstr "Bu oturumda:" + +#~ msgid "[Welcome](./welcome-day-1.md) (5 minutes)" +#~ msgstr "[Hoş Geldiniz](./welcome-day-1.md) (5 dakika)" + +#~ msgid "[Hello, World](./hello-world.md) (15 minutes)" +#~ msgstr "[Merhaba, Dünya](./hello-world.md) (15 dakika)" + +#~ msgid "[Types and Values](./types-and-values.md) (40 minutes)" +#~ msgstr "[Türler ve Değerler](./types-and-values.md) (40 dakika)" + +#~ msgid "[Control Flow Basics](./control-flow-basics.md) (40 minutes)" +#~ msgstr "[Kontrol Akışı Temelleri](./control-flow-basics.md) (40 dakika)" + +#~ msgid "In this segment:" +#~ msgstr "Bu bölümde:" + +#~ msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" +#~ msgstr "[Rust Nedir?](./hello-world/what-is-rust.md) (10 dakika)" + +#~ msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" +#~ msgstr "[Rust'ın Faydaları](./hello-world/benefits.md) (3 dakika)" + +#~ msgid "[Playground](./hello-world/playground.md) (2 minutes)" +#~ msgstr "[Deneme Alanı](./hello-world/playground.md) (2 dakika)" + +#~ msgid "[Hello, World](./types-and-values/hello-world.md) (5 minutes)" +#~ msgstr "[Merhaba, Dünya](./types-and-values/hello-world.md) (5 dakika)" + +#~ msgid "[Variables](./types-and-values/variables.md) (5 minutes)" +#~ msgstr "[Değişkenler](./types-and-values/variables.md) (5 dakika)" + +#~ msgid "[Values](./types-and-values/values.md) (5 minutes)" +#~ msgstr "[Değerler](./types-and-values/values.md) (5 dakika)" + +#~ msgid "[Arithmetic](./types-and-values/arithmetic.md) (3 minutes)" +#~ msgstr "[Aritmetik](./types-and-values/arithmetic.md) (3 dakika)" + +#~ msgid "[Type Inference](./types-and-values/inference.md) (3 minutes)" +#~ msgstr "[Tür Çıkarımı](./types-and-values/inference.md) (3 dakika)" + +#~ msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (15 minutes)" +#~ msgstr "[Alıştırma: Fibonacci](./types-and-values/exercise.md) (15 dakika)" + +#~ msgid "[if Expressions](./control-flow-basics/if.md) (4 minutes)" +#~ msgstr "[if İfadeleri](./control-flow-basics/if.md) (4 dakika)" + +#~ msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" +#~ msgstr "[Döngüler](./control-flow-basics/loops.md) (5 dakika)" + +#~ msgid "" +#~ "[break and continue](./control-flow-basics/break-continue.md) (4 minutes)" +#~ msgstr "" +#~ "[break ve continue](./control-flow-basics/break-continue.md) (4 dakika)" + +#~ msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" +#~ msgstr "[Fonksiyonlar](./control-flow-basics/functions.md) (3 dakika)" + +#~ msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" +#~ msgstr "[Makrolar](./control-flow-basics/macros.md) (2 dakika)" + +#~ msgid "" +#~ "[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (15 " +#~ "minutes)" +#~ msgstr "" +#~ "[Alıştırma: Collatz Sekansı](./control-flow-basics/exercise.md) (15 " +#~ "dakika)" + +#~ msgid "1" +#~ msgstr "1" + +#~ msgid " greater than zero:" +#~ msgstr " sıfırdan büyük sayısı için:" + +#~ msgid "If _n" +#~ msgstr "If _n" + +#~ msgid "i" +#~ msgstr "i" + +#~ msgid "_." +#~ msgstr "_." + +#~ msgid "_ is even, then _n" +#~ msgstr "_ çifttir, o zaman _n" + +#~ msgid "i+1" +#~ msgstr "i+1" + +#~ msgid " = n" +#~ msgstr " = n" + +#~ msgid " / 2_." +#~ msgstr " / 2_." + +#~ msgid "_ is odd, then _n" +#~ msgstr "_ tektir, o zaman _n" + +#~ msgid " = 3 * n" +#~ msgstr " = 3 * n" + +#~ msgid " + 1_." +#~ msgstr " + 1_." + +#~ msgid "_ = 3:" +#~ msgstr "_ = 3:" + +#~ msgid "3 is odd, so _n" +#~ msgstr "3 tektir, yani _n" + +#~ msgid "2" +#~ msgstr "2" + +#~ msgid "_ = 3 * 3 + 1 = 10;" +#~ msgstr "_ = 3 * 3 + 1 = 10;" + +#~ msgid "10 is even, so _n" +#~ msgstr "10 çifttir, yani _n" + +#~ msgid "_ = 10 / 2 = 5;" +#~ msgstr "_ = 10 / 2 = 5;" + +#~ msgid "5 is odd, so _n" +#~ msgstr "5 tektir, yani _n" + +#~ msgid "_ = 3 * 5 + 1 = 16;" +#~ msgstr "_ = 3 * 5 + 1 = 16;" + +#~ msgid "16 is even, so _n" +#~ msgstr "16 çifttir, yani _n" + +#~ msgid "5" +#~ msgstr "5" + +#~ msgid "_ = 16 / 2 = 8;" +#~ msgstr "_ = 16 / 2 = 8;" + +#~ msgid "8 is even, so _n" +#~ msgstr "8 çifttir, yani _n" + +#~ msgid "_ = 8 / 2 = 4;" +#~ msgstr "_ = 8 / 2 = 4;" + +#~ msgid "4 is even, so _n" +#~ msgstr "4 çifttir, yani _n" + +#~ msgid "7" +#~ msgstr "7" + +#~ msgid "_ = 4 / 2 = 2;" +#~ msgstr "_ = 4 / 2 = 2;" + +#~ msgid "2 is even, so _n" +#~ msgstr "2 çifttir, yani _n" + +#~ msgid "_ = 1; and" +#~ msgstr "_ = 1; ve" + +#~ msgid "[Tuples and Arrays](./tuples-and-arrays.md) (35 minutes)" +#~ msgstr "[Demetler ve Diziler](./tuples-and-arrays.md) (35 dakika)" + +#~ msgid "[References](./references.md) (55 minutes)" +#~ msgstr "[Referanslar](../references.md) (55 dakika)" + +#~ msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" +#~ msgstr "[Kullanıcı Tanımlı Türler](./user-defined-types.md) (50 dakika)" + +#~ msgid "[Arrays](./tuples-and-arrays/arrays.md) (5 minutes)" +#~ msgstr "[Diziler](./tuples-and-arrays/arrays.md) (5 dakika)" + +#~ msgid "[Tuples](./tuples-and-arrays/tuples.md) (5 minutes)" +#~ msgstr "[Demetler](./tuples-and-arrays/tuples.md) (5 dakika)" + +#~ msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" +#~ msgstr "[Dizide Dolaşma](./tuples-and-arrays/iteration.md) (3 dakika)" + +#~ msgid "" +#~ "[Patterns and Destructuring](./tuples-and-arrays/destructuring.md) (5 " +#~ "minutes)" +#~ msgstr "" +#~ "[Desenler ve Çözümleme](./tuples-and-arrays/destructuring.md) (5 dakika)" + +#~ msgid "" +#~ "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (15 minutes)" +#~ msgstr "" +#~ "[Alıştırma: İç İçe Diziler](./tuples-and-arrays/exercise.md) (15 dakika)" + +#~ msgid "[Shared References](./references/shared.md) (10 minutes)" +#~ msgstr "[Paylaşılan Referanslar](./references/shared.md) (10 dakika)" + +#~ msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" +#~ msgstr "[Özel Referanslar](./references/exclusive.md) (10 dakika)" + +#~ msgid "[Slices: &\\[T\\]](./references/slices.md) (10 minutes)" +#~ msgstr "[Dilimler: &\\[T\\]](../references/slices.md) (10 dakika)" + +#~ msgid "[Strings](./references/strings.md) (10 minutes)" +#~ msgstr "[Dizgeler](./references/strings.md) (10 dakika)" + +#~ msgid "[Exercise: Geometry](./references/exercise.md) (15 minutes)" +#~ msgstr "[Alıştırma: Geometri](./references/exercise.md) (15 dakika)" + +#~ msgid "" +#~ "Question: What happens if you modify `a[3]` right before printing `s`?" +#~ msgstr "" +#~ "Soru: `a[3]`'ü `s`'yi yazdırmadan hemen önce değiştirirseniz (modify) ne " +#~ "olur?" + +#~ 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 "" +#~ "`a[3]`'ün değiştirilmesiyle (modify) ilgili soru ilginç bir tartışmayı " +#~ "ateşleyebilir, ancak cevap şu ki, bellek emniyeti nedenleriyle yürütmenin " +#~ "(execution) bu noktasında bunu `a` aracılığıyla yapamazsınız, ancak " +#~ "verileri hem `a`'dan hem de `s`'den emniyetli bir şekilde " +#~ "okuyabilirsiniz. Dilim (slice) oluşturulmadan önce ve dilim " +#~ "kullanılmayacaksa`println`'den sonra `a[3]` değiştirilebilir." + +#~ msgid "`String` is an owned, heap-allocated buffer of UTF-8 bytes." +#~ msgstr "" +#~ "`String`, UTF-8 olarak kodlanmış baytların dinamik bellekten tahsis " +#~ "edildiği (heap-allocated) sahipli (owned) bir arabellektir (buffer)" + +#~ msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" +#~ msgstr "" +#~ "[İsimli Yapılar (Named Structs)](./user-defined-types/named-structs.md) " +#~ "(10 dakika)" + +#~ msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" +#~ msgstr "[Demet Yapıları](./user-defined-types/tuple-structs.md) (10 dakika)" + +#~ msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" +#~ msgstr "[Enum'lar](./user-defined-types/enums.md) (5 dakika)" + +#~ msgid "[Static](./user-defined-types/static.md) (5 minutes)" +#~ msgstr "[Static](./user-defined-types/static.md) (5 dakika)" + +#~ msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" +#~ msgstr "[Tür Eş İsimleri](./user-defined-types/aliases.md) (2 minutes)" + +#~ msgid "" +#~ "[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" +#~ msgstr "" +#~ "[Alıştırma: Asansör Olayları](./user-Definition-types/exercise.md) (15 " +#~ "dakika)" + +#~ msgid "[Methods and Traits](./methods-and-traits.md) (50 minutes)" +#~ msgstr "[Metotlar ve Özellikler](../methods-and-traits.md) (50 dakika)" + +#~ msgid "[Traits](./methods-and-traits/traits.md) (15 minutes)" +#~ msgstr "[Özellikler](../methods-and-traits/traits.md) (15 dakika)" + +#~ msgid "Including 10 minute breaks, this session should take about 4 hours" +#~ msgstr "Bu oturum 10 dakikalık aralar dahil yaklaşık 4 saat sürmelidir" + +#~ msgid "This segment should take about 1 hour and 40 minutes" +#~ msgstr "Bu bölüm yaklaşık 1 saat 40 dakika sürmeli" + +#~ msgid "Niche Optimization" +#~ msgstr "Niche Optimizasyonu" + +#~ msgid "[Borrowing](./borrowing.md) (55 minutes)" +#~ msgstr "[Ödünç Alma](../borrowing.md) (55 dakika)" + +#~ msgid "[Lifetimes](./lifetimes.md) (50 minutes)" +#~ msgstr "[Ömürler](./lifetimes.md) (50 dakika)" + +#~ msgid "" +#~ "[Lifetime Annotations](./lifetimes/lifetime-annotations.md) (10 minutes)" +#~ msgstr "" +#~ "[Ömür için Ek Açıklamalar](./lifetimes/lifetime-annotations.md) (10 " +#~ "dakika)" + +#~ msgid "[Lifetime Elision](./lifetimes/lifetime-elision.md) (5 minutes)" +#~ msgstr "" +#~ "[Ömür Atlaması (Elision)](./lifetimes/lifetime-elision.md) (5 dakika)" + +#~ msgid "[Struct Lifetimes](./lifetimes/struct-lifetimes.md) (5 minutes)" +#~ msgstr "[Yapı Ömürleri](./lifetimes/struct-lifetimes.md) (5 dakika)" + +#~ msgid "[Exercise: Protobuf Parsing](./lifetimes/exercise.md) (30 minutes)" +#~ msgstr "" +#~ "[Alıştırma: Protobuf Ayrıştırma](./lifetimes/exercise.md) (30 dakika)" + +#~ msgid "b\"hello\"" +#~ msgstr "b\"merhaba\"" + +#~ msgid "Luhn Algorithm" +#~ msgstr "Luhn Algrotiması" + +#~ msgid "_Generated trait_:" +#~ msgstr "_Generated trait_:" + +#~ msgid "" +#~ "Including 10 minute breaks, this session should take about 2 hours and 55 " +#~ "minutes" +#~ msgstr "" +#~ "Bu oturum 10 dakikalık aralar dahil yaklaşık 2 saat 55 dakika sürmeli" + +#~ msgid "Hard-code both functions to operate on 3 × 3 matrices." +#~ msgstr "" +#~ "Her iki işlevi de 3 × 3 matris üzerinde çalışacak şekilde sabit kodlayın." + +#~ msgid "// Undefined behavior if abs misbehaves.\n" +#~ msgstr "// Undefined behavior if abs misbehaves.\n" + #~ msgid "Static and Const" #~ msgstr "Static ve Const" @@ -20017,9 +22220,6 @@ msgstr "" #~ "karakter sınırında bitmiyor, bu nedenle program paniğe kapılıyor. Hata " #~ "mesajına bağlı olarak bunu uygun bir aralığa ayarlayın." -#~ msgid "Small Example" -#~ msgstr "Küçük Örnek" - #~ msgid "Why Rust?" #~ msgstr "Neden Rust?" @@ -20065,21 +22265,12 @@ msgstr "" #~ msgid "Enum Sizes" #~ msgstr "Enum Boyutları" -#~ msgid "Novel Control Flow" -#~ msgstr "Yeni Kontrol Akışları" - #~ msgid "if let expressions" #~ msgstr "if let İfadeleri" #~ msgid "while let expressions" #~ msgstr "while let İfadeleri" -#~ msgid "match expressions" -#~ msgstr "match ifadeleri" - -#~ msgid "Destructuring Structs" -#~ msgstr "Yapıların (Struct) Çözümlenmesi" - #~ msgid "Destructuring Arrays" #~ msgstr "Dizilerin Çözümlenmesi" @@ -20122,57 +22313,30 @@ msgstr "" #~ msgid "Field Shorthand Syntax" #~ msgstr "Alanlara İlk Değer Verme Kısaltması'nın Sözdizimi (Syntax)" -#~ msgid "Method Receiver" -#~ msgstr "Metot Alıcısı" - #~ msgid "Storing Books" #~ msgstr "Kitapların Saklanması" #~ msgid "Option and Result" #~ msgstr "Option ve Result" -#~ msgid "Vec" -#~ msgstr "Vec" - -#~ msgid "HashMap" -#~ msgstr "HashMap" - #~ msgid "Box" #~ msgstr "Box" #~ msgid "Recursive Data Types" #~ msgstr "Özyinelemeli Veri Türleri" -#~ msgid "Rc" -#~ msgstr "Rc" - #~ msgid "Iterators and Ownership" #~ msgstr "Adımlayıcılar (Iterators) ve Sahiplik" -#~ msgid "Strings and Iterators" -#~ msgstr "Dizeler (Stringler) ve Adımlayıcılar (Iterators)" - #~ msgid "Generic Methods" #~ msgstr "Jenerik Metotlar" -#~ msgid "Monomorphization" -#~ msgstr "Monomorfizasyon" - #~ msgid "Default Methods" #~ msgstr "Varsayılan Metotlar" -#~ msgid "impl Trait" -#~ msgstr "impl Trait" - #~ msgid "Important Traits" #~ msgstr "Önemli Özellikler (Traits)" -#~ msgid "Iterator" -#~ msgstr "Iterator" - -#~ msgid "From and Into" -#~ msgstr "From ve Into" - #~ msgid "Default" #~ msgstr "Default" @@ -20182,9 +22346,6 @@ msgstr "" #~ msgid "Closures: Fn, FnMut, FnOnce" #~ msgstr "Kapanışlar (Closures): Fn, FnMut, FnOnce" -#~ msgid "A Simple GUI Library" -#~ msgstr "Basit bir GUI Kütüphanesi" - #~ msgid "Points and Polygons" #~ msgstr "Noktalar ve Çokgenler" @@ -20221,9 +22382,6 @@ msgstr "" #~ msgid "zerocopy" #~ msgstr "zerocopy" -#~ msgid "aarch64-paging" -#~ msgstr "aarch64-paging" - #~ msgid "buddy_system_allocator" #~ msgstr "buddy_system_allocator" @@ -20233,27 +22391,6 @@ msgstr "" #~ msgid "spin" #~ msgstr "spin" -#~ msgid "Send and Sync" -#~ msgstr "Send ve Sync" - -#~ msgid "Send" -#~ msgstr "Send" - -#~ msgid "Sync" -#~ msgstr "Sync" - -#~ msgid "Arc" -#~ msgstr "Arc" - -#~ msgid "Mutex" -#~ msgstr "Mutex" - -#~ msgid "async/await" -#~ msgstr "async/await" - -#~ msgid "Pin" -#~ msgstr "Pin" - #~ msgid "Day 1 Morning" #~ msgstr "1. Gün Sabah" @@ -20295,8 +22432,8 @@ msgstr "" #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." #~ msgstr "" -#~ "3. Gün: Jenerikler, özellikler (traits), hata işleme, testler ve güvenli " -#~ "olmayan (unsafe) Rust." +#~ "3. Gün: Jenerikler, özellikler (traits), hata işleme, testler ve " +#~ "emniyetsiz (unsafe) Rust." #~ msgid "" #~ "```rust,editable\n" @@ -20487,7 +22624,8 @@ msgstr "" #~ msgid "" #~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" -#~ "(Güvenli) Rust'ta bellek sızıntılarının oluşması mümkündür. Bazı örnekler:" +#~ "(Emniyetli) Rust'ta bellek sızıntılarının oluşması mümkündür. Bazı " +#~ "örnekler:" #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." @@ -20770,9 +22908,6 @@ msgstr "" #~ msgid "control flow:" #~ msgstr "kontrol akışı:" -#~ msgid "enumeration:" -#~ msgstr "numaralandırma:" - #~ msgid "error handling:" #~ msgstr "hata işleme:"