msgid "" msgstr "" "Project-Id-Version: Comprehensive Rust 🊀\n" "POT-Creation-Date: 2024-11-23T04:33:49Z\n" "PO-Revision-Date: 2023-06-06 13:18+0900\n" "Last-Translator: Kenta Aratani \n" "Language-Team: Japanese \n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.3.2\n" #: src/SUMMARY.md src/index.md msgid "Welcome to Comprehensive Rust 🊀" msgstr "Comprehensive Rust 🊀 ぞようこそ" #: src/SUMMARY.md src/running-the-course.md msgid "Running the Course" msgstr "講座の運営に぀いお" #: src/SUMMARY.md src/running-the-course/course-structure.md msgid "Course Structure" msgstr "講座の構成" #: src/SUMMARY.md src/running-the-course/keyboard-shortcuts.md msgid "Keyboard Shortcuts" msgstr "キヌボヌド ショヌトカット" #: src/SUMMARY.md src/running-the-course/translations.md msgid "Translations" msgstr "翻蚳" #: src/SUMMARY.md src/cargo.md msgid "Using Cargo" msgstr "Cargoの䜿甚" #: src/SUMMARY.md msgid "Rust Ecosystem" msgstr "Rust ゚コシステム" #: src/SUMMARY.md msgid "Code Samples" msgstr "コヌドサンプル" #: src/SUMMARY.md msgid "Running Cargo Locally" msgstr "ロヌカル環境での実行" #: src/SUMMARY.md msgid "Day 1: Morning" msgstr "Day 1 AM" #: 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 "ようこそ" #: 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 "Hello, World" #: src/SUMMARY.md src/hello-world.md src/hello-world/what-is-rust.md msgid "What is Rust?" msgstr "Rustずは" #: src/SUMMARY.md src/hello-world.md src/hello-world/benefits.md msgid "Benefits of Rust" msgstr "Rustのメリット" #: src/SUMMARY.md src/hello-world.md src/hello-world/playground.md msgid "Playground" msgstr "プレむグラりンド" #: 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 "型ず倀" #: src/SUMMARY.md src/types-and-values.md src/types-and-values/variables.md msgid "Variables" msgstr "倉数" #: src/SUMMARY.md src/types-and-values.md src/types-and-values/values.md msgid "Values" msgstr "倀" #: src/SUMMARY.md src/types-and-values.md src/types-and-values/arithmetic.md msgid "Arithmetic" msgstr "算術" #: src/SUMMARY.md src/types-and-values.md src/types-and-values/inference.md msgid "Type Inference" msgstr "型掚論" #: src/SUMMARY.md src/types-and-values.md src/types-and-values/exercise.md msgid "Exercise: Fibonacci" msgstr "挔習: フィボナッチ" #: src/SUMMARY.md src/types-and-values/solution.md #: 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/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 #: src/testing/solution.md src/error-handling/solution.md #: src/unsafe-rust/solution.md msgid "Solution" msgstr "解答" #: 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 "制埡フロヌの基本" #: src/SUMMARY.md #, fuzzy msgid "`if` Expressions" msgstr "`if` 匏" #: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/loops.md msgid "Loops" msgstr "ルヌプ" #: src/SUMMARY.md src/control-flow-basics/loops/for.md msgid "`for`" msgstr "`for`" #: src/SUMMARY.md src/control-flow-basics/loops/loop.md msgid "`loop`" msgstr "`loop`" #: src/SUMMARY.md src/control-flow-basics/break-continue.md msgid "`break` and `continue`" msgstr "`break` ず `continue`" #: src/SUMMARY.md src/control-flow-basics/break-continue/labels.md msgid "Labels" msgstr "" #: src/SUMMARY.md src/control-flow-basics.md #: src/control-flow-basics/blocks-and-scopes.md msgid "Blocks and Scopes" msgstr "ブロックずスコヌプ" #: src/SUMMARY.md src/control-flow-basics/blocks-and-scopes/scopes.md msgid "Scopes and Shadowing" msgstr "スコヌプずシャドヌむング" #: src/SUMMARY.md src/control-flow-basics.md #: src/control-flow-basics/functions.md msgid "Functions" msgstr "関数" #: src/SUMMARY.md src/control-flow-basics.md src/control-flow-basics/macros.md msgid "Macros" msgstr "マクロ" #: src/SUMMARY.md src/control-flow-basics.md #: src/control-flow-basics/exercise.md msgid "Exercise: Collatz Sequence" msgstr "挔習: コラッツ数列" #: src/SUMMARY.md msgid "Day 1: Afternoon" msgstr "Day 1 PM" #: 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 "タプルず配列" #: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/arrays.md msgid "Arrays" msgstr "配列" #: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/tuples.md msgid "Tuples" msgstr "タプル" #: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/iteration.md msgid "Array Iteration" msgstr "配列のむテレヌト" #: src/SUMMARY.md src/tuples-and-arrays.md #: src/tuples-and-arrays/destructuring.md #, fuzzy msgid "Patterns and Destructuring" msgstr "列挙型線" #: src/SUMMARY.md src/tuples-and-arrays.md src/tuples-and-arrays/exercise.md msgid "Exercise: Nested Arrays" msgstr "挔習: ネストされた配列" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-1-afternoon.md src/references.md msgid "References" msgstr "参照" #: src/SUMMARY.md src/references.md src/references/shared.md msgid "Shared References" msgstr "共有参照" #: src/SUMMARY.md src/references.md src/references/exclusive.md msgid "Exclusive References" msgstr "排他参照" #: src/SUMMARY.md src/references.md src/references/slices.md msgid "Slices" msgstr "Slices" #: src/SUMMARY.md src/references.md src/references/strings.md msgid "Strings" msgstr "文字列" #: src/SUMMARY.md src/references.md src/references/exercise.md msgid "Exercise: Geometry" msgstr "挔習: ゞオメトリ" #: 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 "ナヌザヌ定矩型" #: src/SUMMARY.md src/user-defined-types.md #: src/user-defined-types/named-structs.md #, fuzzy msgid "Named Structs" msgstr "構造䜓structs" #: src/SUMMARY.md src/user-defined-types.md #: src/user-defined-types/tuple-structs.md msgid "Tuple Structs" msgstr "タプル構造䜓" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/enums.md #: src/pattern-matching/destructuring-enums.md msgid "Enums" msgstr "列挙型enums" #: src/SUMMARY.md #, fuzzy msgid "Const" msgstr "定数" #: src/SUMMARY.md src/user-defined-types.md msgid "Static" msgstr "静的" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/aliases.md msgid "Type Aliases" msgstr "型゚むリアス" #: src/SUMMARY.md src/user-defined-types.md src/user-defined-types/exercise.md msgid "Exercise: Elevator Events" msgstr "挔習: ゚レベヌタヌでのむベント" #: src/SUMMARY.md msgid "Day 2: Morning" msgstr "Day 2 AM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2.md src/pattern-matching.md msgid "Pattern Matching" msgstr "パタヌンマッチング" #: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/match.md msgid "Matching Values" msgstr "" #: src/SUMMARY.md src/pattern-matching.md msgid "Destructuring Structs" msgstr "構造䜓線" #: src/SUMMARY.md src/pattern-matching.md #, fuzzy msgid "Destructuring Enums" msgstr "列挙型線" #: src/SUMMARY.md src/pattern-matching.md #: src/pattern-matching/let-control-flow.md #, fuzzy msgid "Let Control Flow" msgstr "制埡フロヌ" #: src/SUMMARY.md src/pattern-matching.md src/pattern-matching/exercise.md msgid "Exercise: Expression Evaluation" msgstr "挔習: 匏の評䟡" #: 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 "" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/methods.md msgid "Methods" msgstr "メ゜ッド" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/traits.md msgid "Traits" msgstr "トレむトtrait" #: src/SUMMARY.md src/methods-and-traits/traits/implementing.md #, fuzzy msgid "Implementing Traits" msgstr "Unsafeなトレむトの実装" #: src/SUMMARY.md src/methods-and-traits/traits/supertraits.md #, fuzzy msgid "Supertraits" msgstr "他のトレむト" #: src/SUMMARY.md src/methods-and-traits/traits/associated-types.md #, fuzzy msgid "Associated Types" msgstr "共有の型" #: src/SUMMARY.md src/methods-and-traits.md src/methods-and-traits/deriving.md #, fuzzy msgid "Deriving" msgstr "トレむトの導出" #: src/SUMMARY.md src/methods-and-traits.md msgid "Exercise: Generic Logger" msgstr "挔習: ゞェネリックなロガヌ" #: src/SUMMARY.md msgid "Day 2: Afternoon" msgstr "Day 2 PM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/generics.md msgid "Generics" msgstr "ゞェネリクスgenerics" #: src/SUMMARY.md src/generics.md src/generics/generic-functions.md #, fuzzy msgid "Generic Functions" msgstr "Extern関数" #: src/SUMMARY.md src/generics.md src/generics/generic-data.md msgid "Generic Data Types" msgstr "ゞェネリックデヌタ型" #: src/SUMMARY.md src/generics/generic-traits.md #, fuzzy msgid "Generic Traits" msgstr "ゞェネリクスgenerics" #: src/SUMMARY.md src/generics.md src/generics/trait-bounds.md msgid "Trait Bounds" msgstr "トレむト制玄" #: src/SUMMARY.md src/generics/impl-trait.md msgid "`impl Trait`" msgstr "`impl Trait`" #: src/SUMMARY.md src/generics/dyn-trait.md #, fuzzy msgid "`dyn Trait`" msgstr "`impl Trait`" #: src/SUMMARY.md src/generics/exercise.md msgid "Exercise: Generic `min`" msgstr "挔習: ゞェネリックな `min`" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-types.md #, fuzzy msgid "Standard Library Types" msgstr "暙準ラむブラリ" #: src/SUMMARY.md src/std-types.md src/std-types/std.md msgid "Standard Library" msgstr "暙準ラむブラリ" #: src/SUMMARY.md src/std-types.md src/std-types/docs.md msgid "Documentation" msgstr "ドキュメント" #: src/SUMMARY.md msgid "`Option`" msgstr "`Option`" #: src/SUMMARY.md src/error-handling/result.md msgid "`Result`" msgstr "`Result`" #: src/SUMMARY.md src/android/aidl/types/primitives.md #: src/android/interoperability/cpp/type-mapping.md msgid "`String`" msgstr "`String`" #: src/SUMMARY.md src/std-types/vec.md msgid "`Vec`" msgstr "`Vec`" #: src/SUMMARY.md src/std-types/hashmap.md src/bare-metal/no_std.md msgid "`HashMap`" msgstr "`HashMap`" #: src/SUMMARY.md src/std-types.md src/std-types/exercise.md msgid "Exercise: Counter" msgstr "挔習: カりンタヌ" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-2-afternoon.md src/std-traits.md #, fuzzy msgid "Standard Library Traits" msgstr "暙準ラむブラリ" #: src/SUMMARY.md src/std-traits.md src/std-traits/comparisons.md #: src/concurrency/welcome-async.md msgid "Comparisons" msgstr "他の蚀語ずの比范" #: src/SUMMARY.md src/std-traits.md src/std-traits/operators.md #, fuzzy msgid "Operators" msgstr "むテレヌタ" #: src/SUMMARY.md src/std-traits/from-and-into.md msgid "`From` and `Into`" msgstr "`From` ず `Into`" #: src/SUMMARY.md src/std-traits.md src/std-traits/casting.md #, fuzzy msgid "Casting" msgstr "テスト" #: src/SUMMARY.md src/std-traits/read-and-write.md msgid "`Read` and `Write`" msgstr "`Read` ず `Write`" #: src/SUMMARY.md msgid "`Default`, struct update syntax" msgstr "`Default`、構造䜓曎新蚘法" #: src/SUMMARY.md src/std-traits.md src/std-traits/closures.md msgid "Closures" msgstr "クロヌゞャ" #: src/SUMMARY.md src/std-traits.md src/std-traits/exercise.md msgid "Exercise: ROT13" msgstr "挔習: ROT13暗号" #: src/SUMMARY.md msgid "Day 3: Morning" msgstr "Day 3 AM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3.md src/memory-management.md msgid "Memory Management" msgstr "メモリ管理" #: src/SUMMARY.md src/memory-management.md src/memory-management/review.md msgid "Review of Program Memory" msgstr "プログラム メモリの芋盎し" #: src/SUMMARY.md src/memory-management.md src/memory-management/approaches.md #, fuzzy msgid "Approaches to Memory Management" msgstr "Rustのメモリ管理" #: src/SUMMARY.md src/memory-management.md src/memory-management/ownership.md msgid "Ownership" msgstr "所有暩" #: src/SUMMARY.md src/memory-management.md src/memory-management/move.md msgid "Move Semantics" msgstr "ムヌブセマンティクス" #: src/SUMMARY.md msgid "`Clone`" msgstr "`Clone`" #: src/SUMMARY.md src/memory-management.md src/memory-management/copy-types.md msgid "Copy Types" msgstr "Copy 型" #: src/SUMMARY.md msgid "`Drop`" msgstr "`Drop`" #: src/SUMMARY.md src/memory-management.md src/memory-management/exercise.md msgid "Exercise: Builder Type" msgstr "挔習: ビルダヌ型" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3.md src/smart-pointers.md msgid "Smart Pointers" msgstr "スマヌトポむンタ" #: src/SUMMARY.md src/smart-pointers/box.md #: src/android/interoperability/cpp/type-mapping.md msgid "`Box`" msgstr "`Box`" #: src/SUMMARY.md src/smart-pointers/rc.md msgid "`Rc`" msgstr "`Rc`" #: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/trait-objects.md #, fuzzy msgid "Owned Trait Objects" msgstr "トレむトオブゞェクト" #: src/SUMMARY.md src/smart-pointers.md src/smart-pointers/exercise.md msgid "Exercise: Binary Tree" msgstr "挔習: バむナリツリヌ" #: src/SUMMARY.md msgid "Day 3: Afternoon" msgstr "Day 3 PM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3-afternoon.md src/borrowing.md msgid "Borrowing" msgstr "借甚" #: src/SUMMARY.md src/borrowing.md src/borrowing/shared.md #, fuzzy msgid "Borrowing a Value" msgstr "借甚" #: src/SUMMARY.md src/borrowing.md src/borrowing/borrowck.md #, fuzzy msgid "Borrow Checking" msgstr "借甚" #: src/SUMMARY.md src/borrowing.md src/borrowing/examples.md msgid "Borrow Errors" msgstr "" #: src/SUMMARY.md src/borrowing.md src/borrowing/interior-mutability.md msgid "Interior Mutability" msgstr "内郚可倉性" #: src/SUMMARY.md src/borrowing.md src/borrowing/exercise.md msgid "Exercise: Health Statistics" msgstr "挔習: 健康に関する統蚈" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-3-afternoon.md src/lifetimes.md #, fuzzy msgid "Lifetimes" msgstr "ラむフタむム" #: src/SUMMARY.md src/lifetimes.md src/lifetimes/lifetime-annotations.md msgid "Lifetime Annotations" msgstr "関数ずラむフタむム" #: src/SUMMARY.md src/lifetimes.md #, fuzzy msgid "Lifetime Elision" msgstr "ラむフタむム" #: src/SUMMARY.md src/lifetimes.md #, fuzzy msgid "Struct Lifetimes" msgstr "ラむフタむム" #: src/SUMMARY.md src/lifetimes.md src/lifetimes/exercise.md msgid "Exercise: Protobuf Parsing" msgstr "挔習: Protobufの解析" #: src/SUMMARY.md msgid "Day 4: Morning" msgstr "Day 4 AM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4.md src/iterators.md msgid "Iterators" msgstr "むテレヌタ" #: src/SUMMARY.md src/iterators/iterator.md src/bare-metal/no_std.md msgid "`Iterator`" msgstr "`Iterator`" #: src/SUMMARY.md src/iterators/intoiterator.md msgid "`IntoIterator`" msgstr "`IntoIterator`" #: src/SUMMARY.md msgid "`FromIterator`" msgstr "`FromIterator`" #: src/SUMMARY.md src/iterators.md src/iterators/exercise.md msgid "Exercise: Iterator Method Chaining" msgstr "挔習: むテレヌタのメ゜ッドチェヌン" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4.md src/modules.md src/modules/modules.md #, fuzzy msgid "Modules" msgstr "モゞュヌル タむプ" #: src/SUMMARY.md src/modules.md src/modules/filesystem.md msgid "Filesystem Hierarchy" msgstr "ファむルシステム階局" #: src/SUMMARY.md src/modules.md src/modules/visibility.md msgid "Visibility" msgstr "可芖性" #: src/SUMMARY.md msgid "`use`, `super`, `self`" msgstr "`use`、`super`、`self`" #: src/SUMMARY.md src/modules.md src/modules/exercise.md #, fuzzy msgid "Exercise: Modules for a GUI Library" msgstr "[挔習: GUI ラむブラリのモゞュヌル](./modules/exercise.md)15 分" #: 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 "テスト" #: src/SUMMARY.md src/testing.md msgid "Test Modules" msgstr "テストモゞュヌル" #: src/SUMMARY.md src/testing.md src/testing/other.md #, fuzzy msgid "Other Types of Tests" msgstr "他のプロゞェクト" #: src/SUMMARY.md src/testing.md src/testing/lints.md msgid "Compiler Lints and Clippy" msgstr "コンパむラの Lints ず Clippy" #: src/SUMMARY.md src/testing.md src/testing/exercise.md #, fuzzy msgid "Exercise: Luhn Algorithm" msgstr "Luhnアルゎリズム" #: src/SUMMARY.md msgid "Day 4: Afternoon" msgstr "Day 4 PM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/welcome-day-4-afternoon.md src/error-handling.md msgid "Error Handling" msgstr "゚ラヌ凊理" #: src/SUMMARY.md src/error-handling.md src/error-handling/panics.md msgid "Panics" msgstr "パニックpanic" #: src/SUMMARY.md src/error-handling.md src/error-handling/try.md #, fuzzy msgid "Try Operator" msgstr "Iterator" #: src/SUMMARY.md src/error-handling.md src/error-handling/try-conversions.md #, fuzzy msgid "Try Conversions" msgstr "暗黙的な型倉換" #: src/SUMMARY.md msgid "`Error` Trait" msgstr "`Error`トレむト" #: 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 "挔習: `Result` を䜿甚した曞き換え" #: 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 "Unsafe Rust" #: src/SUMMARY.md src/unsafe-rust.md #, fuzzy msgid "Unsafe" msgstr "Unsafe Rust" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/dereferencing.md msgid "Dereferencing Raw Pointers" msgstr "生ポむンタの参照倖し" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/mutable-static.md msgid "Mutable Static Variables" msgstr "可倉なstatic倉数" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unions.md msgid "Unions" msgstr "共甚䜓" #: src/SUMMARY.md src/unsafe-rust.md src/unsafe-rust/unsafe-functions.md msgid "Unsafe Functions" msgstr "Unsafe関数の呌び出し" #: src/SUMMARY.md src/unsafe-rust.md msgid "Unsafe Traits" msgstr "Unsafeなトレむトの実装" #: src/SUMMARY.md src/unsafe-rust.md msgid "Exercise: FFI Wrapper" msgstr "挔習: FFIラッパヌ" #: src/SUMMARY.md msgid "Android" msgstr "Android" #: src/SUMMARY.md src/android/setup.md src/chromium/setup.md msgid "Setup" msgstr "セットアップ" #: src/SUMMARY.md src/android/build-rules.md msgid "Build Rules" msgstr "ビルドのルヌル" #: src/SUMMARY.md msgid "Binary" msgstr "バむナリ" #: src/SUMMARY.md msgid "Library" msgstr "ラむブラリ" #: src/SUMMARY.md src/android/aidl.md msgid "AIDL" msgstr "AIDLAndroidむンタヌフェむス定矩蚀語" #: src/SUMMARY.md src/android/aidl/birthday-service.md #, fuzzy msgid "Birthday Service Tutorial" msgstr "/** 誕生日サヌビスのむンタヌフェヌス。*/" #: src/SUMMARY.md msgid "Interface" msgstr "むンタヌフェむス" #: src/SUMMARY.md msgid "Service API" msgstr "" #: src/SUMMARY.md #, fuzzy msgid "Service" msgstr "サヌバ" #: src/SUMMARY.md msgid "Server" msgstr "サヌバ" #: src/SUMMARY.md src/android/aidl/example-service/deploy.md msgid "Deploy" msgstr "デプロむ" #: src/SUMMARY.md msgid "Client" msgstr "クラむアント" #: src/SUMMARY.md src/android/aidl/example-service/changing-definition.md msgid "Changing API" msgstr "APIの倉曎" #: src/SUMMARY.md #, fuzzy msgid "Updating Implementations" msgstr "実装" #: src/SUMMARY.md #, fuzzy msgid "AIDL Types" msgstr "型" #: src/SUMMARY.md src/android/aidl/types/primitives.md msgid "Primitive Types" msgstr "" #: src/SUMMARY.md src/android/aidl/types/arrays.md #, fuzzy msgid "Array Types" msgstr "配列" #: src/SUMMARY.md src/android/aidl/types/objects.md #, fuzzy msgid "Sending Objects" msgstr "トレむトオブゞェクト" #: src/SUMMARY.md src/android/aidl/types/parcelables.md #, fuzzy msgid "Parcelables" msgstr "倉数" #: src/SUMMARY.md src/android/aidl/types/file-descriptor.md msgid "Sending Files" msgstr "" #: src/SUMMARY.md src/android/testing/googletest.md msgid "GoogleTest" msgstr "GoogleTest" #: src/SUMMARY.md src/android/testing/mocking.md msgid "Mocking" msgstr "モック" #: src/SUMMARY.md src/android/logging.md src/bare-metal/aps/logging.md msgid "Logging" msgstr "ログ出力" #: src/SUMMARY.md src/android/interoperability.md msgid "Interoperability" msgstr "盞互運甚性" #: src/SUMMARY.md msgid "With C" msgstr "C" #: src/SUMMARY.md msgid "Calling C with Bindgen" msgstr "BindgenによるCの呌び出し" #: src/SUMMARY.md msgid "Calling Rust from C" msgstr "CからRust呌び出し" #: src/SUMMARY.md src/android/interoperability/cpp.md msgid "With C++" msgstr "C++" #: src/SUMMARY.md src/android/interoperability/cpp/bridge.md #, fuzzy msgid "The Bridge Module" msgstr "テストモゞュヌル" #: src/SUMMARY.md msgid "Rust Bridge" msgstr "Rustブリッゞ" #: src/SUMMARY.md src/android/interoperability/cpp/generated-cpp.md msgid "Generated C++" msgstr "生成された C++" #: src/SUMMARY.md msgid "C++ Bridge" msgstr "C++ ブリッゞ" #: src/SUMMARY.md src/android/interoperability/cpp/shared-types.md msgid "Shared Types" msgstr "共有の型" #: src/SUMMARY.md src/android/interoperability/cpp/shared-enums.md msgid "Shared Enums" msgstr "共有の列挙型" #: src/SUMMARY.md src/android/interoperability/cpp/rust-result.md #, fuzzy msgid "Rust Error Handling" msgstr "゚ラヌ凊理" #: src/SUMMARY.md src/android/interoperability/cpp/cpp-exception.md #, fuzzy msgid "C++ Error Handling" msgstr "゚ラヌ凊理" #: src/SUMMARY.md src/android/interoperability/cpp/type-mapping.md msgid "Additional Types" msgstr "その他の型" #: src/SUMMARY.md msgid "Building for Android: C++" msgstr "Android 向けのビルド: C++" #: src/SUMMARY.md msgid "Building for Android: Genrules" msgstr "Android 向けのビルド: Genrules" #: src/SUMMARY.md msgid "Building for Android: Rust" msgstr "Android 向けのビルド: Rust" #: src/SUMMARY.md msgid "With Java" msgstr "Java" #: src/SUMMARY.md msgid "Chromium" msgstr "Chromium" #: src/SUMMARY.md src/chromium/cargo.md msgid "Comparing Chromium and Cargo Ecosystems" msgstr "Chromium ず Cargo の゚コシステムの比范" #: src/SUMMARY.md msgid "Policy" msgstr "ポリシヌ" #: src/SUMMARY.md #, fuzzy msgid "Unsafe Code" msgstr "Unsafe Rust" #: src/SUMMARY.md src/chromium/build-rules/depending.md msgid "Depending on Rust Code from Chromium C++" msgstr "Chromium C++からRustのコヌドに䟝存させる" #: src/SUMMARY.md src/chromium/build-rules/vscode.md msgid "Visual Studio Code" msgstr "Visual Studio Code" #: src/SUMMARY.md src/exercises/chromium/third-party.md msgid "Exercise" msgstr "挔習" #: src/SUMMARY.md src/chromium/testing/rust-gtest-interop.md msgid "`rust_gtest_interop` Library" msgstr "`rust_gtest_interop` ラむブラリ" #: src/SUMMARY.md src/chromium/testing/build-gn.md msgid "GN Rules for Rust Tests" msgstr "Rust テスト甚の GN ルヌル" #: src/SUMMARY.md src/chromium/testing/chromium-import-macro.md msgid "`chromium::import!` Macro" msgstr "`chromium::import!` マクロ" #: src/SUMMARY.md src/chromium/interoperability-with-cpp.md #, fuzzy msgid "Interoperability with C++" msgstr "C ずの盞互運甚性" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy msgid "Example Bindings" msgstr "䟋" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Limitations of CXX" msgstr "CXXの限界" #: src/SUMMARY.md src/chromium/interoperability-with-cpp/error-handling.md #, fuzzy msgid "CXX Error Handling" msgstr "゚ラヌ凊理" #: src/SUMMARY.md #, fuzzy msgid "Error Handling: QR Example" msgstr "゚ラヌ凊理" #: src/SUMMARY.md #, fuzzy msgid "Error Handling: PNG Example" msgstr "゚ラヌ凊理" #: src/SUMMARY.md msgid "Using CXX in Chromium" msgstr "Chromium で CXX を䜿甚する" #: src/SUMMARY.md src/chromium/adding-third-party-crates.md msgid "Adding Third Party Crates" msgstr "サヌドパヌティのクレヌトを远加する" #: src/SUMMARY.md msgid "Configuring Cargo.toml" msgstr "Cargo.toml を構成する" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "Configuring `gnrt_config.toml`" msgstr "`gnrt_config.toml` を構成する" #: src/SUMMARY.md src/chromium/adding-third-party-crates/downloading-crates.md msgid "Downloading Crates" msgstr "クレヌトをダりンロヌドする" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Generating `gn` Build Rules" msgstr "`gn` ビルドルヌルを生成する" #: src/SUMMARY.md src/chromium/adding-third-party-crates/resolving-problems.md msgid "Resolving Problems" msgstr "問題を解決する" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "Build Scripts Which Generate Code" msgstr "コヌドを生成するビルドスクリプト" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Build Scripts Which Build C++ or Take Arbitrary Actions" msgstr "C++をビルドする、もしくは、任意のアクションを実行するビルドスクリプト" #: src/SUMMARY.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Depending on a Crate" msgstr "クレヌトぞの䟝存を蚭定する" #: src/SUMMARY.md msgid "Reviews and Audits" msgstr "審査ず監査" #: src/SUMMARY.md msgid "Checking into Chromium Source Code" msgstr "Chromium ゜ヌスコヌドにチェックむンする" #: src/SUMMARY.md src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "Keeping Crates Up to Date" msgstr "クレヌトを最新の状態に保぀" #: src/SUMMARY.md msgid "Bringing It Together - Exercise" msgstr "たずめ - 挔習" #: src/SUMMARY.md src/exercises/chromium/solutions.md #, fuzzy msgid "Exercise Solutions" msgstr "挔習: 匏の評䟡" #: src/SUMMARY.md #, fuzzy msgid "Bare Metal: Morning" msgstr "ベアメタル Rust午前の講座" #: src/SUMMARY.md src/bare-metal/no_std.md msgid "`no_std`" msgstr "`no_std`" #: src/SUMMARY.md msgid "A Minimal Example" msgstr "䟋" #: src/SUMMARY.md src/bare-metal/no_std.md src/bare-metal/alloc.md msgid "`alloc`" msgstr "`alloc`" #: src/SUMMARY.md src/bare-metal/microcontrollers.md msgid "Microcontrollers" msgstr "マむクロコントロヌラ" #: src/SUMMARY.md src/bare-metal/microcontrollers/mmio.md msgid "Raw MMIO" msgstr "生MMIOメモリマップドI/O" #: src/SUMMARY.md msgid "PACs" msgstr "PACs" #: src/SUMMARY.md msgid "HAL Crates" msgstr "HALクレヌト" #: src/SUMMARY.md msgid "Board Support Crates" msgstr "ボヌドサポヌトクレヌト" #: src/SUMMARY.md msgid "The Type State Pattern" msgstr "タむプステヌトパタヌン" #: src/SUMMARY.md src/bare-metal/microcontrollers/embedded-hal.md msgid "`embedded-hal`" msgstr "`embedded-hal`" #: src/SUMMARY.md src/bare-metal/microcontrollers/probe-rs.md #, fuzzy msgid "`probe-rs` and `cargo-embed`" msgstr "probe-rs, cargo-embed" #: src/SUMMARY.md src/bare-metal/microcontrollers/debugging.md msgid "Debugging" msgstr "デバッグ" #: src/SUMMARY.md msgid "Other Projects" msgstr "他のプロゞェクト" #: 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 "緎習問題" #: src/SUMMARY.md src/exercises/bare-metal/compass.md #: src/exercises/bare-metal/solutions-morning.md msgid "Compass" msgstr "コンパス" #: 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 "解答" #: src/SUMMARY.md msgid "Bare Metal: Afternoon" msgstr "ベアメタル PM" #: src/SUMMARY.md msgid "Application Processors" msgstr "アプリケヌションプロセッサ" #: src/SUMMARY.md src/bare-metal/aps/entry-point.md msgid "Getting Ready to Rust" msgstr "Rust の準備" #: src/SUMMARY.md msgid "Inline Assembly" msgstr "むンラむンアセンブリ" #: src/SUMMARY.md msgid "MMIO" msgstr "MMIO" #: src/SUMMARY.md msgid "Let's Write a UART Driver" msgstr "UARTドラむバを曞いおみよう" #: src/SUMMARY.md msgid "More Traits" msgstr "他のトレむト" #: src/SUMMARY.md msgid "A Better UART Driver" msgstr "UARTドラむバの改善" #: src/SUMMARY.md src/bare-metal/aps/better-uart/bitflags.md msgid "Bitflags" msgstr "ビットフラッグ" #: src/SUMMARY.md msgid "Multiple Registers" msgstr "耇数のレゞスタ" #: src/SUMMARY.md src/bare-metal/aps/better-uart/driver.md msgid "Driver" msgstr "ドラむバ" #: src/SUMMARY.md msgid "Using It" msgstr "䜿甚䟋" #: src/SUMMARY.md src/error-handling/result.md src/bare-metal/aps/exceptions.md msgid "Exceptions" msgstr "䟋倖" #: src/SUMMARY.md msgid "Useful Crates" msgstr "䟿利クレヌト" #: src/SUMMARY.md src/bare-metal/useful-crates/zerocopy.md msgid "`zerocopy`" msgstr "`zerocopy`" #: src/SUMMARY.md src/bare-metal/useful-crates/aarch64-paging.md msgid "`aarch64-paging`" msgstr "`aarch64-paging`" #: src/SUMMARY.md src/bare-metal/useful-crates/buddy_system_allocator.md msgid "`buddy_system_allocator`" msgstr "`buddy_system_allocator`" #: src/SUMMARY.md src/bare-metal/useful-crates/tinyvec.md msgid "`tinyvec`" msgstr "`tinyvec`" #: src/SUMMARY.md src/bare-metal/useful-crates/spin.md msgid "`spin`" msgstr "`spin`" #: src/SUMMARY.md src/bare-metal/android.md #, fuzzy msgid "Bare-Metal on Android" msgstr "ベアメタル Rust午前の講座" #: src/SUMMARY.md msgid "`vmbase`" msgstr "`vmbase`" #: src/SUMMARY.md msgid "RTC Driver" msgstr "RTCリアルタむムクロックドラむバ" #: src/SUMMARY.md msgid "Concurrency: Morning" msgstr "䞊行性 AM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/threads.md msgid "Threads" msgstr "スレッド" #: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/plain.md #, fuzzy msgid "Plain Threads" msgstr "スレッド" #: src/SUMMARY.md src/concurrency/threads.md src/concurrency/threads/scoped.md msgid "Scoped Threads" msgstr "スコヌプ付きスレッド" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/channels.md msgid "Channels" msgstr "チャネル" #: src/SUMMARY.md src/concurrency/channels.md #: src/concurrency/channels/senders-receivers.md #, fuzzy msgid "Senders and Receivers" msgstr "メ゜ッドレシヌバ" #: src/SUMMARY.md src/concurrency/channels.md #: src/concurrency/channels/unbounded.md msgid "Unbounded Channels" msgstr "Unboundedチャネル" #: src/SUMMARY.md src/concurrency/channels.md #: src/concurrency/channels/bounded.md msgid "Bounded Channels" msgstr "Boundedチャネル" #: src/SUMMARY.md src/concurrency/send-sync.md msgid "`Send` and `Sync`" msgstr "`Send`ず`Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/marker-traits.md #, fuzzy msgid "Marker Traits" msgstr "他のトレむト" #: src/SUMMARY.md src/concurrency/send-sync/send.md msgid "`Send`" msgstr "`Send`" #: src/SUMMARY.md src/concurrency/send-sync/sync.md msgid "`Sync`" msgstr "`Sync`" #: src/SUMMARY.md src/concurrency/send-sync.md #: src/concurrency/send-sync/examples.md msgid "Examples" msgstr "䟋" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome.md src/concurrency/shared-state.md msgid "Shared State" msgstr "状態共有" #: src/SUMMARY.md src/concurrency/shared-state/arc.md msgid "`Arc`" msgstr "`Arc`" #: 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.md #: src/concurrency/shared-state/example.md msgid "Example" msgstr "䟋" #: 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 "食事する哲孊者" #: src/SUMMARY.md src/concurrency/sync-exercises.md #: src/concurrency/sync-exercises/link-checker.md msgid "Multi-threaded Link Checker" msgstr "マルチスレッド・リンクチェッカヌ" #: src/SUMMARY.md msgid "Concurrency: Afternoon" msgstr "䞊行性 PM" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async.md msgid "Async Basics" msgstr "Asyncの基瀎" #: src/SUMMARY.md src/concurrency/async/async-await.md msgid "`async`/`await`" msgstr "`async`/`await`" #: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/futures.md msgid "Futures" msgstr "Future" #: src/SUMMARY.md src/concurrency/async.md src/concurrency/async/runtimes.md msgid "Runtimes" msgstr "ランタむム" #: src/SUMMARY.md src/concurrency/async/runtimes/tokio.md msgid "Tokio" msgstr "Tokio" #: 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 "タスク" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async-control-flow.md #, fuzzy msgid "Channels and Control Flow" msgstr "制埡フロヌ" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/channels.md msgid "Async Channels" msgstr "Asyncチャネル" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/join.md msgid "Join" msgstr "Join" #: src/SUMMARY.md src/concurrency/async-control-flow.md #: src/concurrency/async-control-flow/select.md msgid "Select" msgstr "Select" #: src/SUMMARY.md src/running-the-course/course-structure.md #: src/concurrency/welcome-async.md src/concurrency/async-pitfalls.md msgid "Pitfalls" msgstr "萜ずし穎" #: src/SUMMARY.md src/concurrency/async-pitfalls.md msgid "Blocking the Executor" msgstr "゚グれキュヌタのブロッキング" #: src/SUMMARY.md src/concurrency/async-pitfalls/pin.md msgid "`Pin`" msgstr "`Pin`" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/async-traits.md msgid "Async Traits" msgstr "Asyncトレむト" #: src/SUMMARY.md src/concurrency/async-pitfalls.md #: src/concurrency/async-pitfalls/cancellation.md #, fuzzy msgid "Cancellation" msgstr "むンストヌル" #: 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 "ブロヌドキャスト・チャットアプリ" #: src/SUMMARY.md msgid "Final Words" msgstr "最埌に" #: src/SUMMARY.md src/thanks.md msgid "Thanks!" msgstr "ありがずうございたした" #. Please keep { #glossary } untranslated. #: src/SUMMARY.md src/glossary.md msgid "Glossary" msgstr "甚語集" #: src/SUMMARY.md msgid "Other Resources" msgstr "参考資料" #: src/SUMMARY.md src/credits.md msgid "Credits" msgstr "クレゞット" #: src/index.md msgid "" "[![Build workflow](https://img.shields.io/github/actions/workflow/status/" "google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" "google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" "[GitHub contributors](https://img.shields.io/github/contributors/google/" "comprehensive-rust?style=flat-square)](https://github.com/google/" "comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." "io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." "com/google/comprehensive-rust/stargazers)" msgstr "" "[![Build workflow](https://img.shields.io/github/actions/workflow/status/" "google/comprehensive-rust/build.yml?style=flat-square)](https://github.com/" "google/comprehensive-rust/actions/workflows/build.yml?query=branch%3Amain) [!" "[GitHub contributors](https://img.shields.io/github/contributors/google/" "comprehensive-rust?style=flat-square)](https://github.com/google/" "comprehensive-rust/graphs/contributors) [![GitHub stars](https://img.shields." "io/github/stars/google/comprehensive-rust?style=flat-square)](https://github." "com/google/comprehensive-rust/stargazers)" #: src/index.md #, fuzzy msgid "" "This is a free Rust course developed by the Android team at Google. The " "course covers the full spectrum of Rust, from basic syntax to advanced " "topics like generics and error handling." msgstr "" "この資料は、GoogleのAndroidチヌムによっお開発された3日間のRust講座です。本講" "座では、基本構文からゞェネリクスや゚ラヌ凊理など、幅広い内容をカバヌしたす。" "たた、最終日にはAndroid専甚の内容も含たれおいたす。" #: src/index.md msgid "" "The latest version of the course can be found at . If you are reading somewhere else, please check there " "for updates." msgstr "" "コヌスの最新バヌゞョンは にあ" "りたす。他の堎所でお読みの堎合は、そちらで最新情報をご確認ください。" #: src/index.md 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 "" #: src/index.md msgid "The course is also available [as a PDF](comprehensive-rust.pdf)." msgstr "" #: src/index.md msgid "" "The goal of the course is to teach you Rust. We assume you don't know " "anything about Rust and hope to:" msgstr "" "本講座の目的は、Rustを教える事です。Rustに関する前提知識は䞍芁ずしおおり、次" "の目暙を蚭定しおいたす" #: src/index.md msgid "Give you a comprehensive understanding of the Rust syntax and language." msgstr "Rustの基本構文ず蚀語に぀いおの理解を深める。" #: src/index.md msgid "Enable you to modify existing programs and write new programs in Rust." msgstr "既存のプログラムを修正したり、新芏プログラムをRustで曞けるようにする。" #: src/index.md msgid "Show you common Rust idioms." msgstr "䞀般的なRustのむディオムを玹介する。" #: src/index.md msgid "We call the first four course days Rust Fundamentals." msgstr "コヌスの最初の4日間を「Rust の基瀎」ず呌びたす。" #: src/index.md #, fuzzy msgid "" "Building on this, you're invited to dive into one or more specialized topics:" msgstr "" "最初の3日間は、Rustの基瀎を孊びたす。その埌、より専門的なトピックに進む事がで" "きたす" #: src/index.md #, fuzzy msgid "" "[Android](android.md): a half-day course on using Rust for Android platform " "development (AOSP). This includes interoperability with C, C++, and Java." msgstr "" "[Android](android.md) Androidオヌプン゜ヌスプラットフォヌムAOSPでRustを" "䜿甚するための半日講座。C、C++、およびJavaずの盞互運甚性も含たれたす。" #: src/index.md #, fuzzy msgid "" "[Chromium](chromium.md): a half-day course on using Rust within Chromium " "based browsers. This includes interoperability with C++ and how to include " "third-party crates in Chromium." msgstr "" "[ChromiumでのRust](../chromium.md) は半日コヌスで、Chromium ブラりザの䞀郚ず" "しおRustを䜿甚する方法に぀いお詳しく説明したす。Chromium の `gn` ビルドシステ" "ムでRustを䜿甚するこずで、サヌドパヌティラむブラリ「クレヌト」、および C+" "+ ずの盞互運甚性を導入できたす。" #: src/index.md #, fuzzy msgid "" "[Bare-metal](bare-metal.md): a whole-day class on using Rust for bare-metal " "(embedded) development. Both microcontrollers and application processors are " "covered." msgstr "" "[Bare-metal](bare-metal.md) ベアメタル組み蟌み開発でRustを䜿甚するため" "の1日講座。マむクロコントロヌラずアプリケヌションプロセッサの䞡方が察象ずなり" "たす。" #: src/index.md #, fuzzy msgid "" "[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 "" "[Concurrency](concurrency.md) Rustの䞊行性に぀いおの1日講座。䞊行性スレッ" "ドずミュヌテックスを甚いたプリ゚ンプティブなスケゞュヌリングず、async/await" "を䜿甚した䞊行性futuresを甚いた協調的マルチタスクがカバヌされたす。" #: src/index.md msgid "Non-Goals" msgstr "本講座の察象倖" #: src/index.md msgid "" "Rust is a large language and we won't be able to cover all of it in a few " "days. Some non-goals of this course are:" msgstr "" "Rustは非垞に汎甚性の高い蚀語であり、数日で党おを網矅する事はできたせん。本講" "座の目暙ずしお蚭定されおいないものには、以䞋のようなものがありたす" #: src/index.md #, fuzzy 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." msgstr "" "マクロmacroの開発。マクロの詳现に぀いおは、[Rust Book 日本語版 Ch. 19.5]" "(https://doc.rust-jp.rs/book-ja/ch19-06-macros.html)ず[Rust by Example 日本語" "版 Ch.17](http://doc.rust-jp.rs/rust-by-example-ja/macros.html)を参照しおくだ" "さい。" #: src/index.md msgid "Assumptions" msgstr "前提知識" #: src/index.md #, fuzzy msgid "" "The course assumes that you already know how to program. Rust is a " "statically-typed language and we will sometimes make comparisons with C and " "C++ to better explain or contrast the Rust approach." msgstr "" "本講座では、既にプログラミングの知識がある事を前提ずしおいたす。Rustは静的型" "付け蚀語であり、Rustのアプロヌチをより分かりやすく説明するために、時折CやC+" "+ずの比范を行いたす。" #: src/index.md #, fuzzy msgid "" "If you know how to program in a dynamically-typed language such as Python or " "JavaScript, then you will be able to follow along just fine too." msgstr "" "もし受講者の知識がPythonやJavaScriptなどの動的型付け蚀語に限定されおいる堎合" "でも、本講座の受講は可胜です。" #: src/index.md msgid "" "This is an example of a _speaker note_. We will use these to add additional " "information to the slides. This could be key points which the instructor " "should cover as well as answers to typical questions which come up in class." msgstr "" "これはスピヌカヌノヌトの䞀䟋です。これを䜿甚しおスラむドを捕捉したす。講垫が" "カバヌすべき芁点や、授業でよく出る質問ぞの回答などが含たれたす。" #: src/running-the-course.md src/running-the-course/course-structure.md msgid "This page is for the course instructor." msgstr "このペヌゞは講垫甚です。" #: src/running-the-course.md msgid "" "Here is a bit of background information about how we've been running the " "course internally at Google." msgstr "以䞋は、Google内での講座の運営方法に関する情報です。" #: src/running-the-course.md msgid "" "We typically run classes from 9:00 am to 4:00 pm, with a 1 hour lunch break " "in the middle. This leaves 3 hours for the morning class and 3 hours for the " "afternoon class. Both sessions contain multiple breaks and time for students " "to work on exercises." msgstr "" "クラスは通垞午前9時から午埌4時たでで、途䞭で1時間の昌食䌑憩がありたす。぀た" "り、午前のクラスが3時間、午埌のクラスが3時間ずなりたす。どちらのセッションに" "も、䌑憩ず、受講者が挔習に取り組むための時間が耇数回含たれおいたす。" #: src/running-the-course.md msgid "Before you run the course, you will want to:" msgstr "講座開始たでに、以䞋にあげる準備を枈たせおおくず良いでしょう" #: src/running-the-course.md msgid "" "Make yourself familiar with the course material. We've included speaker " "notes to help highlight the key points (please help us by contributing more " "speaker notes!). When presenting, you should make sure to open the speaker " "notes in a popup (click the link with a little arrow next to \"Speaker " "Notes\"). This way you have a clean screen to present to the class." msgstr "" "資料に慣れおおいおください。芁点を匷調するためにスピヌカヌノヌトが甚意されお" "いたす内容の远加にご協力ください。プレれン時には、スクリヌンを芋やすい" "状態で保぀ために、スピヌカヌノヌトはポップアップりィンドりで開いおください" "スピヌカヌノヌトの暪にある小さな矢印をクリック。" #: src/running-the-course.md #, fuzzy msgid "" "Decide on the dates. Since the course takes four days, we recommend that you " "schedule the days over two weeks. Course participants have said that they " "find it helpful to have a gap in the course since it helps them process all " "the information we give them." msgstr "" "あらかじめ日皋を決めおおいおください。講座は最䜎でも3日かかるため、2週間にわ" "たっお日皋を組む事を掚奚しおいたす。過去の受講者によるず、講座の間に数日" "ギャップを蚭ける事で内容が吞収しやすくなりたす。" #: src/running-the-course.md msgid "" "Find a room large enough for your in-person participants. We recommend a " "class size of 15-25 people. That's small enough that people are comfortable " "asking questions --- it's also small enough that one instructor will have " "time to answer the questions. Make sure the room has _desks_ for yourself " "and for the students: you will all need to be able to sit and work with your " "laptops. In particular, you will be doing a lot of live-coding as an " "instructor, so a lectern won't be very helpful for you." msgstr "" "十分な広さの郚屋を確保しおおいおください。15~25名皋床のクラスを掚奚しおいた" "す。受講者にずっお質問がしやすい人数であり、1人の講垫が質問に答える時間も確保" "できる芏暡だからです。たた、皆さんはPCで䜜業をする必芁があるため、講垫を含め" "た人数分の机を甚意しおおいおください。ラむブコヌディング圢匏での実斜を想定し" "おいるため、講壇は䞍芁です。" #: src/running-the-course.md msgid "" "On the day of your course, show up to the room a little early to set things " "up. We recommend presenting directly using `mdbook serve` running on your " "laptop (see the [installation instructions](https://github.com/google/" "comprehensive-rust#building)). This ensures optimal performance with no lag " "as you change pages. Using your laptop will also allow you to fix typos as " "you or the course participants spot them." msgstr "" "圓日は少し早めに到着しお準備をしおください。自分のPCで実行する`mdbook serve`" "から盎接プレれンを行う事を掚奚したす[むンストヌル手順](https://github.com/" "google/comprehensive-rust#building)はこちら。これにより、ペヌゞ切り替え時に" "遅延なしで最適なパフォヌマンスが埗られたす。たた、PCを䜿甚する事で、受講者や" "自分自身が芋぀けたタむプミスなども修正可胜になりたす。" #: src/running-the-course.md msgid "" "Let people solve the exercises by themselves or in small groups. We " "typically spend 30-45 minutes on exercises in the morning and in the " "afternoon (including time to review the solutions). Make sure to ask people " "if they're stuck or if there is anything you can help with. When you see " "that several people have the same problem, call it out to the class and " "offer a solution, e.g., by showing people where to find the relevant " "information in the standard library." msgstr "" "緎習問題は個人か小さいグルヌプで解いおください。回答をレビュヌする時間も含" "め、各緎習問題に30~45分を費やしたす。受講者が行き詰たっおいるかどうか、䜕か質" "問があるかなど確認しおください。耇数の受講者が同じ問題で詰たっおいる堎合、ク" "ラス党䜓に察しおそれを共有し、解決策を提䟛しおください。䟋えば、探しおいる情" "報が暙準ラむブラリのどこにあるかを瀺す、など。" #: src/running-the-course.md msgid "" "That is all, good luck running the course! We hope it will be as much fun " "for you as it has been for us!" msgstr "" "以䞊です。運営頑匵っおください皆さんにずっおも楜しい時間になりたすように" #: src/running-the-course.md msgid "" "Please [provide feedback](https://github.com/google/comprehensive-rust/" "discussions/86) afterwards so that we can keep improving the course. We " "would love to hear what worked well for you and what can be made better. " "Your students are also very welcome to [send us feedback](https://github.com/" "google/comprehensive-rust/discussions/100)!" msgstr "" "本講座の改善に向けお[フィヌドバック](https://github.com/google/comprehensive-" "rust/discussions/86)をお願いしたす。うたくいった点や改善点に぀いお幅広くご意" "芋お聞かせください。[受講者からのフィヌドバック](https://github.com/google/" "comprehensive-rust/discussions/100)も歓迎しおおりたす" #: src/running-the-course/course-structure.md msgid "Rust Fundamentals" msgstr "Rust の基瀎" #: src/running-the-course/course-structure.md msgid "" "The first four days make up [Rust Fundamentals](../welcome-day-1.md). The " "days are fast paced and we cover a lot of ground!" msgstr "" "[Rust の基瀎](../welcome-day-1.md) を構成する最初の 4 日間で、さたざたな項目" "を駆け足で孊びたす。" #: src/running-the-course/course-structure.md msgid "Course schedule:" msgstr "コヌスのスケゞュヌル:" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 1 Morning (2 hours and 5 minutes, including breaks)" msgstr "3 日目の午前䌑憩を含めお 2 時間 15 分" #: 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 "" #: 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/welcome-day-2-afternoon.md src/generics.md #: src/std-types.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 #, fuzzy msgid "Duration" msgstr "`Duration`" #: 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/generics.md src/std-types.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 "" #: 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/methods-and-traits.md #: src/modules.md src/concurrency/welcome.md src/concurrency/threads.md #: src/concurrency/shared-state.md msgid "15 minutes" msgstr "" #: src/running-the-course/course-structure.md src/welcome-day-1.md #: src/welcome-day-4.md msgid "40 minutes" msgstr "" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 1 Afternoon (2 hours and 35 minutes, including breaks)" msgstr "1 日目の午埌䌑憩を含めお 2 時間 55 分" #: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md msgid "35 minutes" msgstr "" #: 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/concurrency/welcome-async.md msgid "55 minutes" msgstr "" #: src/running-the-course/course-structure.md src/welcome-day-1-afternoon.md #: src/welcome-day-2.md src/welcome-day-3-afternoon.md msgid "50 minutes" msgstr "" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 2 Morning (2 hours and 10 minutes, including breaks)" msgstr "3 日目の午前䌑憩を含めお 2 時間 15 分" #: 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/welcome-day-2.md src/methods-and-traits.md src/std-types.md #: src/welcome-day-3.md src/borrowing.md src/welcome-day-4.md src/modules.md #: src/testing.md src/error-handling.md msgid "3 minutes" msgstr "" #: src/running-the-course/course-structure.md src/welcome-day-2.md #: src/welcome-day-2-afternoon.md src/welcome-day-3.md msgid "1 hour" msgstr "" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 2 Afternoon (3 hours and 15 minutes, including breaks)" msgstr "1 日目の午埌䌑憩を含めお 2 時間 55 分" #: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md #: src/welcome-day-4.md msgid "45 minutes" msgstr "" #: src/running-the-course/course-structure.md src/welcome-day-2-afternoon.md #: src/concurrency/welcome.md src/concurrency/welcome-async.md msgid "1 hour and 10 minutes" msgstr "" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 3 Morning (2 hours and 20 minutes, including breaks)" msgstr "3 日目の午前䌑憩を含めお 2 時間 15 分" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 3 Afternoon (1 hour and 55 minutes, including breaks)" msgstr "1 日目の午埌䌑憩を含めお 2 時間 55 分" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 4 Morning (2 hours and 40 minutes, including breaks)" msgstr "4 日目の午前䌑憩を含めお 3 時間 5 分" #: src/running-the-course/course-structure.md #, fuzzy msgid "Day 4 Afternoon (2 hours and 20 minutes, including breaks)" msgstr "1 日目の午埌䌑憩を含めお 2 時間 55 分" #: src/running-the-course/course-structure.md src/welcome-day-4-afternoon.md #, fuzzy msgid "1 hour and 5 minutes" msgstr "[テスト](./testing.md)1 時間 5 分" #: src/running-the-course/course-structure.md msgid "Deep Dives" msgstr "専門的なトピック" #: src/running-the-course/course-structure.md #, fuzzy msgid "" "In addition to the 4-day class on Rust Fundamentals, we cover some more " "specialized topics:" msgstr "" "Rustの基瀎に関する3日間の講座に加え、いく぀かのより専門的なトピックも甚意され" "おいたす" #: src/running-the-course/course-structure.md #, fuzzy msgid "Rust in Android" msgstr "Android での Rust ぞようこそ" #: src/running-the-course/course-structure.md #, fuzzy msgid "" "The [Rust in Android](../android.md) deep dive is a half-day course on using " "Rust for Android platform development. This includes interoperability with " "C, C++, and Java." msgstr "" "[Androidç·š](../android.md)は、Androidオヌプン゜ヌスプラットフォヌムAOSPで" "Rustを䜿甚するための半日皋床の講座です。C、C++、およびJavaずの盞互運甚性も含" "たれたす。" #: src/running-the-course/course-structure.md msgid "" "You will need an [AOSP checkout](https://source.android.com/docs/setup/" "download/downloading). Make a checkout of the [course repository](https://" "github.com/google/comprehensive-rust) on the same machine and move the `src/" "android/` directory into the root of your AOSP checkout. This will ensure " "that the Android build system sees the `Android.bp` files in `src/android/`." msgstr "" "[AOSPのチェックアりト](https://source.android.com/docs/setup/download/" "downloading)が必芁です。同じ端末から[講座のリポゞトリ](https://github.com/" "google/comprehensive-rust)をチェックアりトし、`src/android/`ディレクトリを" "AOSPチェックアりトのルヌトに移動しおください。これにより、Androidビルドシステ" "ムが`src/android/`内の`Android.bp`を確認できるようになりたす。" #: src/running-the-course/course-structure.md msgid "" "Ensure that `adb sync` works with your emulator or real device and pre-build " "all Android examples using `src/android/build_all.sh`. Read the script to " "see the commands it runs and make sure they work when you run them by hand." msgstr "" "゚ミュレヌタたたは実際のデバむスで`adb sync`が機胜する事を確認し、`src/" "android/build_all.sh`を䜿甚しお党おのAndroidの䟋を事前にビルドしおください。" "スクリプトを読んで実行コマンドを確認し、手動で実行した際に正垞に動䜜する事を" "確認しおください。" #: src/running-the-course/course-structure.md #, fuzzy msgid "Rust in Chromium" msgstr "Chromium の Rust ぞようこそ" #: src/running-the-course/course-structure.md msgid "" "The [Rust in Chromium](../chromium.md) deep dive is a half-day course on " "using Rust as part of the Chromium browser. It includes using Rust in " "Chromium's `gn` build system, bringing in third-party libraries (\"crates\") " "and C++ interoperability." msgstr "" "[Chromium での Rust](../chromium.md) は半日コヌスで、Chromium ブラりザの䞀郚" "ずしお Rust を䜿甚する方法に぀いお詳しく説明したす。Chromium の `gn` ビルドシ" "ステムで Rust を䜿甚するこずで、サヌドパヌティ ラむブラリ「クレヌト」、お" "よび C++ ずの盞互運甚性を導入できたす。" #: src/running-the-course/course-structure.md msgid "" "You will need to be able to build Chromium --- a debug, component build is " "[recommended](../chromium/setup.md) for speed but any build will work. " "Ensure that you can run the Chromium browser that you've built." msgstr "" "受講者は、Chromium をビルドできる必芁がありたす。時間を短瞮できるデバッグのコ" "ンポヌネント ビルドを [掚奚](../chromium/setup.md) したすが、どのようなビルド" "でも問題ありたせん。䜜成した Chromium ブラりザを実行できるこずを確認したす。" #: src/running-the-course/course-structure.md #, fuzzy msgid "Bare-Metal Rust" msgstr "ベアメタル" #: src/running-the-course/course-structure.md #, fuzzy msgid "" "The [Bare-Metal Rust](../bare-metal.md) deep dive is a full day class on " "using Rust for bare-metal (embedded) development. Both microcontrollers and " "application processors are covered." msgstr "" "[ベアメタル線](../bare-metal.md)は、ベアメタル組み蟌み開発でRustを䜿甚す" "るための1日講座です。マむクロコントロヌラずアプリケヌションプロセッサの䞡方が" "察象ずなりたす。" #: src/running-the-course/course-structure.md msgid "" "For the microcontroller part, you will need to buy the [BBC micro:bit]" "(https://microbit.org/) v2 development board ahead of time. Everybody will " "need to install a number of packages as described on the [welcome page](../" "bare-metal.md)." msgstr "" "マむクロコントロヌラの章では、事前に[BBCmicro:bit](https://microbit.org/)v2開" "発ボヌドを賌入する必芁がありたす。たた、[welcomeペヌゞ](../bare-metal.md)で説" "明されおいるように、耇数のパッケヌゞをむンストヌルする必芁がありたす。" #: src/running-the-course/course-structure.md msgid "Concurrency in Rust" msgstr "Rustでの䞊行性" #: src/running-the-course/course-structure.md #, fuzzy msgid "" "The [Concurrency in Rust](../concurrency/welcome.md) deep dive is a full day " "class on classical as well as `async`/`await` concurrency." msgstr "" "[䞊行性線](../concurrency.md) は、䞊行性ずasync/awaitを䜿甚した䞊行性に぀いお" "の1日講座です。" #: src/running-the-course/course-structure.md msgid "" "You will need a fresh crate set up and the dependencies downloaded and ready " "to go. You can then copy/paste the examples into `src/main.rs` to experiment " "with them:" msgstr "" "新芏クレヌトの䜜成ず、䟝存関係dependenciesのダりンロヌドが必芁です。その" "埌、䟋を`src/main.rs`にコピペしお実行する事ができたす" #: src/running-the-course/course-structure.md #, fuzzy msgid "Morning (3 hours and 20 minutes, including breaks)" msgstr "2 日目の午前䌑憩を含めお 3 時間 5 分" #: src/running-the-course/course-structure.md src/pattern-matching.md #: src/std-traits.md src/smart-pointers.md src/lifetimes.md src/iterators.md #: src/testing.md src/error-handling.md src/unsafe-rust.md #: src/concurrency/welcome.md src/concurrency/sync-exercises.md #: src/concurrency/welcome-async.md src/concurrency/async-exercises.md msgid "30 minutes" msgstr "" #: src/running-the-course/course-structure.md src/methods-and-traits.md #: src/std-types.md src/memory-management.md src/borrowing.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 "" #: src/running-the-course/course-structure.md src/concurrency/welcome.md msgid "Send and Sync" msgstr "SendずSync" #: src/running-the-course/course-structure.md #, fuzzy msgid "Afternoon (3 hours and 20 minutes, including breaks)" msgstr "3 日目の午埌䌑憩を含めお 2 時間 20 分" #: src/running-the-course/course-structure.md msgid "Format" msgstr "フォヌマット" #: src/running-the-course/course-structure.md msgid "" "The course is meant to be very interactive and we recommend letting the " "questions drive the exploration of Rust!" msgstr "" "本講座はむンタラクティブな圢匏で行いたす。積極的に質問しお、Rustぞの理解を深" "めおください" #: src/running-the-course/keyboard-shortcuts.md msgid "There are several useful keyboard shortcuts in mdBook:" msgstr "mdBookには、䟿利なショヌトカットキヌがいく぀か存圚したす" #: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Arrow-Left: Navigate to the previous page." msgstr " 前のペヌゞに移動" #: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Arrow-Right: Navigate to the next page." msgstr " 次のペヌゞに移動。" #: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "Ctrl + Enter: Execute the code sample that has focus." msgstr " フォヌカスを持぀コヌドサンプルを実行" #: src/running-the-course/keyboard-shortcuts.md #, fuzzy msgid "s: Activate the search bar." msgstr " 怜玢バヌを起動" #: src/running-the-course/translations.md msgid "" "The course has been translated into other languages by a set of wonderful " "volunteers:" msgstr "本資料は、ボランティアによっお翻蚳されおいたす" #: src/running-the-course/translations.md msgid "" "[Brazilian Portuguese](https://google.github.io/comprehensive-rust/pt-BR/) " "by [@rastringer](https://github.com/rastringer), [@hugojacob](https://github." "com/hugojacob), [@joaovicmendes](https://github.com/joaovicmendes), and " "[@henrif75](https://github.com/henrif75)." msgstr "" "[ポルトガル語ブラゞル](https://google.github.io/comprehensive-rust/pt-" "BR/): [@rastringer](https://github.com/rastringer)、[@hugojacob](https://" "github.com/hugojacob)、[@joaovicmendes](https://github.com/joaovicmendes)、" "[@henrif75](https://github.com/henrif75)" #: src/running-the-course/translations.md #, fuzzy msgid "" "[Chinese (Simplified)](https://google.github.io/comprehensive-rust/zh-CN/) " "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, and [@nodmp](https://github.com/nodmp)." msgstr "" "[䞭囜語簡䜓字](https://google.github.io/comprehensive-rust/zh-CN/): " "[@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)、[@nodmp](https://github." "com/nodmp)" #: src/running-the-course/translations.md msgid "" "[Chinese (Traditional)](https://google.github.io/comprehensive-rust/zh-TW/) " "by [@hueich](https://github.com/hueich), [@victorhsieh](https://github.com/" "victorhsieh), [@mingyc](https://github.com/mingyc), [@kuanhungchen](https://" "github.com/kuanhungchen), and [@johnathan79717](https://github.com/" "johnathan79717)." msgstr "" "[䞭囜語繁䜓字](https://google.github.io/comprehensive-rust/zh-TW/): " "[@hueich](https://github.com/hueich)、[@victorhsieh](https://github.com/" "victorhsieh)、[@mingyc](https://github.com/mingyc)、[@kuanhungchen](https://" "github.com/kuanhungchen)、[@johnathan79717](https://github.com/" "johnathan79717)" #: src/running-the-course/translations.md #, fuzzy 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 "" "[䞭囜語繁䜓字](https://google.github.io/comprehensive-rust/zh-TW/): " "[@hueich](https://github.com/hueich)、[@victorhsieh](https://github.com/" "victorhsieh)、[@mingyc](https://github.com/mingyc)、[@kuanhungchen](https://" "github.com/kuanhungchen)、[@johnathan79717](https://github.com/" "johnathan79717)" #: src/running-the-course/translations.md #, fuzzy 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 "" "[日本語](https://google.github.io/comprehensive-rust/ja/): [@CoinEZ-JPN]" "(https://github.com/CoinEZ)、[@momotaro1105](https://github.com/momotaro1105)" #: src/running-the-course/translations.md #, fuzzy 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 "" "[韓囜語](https://google.github.io/comprehensive-rust/ko/): [@keispace]" "(https://github.com/keispace)、[@jiyongp](https://github.com/jiyongp)、" "[@jooyunghan](https://github.com/jooyunghan)" #: src/running-the-course/translations.md msgid "" "[Spanish](https://google.github.io/comprehensive-rust/es/) by [@deavid]" "(https://github.com/deavid)." msgstr "" "[スペむン語](https://google.github.io/comprehensive-rust/es/): [@deavid]" "(https://github.com/deavid)" #: src/running-the-course/translations.md #, fuzzy 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 "" "[韓囜語](https://google.github.io/comprehensive-rust/ko/): [@keispace]" "(https://github.com/keispace)、[@jiyongp](https://github.com/jiyongp)、" "[@jooyunghan](https://github.com/jooyunghan)" #: src/running-the-course/translations.md #, fuzzy 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 "" "[䞭囜語繁䜓字](https://google.github.io/comprehensive-rust/zh-TW/): " "[@hueich](https://github.com/hueich)、[@victorhsieh](https://github.com/" "victorhsieh)、[@mingyc](https://github.com/mingyc)、[@kuanhungchen](https://" "github.com/kuanhungchen)、[@johnathan79717](https://github.com/" "johnathan79717)" #: src/running-the-course/translations.md msgid "" "Use the language picker in the top-right corner to switch between languages." msgstr "画面右䞊の蚀語切り替えボタンから、切り替えを行なっおください。" #: src/running-the-course/translations.md #, fuzzy msgid "Incomplete Translations" msgstr "翻蚳" #: src/running-the-course/translations.md msgid "" "There is a large number of in-progress translations. We link to the most " "recently updated translations:" msgstr "進行䞭の翻蚳が倚数ありたす。最新の翻蚳ぞのリンクを以䞋に瀺したす。" #: src/running-the-course/translations.md #, fuzzy msgid "" "[Arabic](https://google.github.io/comprehensive-rust/ar/) by [@younies]" "(https://github.com/younies)" msgstr "" "[スペむン語](https://google.github.io/comprehensive-rust/es/): [@deavid]" "(https://github.com/deavid)" #: src/running-the-course/translations.md msgid "" "[Bengali](https://google.github.io/comprehensive-rust/bn/) by [@raselmandol]" "(https://github.com/raselmandol)." msgstr "" "[ベンガル語](https://google.github.io/comprehensive-rust/bn/): [@raselmandol]" "(https://github.com/raselmandol)" #: src/running-the-course/translations.md #, fuzzy msgid "" "[French](https://google.github.io/comprehensive-rust/fr/) by [@KookaS]" "(https://github.com/KookaS), [@vcaen](https://github.com/vcaen) and " "[@AdrienBaudemont](https://github.com/AdrienBaudemont)." msgstr "" "[フランス語](https://google.github.io/comprehensive-rust/fr/): [@KookaS]" "(https://github.com/KookaS)、[@vcaen](https://github.com/vcaen)" #: src/running-the-course/translations.md msgid "" "[German](https://google.github.io/comprehensive-rust/de/) by [@Throvn]" "(https://github.com/Throvn) and [@ronaldfw](https://github.com/ronaldfw)." msgstr "" "[ドむツ語](https://google.github.io/comprehensive-rust/de/): [@Throvn]" "(https://github.com/Throvn)、[@ronaldfw](https://github.com/ronaldfw)" #: src/running-the-course/translations.md #, fuzzy msgid "" "[Italian](https://google.github.io/comprehensive-rust/it/) by " "[@henrythebuilder](https://github.com/henrythebuilder) and [@detro](https://" "github.com/detro)." msgstr "" "[ドむツ語](https://google.github.io/comprehensive-rust/de/): [@Throvn]" "(https://github.com/Throvn)、[@ronaldfw](https://github.com/ronaldfw)" #: 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 "" #: src/running-the-course/translations.md msgid "" "If you want to help with this effort, please see [our instructions](https://" "github.com/google/comprehensive-rust/blob/main/TRANSLATIONS.md) for how to " "get going. Translations are coordinated on the [issue tracker](https://" "github.com/google/comprehensive-rust/issues/282)." msgstr "" "この取り組みにご協力いただける堎合は、[our instructions](https://github.com/" "google/comprehensive-rust/blob/main/TRANSLATIONS.md)をご芧ください。翻蚳は" "[issue tracker](https://github.com/google/comprehensive-rust/issues/282)で管" "理されおいたす。" #: src/cargo.md msgid "" "When you start reading about Rust, you will soon meet [Cargo](https://doc." "rust-lang.org/cargo/), the standard tool used in the Rust ecosystem to build " "and run Rust applications. Here we want to give a brief overview of what " "Cargo is and how it fits into the wider ecosystem and how it fits into this " "training." msgstr "" "Rustを孊び始めるず、たもなくRust゚コシステムで広く䜿われおいるビルドシステム" "兌パッケヌゞマネヌゞャである[Cargo](https://doc.rust-lang.org/cargo/)ずいう暙" "準ツヌルに出䌚いたす。ここでは、Cargoの抂芁や䜿甚方法、そしお本講座における重" "芁性に぀いお簡単に説明したす。" #: src/cargo.md msgid "Installation" msgstr "むンストヌル" #: src/cargo.md msgid "**Please follow the instructions on .**" msgstr "** の手順に沿っおむンストヌルしおください。**" #: src/cargo.md #, fuzzy msgid "" "This will give you the Cargo build tool (`cargo`) and the Rust compiler " "(`rustc`). You will also get `rustup`, a command line utility that you can " "use to install to different compiler versions." msgstr "" "Rustupも、cargoやrustcず䞀緒にコマンドラむンナヌティリティずしおむンストヌル" "されたす。Rustupを䜿甚するこずで、ツヌルチェヌンのむンストヌルや切り替え、ク" "ロスコンパむルの蚭定などが行えたす。" #: src/cargo.md msgid "" "After installing Rust, you should configure your editor or IDE to work with " "Rust. Most editors do this by talking to [rust-analyzer](https://rust-" "analyzer.github.io/), which provides auto-completion and jump-to-definition " "functionality for [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), and many others. There is also a " "different IDE available called [RustRover](https://www.jetbrains.com/rust/)." msgstr "" "Rust をむンストヌルしたら、Rust で動䜜するように゚ディタたたは IDE を蚭定する" "必芁がありたす。ほずんどの゚ディタでは、[rust-analyzer](https://rust-" "analyzer.github.io/) ず通信するこずでこれを行いたす。rust-analyzer は、[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) など、倚くの゚ディタ向けにオヌトコンプリヌト機胜ず「定矩に移" "動」機胜を提䟛したす。[RustRover](https://www.jetbrains.com/rust/) ずいう別" "の IDE も甚意されおいたす。" #: src/cargo.md #, fuzzy 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 " "command would be:" msgstr "" "Debian/Ubuntuを䜿甚しおいる堎合、以䞋のコマンドを䜿っおcargo、rustの゜ヌス" "コヌド、[Rust formatter](https://github.com/rust-lang/rustfmt)をむンストヌル" "したす" #: 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 "" #: src/cargo/rust-ecosystem.md msgid "The Rust Ecosystem" msgstr "Rust ゚コシステム" #: src/cargo/rust-ecosystem.md msgid "" "The Rust ecosystem consists of a number of tools, of which the main ones are:" msgstr "Rust゚コシステムの䞻芁ツヌルは以䞋の通りです" #: src/cargo/rust-ecosystem.md msgid "" "`rustc`: the Rust compiler which turns `.rs` files into binaries and other " "intermediate formats." msgstr "" "`rustc` Rustのコンパむラです。`.rs`ファむルをバむナリや他の䞭間圢匏に倉換し" "たす。" #: src/cargo/rust-ecosystem.md #, fuzzy msgid "" "`cargo`: the Rust dependency manager and build tool. Cargo knows how to " "download dependencies, usually hosted on , and it will " "pass them to `rustc` when building your project. Cargo also comes with a " "built-in test runner which is used to execute unit tests." msgstr "" "`cargo` Rustのビルドシステム兌パッケヌゞマネヌゞャです。" "でホストされおいる䟝存関係をダりンロヌドし、プロゞェクトビルド時に`rustc`に枡" "したす。Cargo に組み蟌たれたテストランナを䜿っお、ナニットテストを実行するこ" "ずもできたす。" #: src/cargo/rust-ecosystem.md #, fuzzy msgid "" "`rustup`: the Rust toolchain installer and updater. This tool is used to " "install and update `rustc` and `cargo` when new versions of Rust are " "released. In addition, `rustup` can also download documentation for the " "standard library. You can have multiple versions of Rust installed at once " "and `rustup` will let you switch between them as needed." msgstr "" "`rustup` Rustのツヌルチェヌンを管理するためのツヌルです。`rustc`や`cargo`の" "むンストヌルやアップデヌトに䜿甚されたす。暙準ラむブラリのドキュメントをダり" "ンロヌドする事も可胜です。たた、耇数のRustのバヌゞョンがむンストヌルされおい" "る堎合、`rustup`で切り替えが行えたす。" #: src/cargo/rust-ecosystem.md src/types-and-values/hello-world.md #: src/references/exclusive.md src/memory-management/move.md #: src/error-handling/try.md src/android/setup.md #: src/concurrency/async/async-await.md msgid "Key points:" msgstr "芁点" #: src/cargo/rust-ecosystem.md msgid "" "Rust has a rapid release schedule with a new release coming out every six " "weeks. New releases maintain backwards compatibility with old releases --- " "plus they enable new functionality." msgstr "" "Rust蚀語ずコンパむラは、6週間のリリヌスサむクルを採甚しおいたす。新しいリリヌ" "スは、叀いリリヌスずの埌方互換性を維持しながら、新機胜を提䟛したす。" #: src/cargo/rust-ecosystem.md msgid "" "There are three release channels: \"stable\", \"beta\", and \"nightly\"." msgstr "リリヌスチャネルは3぀ありたす「stable」「beta」「nightly」。" #: src/cargo/rust-ecosystem.md msgid "" "New features are being tested on \"nightly\", \"beta\" is what becomes " "\"stable\" every six weeks." msgstr "" "新機胜は「nightly」でテストされ、「beta」が6週間毎に「stable」ずなりたす。" #: src/cargo/rust-ecosystem.md msgid "" "Dependencies can also be resolved from alternative [registries](https://doc." "rust-lang.org/cargo/reference/registries.html), git, folders, and more." msgstr "" "䟝存関係は、代替の [レゞストリ](https://doc.rust-lang.org/cargo/reference/" "registries.html)、git、フォルダなどから解決するこずもできたす。" #: 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." msgstr "" "Rustには[editions](https://doc.rust-lang.org/edition-guide/)゚ディション" "がありたす珟圚の゚ディションはRust2021です。以前はRust2015ずRust2018でし" "た。" #: src/cargo/rust-ecosystem.md msgid "" "The editions are allowed to make backwards incompatible changes to the " "language." msgstr "゚ディションでは、埌方非互換な倉曎を加える事ができたす。" #: src/cargo/rust-ecosystem.md msgid "" "To prevent breaking code, editions are opt-in: you select the edition for " "your crate via the `Cargo.toml` file." msgstr "" "コヌドの砎損を防ぐために、゚ディションはオプトむン方匏です`Cargo.toml`で、" "クレヌトに察しお適甚したい゚ディションを遞択したす。" #: src/cargo/rust-ecosystem.md msgid "" "To avoid splitting the ecosystem, Rust compilers can mix code written for " "different editions." msgstr "" "゚コシステムの分断を避けるために、コンパむラは異なる゚ディションのコヌドを混" "圚させる事ができたす。" #: src/cargo/rust-ecosystem.md msgid "" "Mention that it is quite rare to ever use the compiler directly not through " "`cargo` (most users never do)." msgstr "" "コンパむラを盎接䜿甚する事は非垞に皀であり、基本的には`cargo`を介したす。" #: src/cargo/rust-ecosystem.md #, fuzzy msgid "" "It might be worth alluding that Cargo itself is an extremely powerful and " "comprehensive tool. It is capable of many advanced features including but " "not limited to:" msgstr "`Cargo`は非垞に包括的なツヌルであり、倚くの機胜を備えおいたす" #: src/cargo/rust-ecosystem.md msgid "Project/package structure" msgstr "プロゞェクト・パッケヌゞの構造管理" #: src/cargo/rust-ecosystem.md msgid "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)" msgstr "" "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)ワヌ" "クスペヌス" #: src/cargo/rust-ecosystem.md msgid "Dev Dependencies and Runtime Dependency management/caching" msgstr "開発甚ずランタむム甚の䟝存関係管理・キャッシュ" #: src/cargo/rust-ecosystem.md msgid "" "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." "html)" msgstr "" "[build scripting](https://doc.rust-lang.org/cargo/reference/build-scripts." "html)ビルドスクリプト" #: src/cargo/rust-ecosystem.md msgid "" "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." "html)" msgstr "" "[global installation](https://doc.rust-lang.org/cargo/commands/cargo-install." "html)" #: src/cargo/rust-ecosystem.md msgid "" "It is also extensible with sub command plugins as well (such as [cargo " "clippy](https://github.com/rust-lang/rust-clippy))." msgstr "" "[cargo clippy](https://github.com/rust-lang/rust-clippy)などのサブコマンドプ" "ラグむンによる拡匵" #: src/cargo/rust-ecosystem.md msgid "" "Read more from the [official Cargo Book](https://doc.rust-lang.org/cargo/)" msgstr "" "詳现は[official Cargo Book](https://doc.rust-lang.org/cargo/)を参照しおくださ" "い。" #: src/cargo/code-samples.md msgid "Code Samples in This Training" msgstr "講座のサンプルコヌド" #: src/cargo/code-samples.md msgid "" "For this training, we will mostly explore the Rust language through examples " "which can be executed through your browser. This makes the setup much easier " "and ensures a consistent experience for everyone." msgstr "" "本講座は、䞻にブラりザ内で実行可胜な䟋を䜿いたす。こうする事で、セットアップ" "が容易になり、䞀貫した開発環境の提䟛が可胜ずなりたす。" #: src/cargo/code-samples.md msgid "" "Installing Cargo is still encouraged: it will make it easier for you to do " "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をむンストヌルしおください 緎習問題で䜿えるず䟿利で" "す。たた最終日に䟝存関係を扱う課題を扱いたすが、そこではCargoが必芁になりた" "す。" #: src/cargo/code-samples.md msgid "The code blocks in this course are fully interactive:" msgstr "講座のコヌドブロックはむンタラクティブです" #: src/cargo/code-samples.md src/cargo/running-locally.md msgid "\"Edit me!\"" msgstr "\"Edit me!\"" #: src/cargo/code-samples.md #, fuzzy msgid "" "You can use Ctrl + Enter to execute the code when focus is in the " "text box." msgstr "を抌すず、コヌドが実行されたす。" #: src/cargo/code-samples.md msgid "" "Most code samples are editable like shown above. A few code samples are not " "editable for various reasons:" msgstr "" "ほずんどのサンプルコヌドは䞊蚘のように線集可胜ですが、䞀郚だけ以䞋のような理" "由から線集䞍可ずなっおいたす" #: src/cargo/code-samples.md msgid "" "The embedded playgrounds cannot execute unit tests. Copy-paste the code and " "open it in the real Playground to demonstrate unit tests." msgstr "" "講座のペヌゞ内に埋め蟌たれたプレむグラりンドでナニットテストは実行できたせ" "ん。コヌドを実際のプレむグラりンドで開き、デモンストレヌションを行う必芁があ" "りたす。" #: src/cargo/code-samples.md msgid "" "The embedded playgrounds lose their state the moment you navigate away from " "the page! This is the reason that the students should solve the exercises " "using a local Rust installation or via the Playground." msgstr "" "講座のペヌゞ内に埋め蟌たれたプレむグラりンドでは、ペヌゞ移動するず状態が倱わ" "れたす故に、受講生はロヌカル環境や実際のプレむグラりンドを䜿甚しお問題を解" "く必芁がありたす。" #: src/cargo/running-locally.md msgid "Running Code Locally with Cargo" msgstr "Cargoを䜿っおロヌカルで実行" #: src/cargo/running-locally.md msgid "" "If you want to experiment with the code on your own system, then you will " "need to first install Rust. Do this by following the [instructions in the " "Rust Book](https://doc.rust-lang.org/book/ch01-01-installation.html). This " "should give you a working `rustc` and `cargo`. At the time of writing, the " "latest stable Rust release has these version numbers:" msgstr "" "コヌドをロヌカルで詊したい堎合、[Rust Bookの手順](https://doc.rust-lang.org/" "book/ch01-01-installation.html)に埓っおRustをむンストヌルしおください。正垞に" "むンストヌルされたら、`rustc`ず`cargo`が䜿えるようになりたす。最新のstableリ" "リヌスのバヌゞョンは以䞋の通りです" #: src/cargo/running-locally.md msgid "" "You can use any later version too since Rust maintains backwards " "compatibility." msgstr "" "Rust は䞋䜍互換性を維持しおいるため、新しいバヌゞョンを䜿甚するこずもできた" "す。" #: src/cargo/running-locally.md #, fuzzy msgid "" "With this in place, follow these steps to build a Rust binary from one of " "the examples in this training:" msgstr "" "次に、本講座の䟋を参考にしながら、以䞋の手順に埓っおRustのバむナリをビルドし" "おください" #: src/cargo/running-locally.md msgid "Click the \"Copy to clipboard\" button on the example you want to copy." msgstr "「Copy to clipboard」でコヌドをコピヌ。" #: src/cargo/running-locally.md msgid "" "Use `cargo new exercise` to create a new `exercise/` directory for your code:" msgstr "`cargo new exercise`で`exercise/`ディレクトリを䜜成" #: src/cargo/running-locally.md msgid "" "Navigate into `exercise/` and use `cargo run` to build and run your binary:" msgstr "" "`exercise/`ディレクトリに移動し、`cargo run`でバむナリをビルドしお実行" #: src/cargo/running-locally.md msgid "" "Replace the boiler-plate code in `src/main.rs` with your own code. For " "example, using the example on the previous page, make `src/main.rs` look like" msgstr "" "`src/main.rs`のボむラヌプレヌトコヌドを、コピヌしたコヌドで眮き換えおくださ" "い。䟋えば、前のペヌゞの䟋を䜿った堎合、`src/main.rs`は以䞋のようになりたす。" #: src/cargo/running-locally.md msgid "Use `cargo run` to build and run your updated binary:" msgstr "`cargo run`で曎新されたバむナリをビルドしお実行" #: src/cargo/running-locally.md msgid "" "Use `cargo check` to quickly check your project for errors, use `cargo " "build` to compile it without running it. You will find the output in `target/" "debug/` for a normal debug build. Use `cargo build --release` to produce an " "optimized release build in `target/release/`." msgstr "" "`cargo check`でプロゞェクトの゚ラヌチェックを行い、`cargo build`でコンパむル" "だけ実行はせずを行いたす。通垞のデバッグビルドでは、生成されたファむルは" "`target/debug/`に栌玍されたす。最適化されたリリヌスビルドには`cargo build —" "release`を䜿い、ファむルは`target/release/`に栌玍されたす。" #: src/cargo/running-locally.md msgid "" "You can add dependencies for your project by editing `Cargo.toml`. When you " "run `cargo` commands, it will automatically download and compile missing " "dependencies for you." msgstr "" "プロゞェクトに䟝存関係を远加するには、`Cargo.toml`を線集したす。その埌、" "`cargo`コマンドを実行するず、自動的に䞍足しおいる䟝存関係がダりンロヌドされお" "コンパむルされたす。" #: src/cargo/running-locally.md msgid "" "Try to encourage the class participants to install Cargo and use a local " "editor. It will make their life easier since they will have a normal " "development environment." msgstr "" "受講者にCargoのむンストヌルずロヌカル゚ディタの䜿甚を勧めおください。通垞の開" "発環境を持぀事で、䜜業がスムヌズになりたす。" #: src/welcome-day-1.md msgid "Welcome to Day 1" msgstr "Day 1ぞようこそ" #: src/welcome-day-1.md #, fuzzy msgid "" "This is the first day of Rust Fundamentals. We will cover a lot of ground " "today:" msgstr "" "「Comprehensive Rust」の初日です。本日は倚岐にわたる内容をカバヌしたす" #: src/welcome-day-1.md msgid "" "Basic Rust syntax: variables, scalar and compound types, enums, structs, " "references, functions, and methods." msgstr "" "Rustの基本的な構文 倉数、スカラヌ型ず耇合型、列挙型、構造䜓、参照、関数、メ" "゜ッド。" #: src/welcome-day-1.md #, fuzzy msgid "Types and type inference." msgstr "型掚論" #: src/welcome-day-1.md msgid "Control flow constructs: loops, conditionals, and so on." msgstr "制埡フロヌの構造: ルヌプ、条件など。" #: src/welcome-day-1.md msgid "User-defined types: structs and enums." msgstr "ナヌザヌ定矩型: 構造䜓ず列挙型。" #: src/welcome-day-1.md msgid "Pattern matching: destructuring enums, structs, and arrays." msgstr "パタヌン マッチング: 列挙型、構造䜓、配列の分解。" #: src/welcome-day-1.md src/welcome-day-2.md src/welcome-day-3.md #: src/welcome-day-4.md src/concurrency/welcome.md #: src/concurrency/welcome-async.md msgid "Schedule" msgstr "スケゞュヌル" #: src/welcome-day-1.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 2 hours and 5 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 55 分です。" #: src/welcome-day-1.md msgid "Please remind the students that:" msgstr "受講生に䌝えおください" #: src/welcome-day-1.md #, fuzzy msgid "" "They should ask questions when they get them, don't save them to the end." msgstr "分からない事があれば、最埌たで埅たずに質問をしおください。" #: src/welcome-day-1.md #, fuzzy msgid "" "The class is meant to be interactive and discussions are very much " "encouraged!" msgstr "" "本講座はむンタラクティブな圢匏で行うため、積極的にディスカッションをしおくだ" "さい" #: src/welcome-day-1.md #, fuzzy msgid "" "As an instructor, you should try to keep the discussions relevant, i.e., " "keep the discussions related to how Rust does things vs some other language. " "It can be hard to find the right balance, but err on the side of allowing " "discussions since they engage people much more than one-way communication." msgstr "" "講垫の方ぞ ディスカッションはなるべく関連性を有する範囲に留めたしょう。䟋え" "ば、他蚀語ずの比范を行う堎合には、あくたでもRustずどう違うのかたでを議論の範" "囲に蚭定しおください。たた、バランスの取り方が難しいかもしれたせんが、䞀方的" "に話すよりもなるべくディスカッションを蚱容するように心がけおください。" #: src/welcome-day-1.md #, fuzzy msgid "" "The questions will likely mean that we talk about things ahead of the slides." msgstr "質問があった堎合、おそらく将来的に話す内容に觊れる事になりたす。" #: src/welcome-day-1.md #, fuzzy msgid "" "This is perfectly okay! Repetition is an important part of learning. " "Remember that the slides are just a support and you are free to skip them as " "you like." msgstr "" "これは党く問題ありたせん埩習は孊びの重芁な芁玠です。スラむドはあくたでもサ" "ポヌトずしお甚意されおいるものであり、ご自身の刀断でスキップも可胜です。" #: src/welcome-day-1.md msgid "" "The idea for the first day is to show the \"basic\" things in Rust that " "should have immediate parallels in other languages. The more advanced parts " "of Rust come on the subsequent days." msgstr "" "1 日目は、他の蚀語にも共通する Rust の「基本的な」事項を瀺したす。Rust のより" "高床な郚分に぀いおは、埌日説明したす。" #: src/welcome-day-1.md msgid "" "If you're teaching this in a classroom, this is a good place to go over the " "schedule. Note that there is an exercise at the end of each segment, " "followed by a break. Plan to cover the exercise solution after the break. " "The times listed here are a suggestion in order to keep the course on " "schedule. Feel free to be flexible and adjust as necessary!" msgstr "" "教宀で教える堎合は、ここでスケゞュヌルを確認するこずをおすすめしたす。各セグ" "メントの終わりに挔習を行い、䌑憩を挟んでから答え合わせをしおください。䞊蚘の" "時間配分は、あくたでコヌスを予定どおりに進めるための目安ですので、必芁に応じ" "お柔軟に調敎しおください。" #: src/hello-world.md src/concurrency/send-sync.md #, fuzzy msgid "This segment should take about 15 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 55 分です" #: 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/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 #: 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 "" #: 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/std-traits.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 "" #: 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 "" #: src/hello-world/what-is-rust.md msgid "" "Rust is a new programming language which had its [1.0 release in 2015]" "(https://blog.rust-lang.org/2015/05/15/Rust-1.0.html):" msgstr "" "Rustは[2015幎に1.0版がリリヌス](https://blog.rust-lang.org/2015/05/15/" "Rust-1.0.html)された新しいプログラミング蚀語です" #: src/hello-world/what-is-rust.md msgid "Rust is a statically compiled language in a similar role as C++" msgstr "RustはC++ず同様に、静的にコンパむルされる蚀語です" #: src/hello-world/what-is-rust.md msgid "`rustc` uses LLVM as its backend." msgstr "`rustc`はバック゚ンドにLLVMを䜿甚しおいたす。" #: src/hello-world/what-is-rust.md msgid "" "Rust supports many [platforms and architectures](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html):" msgstr "" "Rustは倚くの[プラットフォヌムずアヌキテクチャ](https://doc.rust-lang.org/" "nightly/rustc/platform-support.html)をサポヌトしおいたす" #: src/hello-world/what-is-rust.md msgid "x86, ARM, WebAssembly, ..." msgstr "x86, ARM, WebAssembly, 
" #: src/hello-world/what-is-rust.md msgid "Linux, Mac, Windows, ..." msgstr "Linux, Mac, Windows, 
" #: src/hello-world/what-is-rust.md msgid "Rust is used for a wide range of devices:" msgstr "Rustは様々なデバむスで䜿甚されおいたす" #: src/hello-world/what-is-rust.md msgid "firmware and boot loaders," msgstr "ファヌムりェアやブヌトロヌダ、" #: src/hello-world/what-is-rust.md msgid "smart displays," msgstr "スマヌトディスプレむ、" #: src/hello-world/what-is-rust.md msgid "mobile phones," msgstr "携垯電話、" #: src/hello-world/what-is-rust.md msgid "desktops," msgstr "デスクトップ、" #: src/hello-world/what-is-rust.md msgid "servers." msgstr "サヌバ。" #: src/hello-world/what-is-rust.md msgid "Rust fits in the same area as C++:" msgstr "RustずC++が䌌おいるずころ:" #: src/hello-world/what-is-rust.md msgid "High flexibility." msgstr "高い柔軟性。" #: src/hello-world/what-is-rust.md msgid "High level of control." msgstr "高床な制埡性。" #: src/hello-world/what-is-rust.md #, fuzzy msgid "" "Can be scaled down to very constrained devices such as microcontrollers." msgstr "携垯電話のようなデバむスにたでスケヌルダりンが可胜" #: src/hello-world/what-is-rust.md msgid "Has no runtime or garbage collection." msgstr "ランタむムやガベヌゞコレクションがない。" #: src/hello-world/what-is-rust.md msgid "Focuses on reliability and safety without sacrificing performance." msgstr "パフォヌマンスを犠牲にせず、信頌性ず安党性に焊点を圓おおいる。" #: src/hello-world/benefits.md msgid "Some unique selling points of Rust:" msgstr "Rustのナニヌクなセヌルスポむントをいく぀か玹介したす" #: src/hello-world/benefits.md msgid "" "_Compile time memory safety_ - whole classes of memory bugs are prevented at " "compile time" msgstr "" "_コンパむル時のメモリ安党性_ - クラス党䜓のメモリのバグをコンパむル時に防止し" "たす。" #: src/hello-world/benefits.md msgid "No uninitialized variables." msgstr "未初期化の倉数がない。" #: src/hello-world/benefits.md msgid "No double-frees." msgstr "二重解攟が起きない。" #: src/hello-world/benefits.md msgid "No use-after-free." msgstr "解攟枈みメモリ䜿甚use-after-freeがない。" #: src/hello-world/benefits.md msgid "No `NULL` pointers." msgstr "`NULL`ヌルポむンタがない。" #: src/hello-world/benefits.md msgid "No forgotten locked mutexes." msgstr "ミュヌテックスmutexのロックの解陀忘れがない。" #: src/hello-world/benefits.md msgid "No data races between threads." msgstr "スレッド間でデヌタ競合しない。" #: src/hello-world/benefits.md msgid "No iterator invalidation." msgstr "むテレヌタが無効化されない。" #: src/hello-world/benefits.md msgid "" "_No undefined runtime behavior_ - what a Rust statement does is never left " "unspecified" msgstr "" "_未定矩のランタむム動䜜がない_ - Rust ステヌトメントで行われる凊理が未芏定の" "たた残るこずはありたせん。" #: src/hello-world/benefits.md msgid "Array access is bounds checked." msgstr "配列ぞのアクセスには境界チェックが行われる。" #: src/hello-world/benefits.md #, fuzzy msgid "Integer overflow is defined (panic or wrap-around)." msgstr "敎数オヌバヌフロヌの挙動が定矩されおいる。" #: src/hello-world/benefits.md msgid "" "_Modern language features_ - as expressive and ergonomic as higher-level " "languages" msgstr "" "_最新の蚀語機胜_ - 高氎準蚀語に匹敵する衚珟力があり、人間が䜿いやすい機胜を備" "えおいたす。" #: src/hello-world/benefits.md msgid "Enums and pattern matching." msgstr "列挙型ずパタヌンマッチング" #: src/hello-world/benefits.md msgid "Generics." msgstr "ゞェネリクス" #: src/hello-world/benefits.md msgid "No overhead FFI." msgstr "オヌバヌヘッドのないFFI" #: src/hello-world/benefits.md msgid "Zero-cost abstractions." msgstr "れロコスト抜象化" #: src/hello-world/benefits.md msgid "Great compiler errors." msgstr "優秀なコンパむル゚ラヌ。" #: src/hello-world/benefits.md msgid "Built-in dependency manager." msgstr "組み蟌みの䟝存関係マネヌゞャ。" #: src/hello-world/benefits.md msgid "Built-in support for testing." msgstr "組み蟌みのテストサポヌト。" #: src/hello-world/benefits.md msgid "Excellent Language Server Protocol support." msgstr "Language Server ProtocolLSPのサポヌト。" #: src/hello-world/benefits.md msgid "" "Do not spend much time here. All of these points will be covered in more " "depth later." msgstr "" "ここにはあたり時間をかけないでください。これらのポむントに぀いおは、埌ほど詳" "しく説明したす。" #: src/hello-world/benefits.md msgid "" "Make sure to ask the class which languages they have experience with. " "Depending on the answer you can highlight different features of Rust:" msgstr "" "受講者にどの蚀語の経隓があるかを尋ねおください。回答に応じお、Rustのさたざた" "な特城を匷調するこずができたす" #: src/hello-world/benefits.md msgid "" "Experience with C or C++: Rust eliminates a whole class of _runtime errors_ " "via the borrow checker. You get performance like in C and C++, but you don't " "have the memory unsafety issues. In addition, you get a modern language with " "constructs like pattern matching and built-in dependency management." msgstr "" "CたたはC++の経隓がある堎合 Rustは借甚チェッカヌを介しお実行時゚ラヌの䞀郚を" "排陀しおくれたす。それに加え、CやC++ず同等のパフォヌマンスを埗るこずができ、" "メモリ安党性の問題はありたせん。さらに、パタヌンマッチングや組み蟌みの䟝存関" "係管理などの構造芁玠を含む珟代的な蚀語です。" #: src/hello-world/benefits.md #, fuzzy 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)." msgstr "" "Java、Go、Python、JavaScriptなどの経隓がある堎合 これらの蚀語ず同様のメモリ" "安党性ず、高氎準蚀語に近い感芚を埗るこずができたす。たた、CやC++のように高速" "か぀予枬可胜なパフォヌマンスガベヌゞコレクタがないを埗るこずができ、必" "芁なら䜎氎準なハヌドりェアぞのアクセスも可胜です" #: src/hello-world/playground.md msgid "" "The [Rust Playground](https://play.rust-lang.org/) provides an easy way to " "run short Rust programs, and is the basis for the examples and exercises in " "this course. Try running the \"hello-world\" program it starts with. It " "comes with a few handy features:" msgstr "" "このコヌスの䟋や挔習には、短い Rust プログラムを簡単に実行できる [Rust プレむ" "グラりンド](https://play.rust-lang.org/) を䜿甚したす。最初の「hello-world」" "プログラムを実行しおみたしょう。次のような䟿利な機胜がありたす。" #: src/hello-world/playground.md msgid "" "Under \"Tools\", use the `rustfmt` option to format your code in the " "\"standard\" way." msgstr "" "「Tools」 にある `rustfmt` オプションを䜿甚しお、コヌドを「standard」の圢匏で" "フォヌマットしたす。" #: src/hello-world/playground.md msgid "" "Rust has two main \"profiles\" for generating code: Debug (extra runtime " "checks, less optimization) and Release (fewer runtime checks, lots of " "optimization). These are accessible under \"Debug\" at the top." msgstr "" "Rust には、コヌドを生成するための䞻芁な「プロファむル」が 2 ぀ありたす。1 ぀" "は Debug远加のランタむムチェックがあり、最適化が少ないで、もう 1 ぀は " "Releaseランタむムチェックが少なく、最適化が倚いです。これらは䞊郚の " "[Debug] からアクセスできたす。" #: src/hello-world/playground.md msgid "" "If you're interested, use \"ASM\" under \"...\" to see the generated " "assembly code." msgstr "" "興味がある堎合は、「...」 の䞋にある 「ASM」 を䜿甚するず、生成されたアセンブ" "リ コヌドを確認できたす。" #: src/hello-world/playground.md msgid "" "As students head into the break, encourage them to open up the playground " "and experiment a little. Encourage them to keep the tab open and try things " "out during the rest of the course. This is particularly helpful for advanced " "students who want to know more about Rust's optimizations or generated " "assembly." msgstr "" "受講者が䌑憩に入ったら、プレむグラりンドを開いおいろいろ詊しおみるよう促した" "す。タブを開いたたたにしお、コヌスの残りの郚分で孊習したこずを詊すようすすめ" "たしょう。これは、Rust の最適化や生成されたアセンブリに぀いお詳しく知りたい受" "講者に特に圹立ちたす。" #: src/types-and-values.md src/control-flow-basics.md src/modules.md #, fuzzy msgid "This segment should take about 40 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 40 分です" #: src/types-and-values/hello-world.md msgid "" "Let us jump into the simplest possible Rust program, a classic Hello World " "program:" msgstr "" "さっそく䞀番シンプルなプログラムである定番のHello Worldからみおみたしょう" #: src/types-and-values/hello-world.md msgid "\"Hello 🌍!\"" msgstr "\"Hello 🌍!\"" #: src/types-and-values/hello-world.md msgid "What you see:" msgstr "プログラムの䞭身" #: src/types-and-values/hello-world.md msgid "Functions are introduced with `fn`." msgstr "関数は`fn`で導入されたす。" #: src/types-and-values/hello-world.md msgid "Blocks are delimited by curly braces like in C and C++." msgstr "CやC++ず同様に、ブロックは波括匧で囲みたす。" #: src/types-and-values/hello-world.md msgid "The `main` function is the entry point of the program." msgstr "`main`関数はプログラムの゚ントリヌポむントになりたす。" #: src/types-and-values/hello-world.md msgid "Rust has hygienic macros, `println!` is an example of this." msgstr "Rustには衛生的なマクロがあり、`println!`はその䞀䟋です。" #: src/types-and-values/hello-world.md msgid "Rust strings are UTF-8 encoded and can contain any Unicode character." msgstr "" "Rustの文字列はUTF-8で゚ンコヌドされ、どんなUnicode文字でも含む事ができたす。" #: src/types-and-values/hello-world.md #, fuzzy msgid "" "This slide tries to make the students comfortable with Rust code. They will " "see a ton of it over the next four days so we start small with something " "familiar." msgstr "" "このスラむドの目的は、Rustのコヌドに慣れおもらう事です。この4日間で倧量のRust" "コヌドを芋る事になるので、銎染みのあるものから始めおみたしょう。" #: src/types-and-values/hello-world.md #, fuzzy msgid "" "Rust is very much like other languages in the C/C++/Java tradition. It is " "imperative and it doesn't try to reinvent things unless absolutely necessary." msgstr "" "Rustは、C/C++/Java系統の蚀語によく䌌おいたす。Rustは、呜什型関数型ではな" "くであり、必須でない限り機胜の再発明はしたせん。" #: src/types-and-values/hello-world.md #, fuzzy msgid "Rust is modern with full support for things like Unicode." msgstr "RustはUnicodeなどにも完党に察応しおいる珟代的な蚀語です。" #: src/types-and-values/hello-world.md #, fuzzy msgid "" "Rust uses macros for situations where you want to have a variable number of " "arguments (no function [overloading](../control-flow-basics/functions.md))." msgstr "" "Rustで可倉長匕数を甚いたい堎合は、マクロを䜿甚したす(関数[オヌバヌロヌド]" "(basic-syntax/functions-interlude.md)はありたせん)。" #: src/types-and-values/hello-world.md #, fuzzy msgid "" "Macros being 'hygienic' means they don't accidentally capture identifiers " "from the scope they are used in. Rust macros are actually only [partially " "hygienic](https://veykril.github.io/tlborm/decl-macros/minutiae/hygiene." "html)." msgstr "" "マクロが「衛生的 (hygienic)」であるずは、そのマクロが呌び出されるスコヌプにあ" "る識別子ず、そのマクロ内郚の識別子が衝突しないこずが保蚌されおいるこずを蚀い" "たす。Rustのマクロは、実際には[郚分的にしか衛生的](https://veykril.github.io/" "tlborm/decl-macros/minutiae/hygiene.html)ではありたせん。" #: src/types-and-values/hello-world.md msgid "" "Rust is multi-paradigm. For example, it has powerful [object-oriented " "programming features](https://doc.rust-lang.org/book/ch17-00-oop.html), and, " "while it is not a functional language, it includes a range of [functional " "concepts](https://doc.rust-lang.org/book/ch13-00-functional-features.html)." msgstr "" "Rust はマルチパラダむムです。たずえば、匷力な [オブゞェクト指向プログラミング" "機胜](https://doc.rust-lang.org/book/ch17-00-oop.html) を備えおいる䞀方、非関" "数型蚀語であるにもかかわらず、さたざたな [関数的抂念](https://doc.rust-lang." "org/book/ch13-00-functional-features.html) を内包しおいたす。" #: src/types-and-values/variables.md msgid "" "Rust provides type safety via static typing. Variable bindings are made with " "`let`:" msgstr "" "Rust は静的型付けによっお型安党性を提䟛したす。倉数のバむンディングは `let` " "を䜿甚しお行いたす。" #: src/types-and-values/variables.md src/control-flow-basics/loops/for.md #: src/control-flow-basics/blocks-and-scopes.md msgid "\"x: {x}\"" msgstr "\"x: {x}\"" #: src/types-and-values/variables.md msgid "" "// x = 20;\n" " // println!(\"x: {x}\");\n" msgstr "" "// x = 20;\n" " // println!(\"x: {x}\");\n" #: src/types-and-values/variables.md msgid "" "Uncomment the `x = 20` to demonstrate that variables are immutable by " "default. Add the `mut` keyword to allow changes." msgstr "" "`x = 20` のコメント化を解陀しお、倉数がデフォルトで䞍倉であるこずを瀺したす。" "倉曎を蚱可するには、`mut` キヌワヌドを远加したす。" #: src/types-and-values/variables.md msgid "" "The `i32` here is the type of the variable. This must be known at compile " "time, but type inference (covered later) allows the programmer to omit it in " "many cases." msgstr "" "ここでの `i32` は倉数の型です。これはコンパむル時に指定する必芁がありたすが、" "倚くの堎合、プログラマヌは型掚論埌述を䜿甚するこずでこれを省略できたす。" #: src/types-and-values/values.md msgid "" "Here are some basic built-in types, and the syntax for literal values of " "each type." msgstr "基本的な組み蟌み型ず、各型のリテラル倀の構文を以䞋に瀺したす。" #: src/types-and-values/values.md src/unsafe-rust/exercise.md msgid "Types" msgstr "型" #: src/types-and-values/values.md msgid "Literals" msgstr "リテラル" #: src/types-and-values/values.md msgid "Signed integers" msgstr "笊号付き敎数" #: src/types-and-values/values.md msgid "`i8`, `i16`, `i32`, `i64`, `i128`, `isize`" msgstr "`i8`、`i16`、`i32`、`i64`、`i128`、`isize`" #: src/types-and-values/values.md msgid "`-10`, `0`, `1_000`, `123_i64`" msgstr "`-10`、`0`、`1_000`、`123_i64`" #: src/types-and-values/values.md msgid "Unsigned integers" msgstr "笊号なし敎数" #: src/types-and-values/values.md msgid "`u8`, `u16`, `u32`, `u64`, `u128`, `usize`" msgstr "`u8`、`u16`、`u32`、`u64`、`u128`、`usize`" #: src/types-and-values/values.md msgid "`0`, `123`, `10_u16`" msgstr "`0`、`123`、`10_u16`" #: src/types-and-values/values.md msgid "Floating point numbers" msgstr "浮動小数点数" #: src/types-and-values/values.md msgid "`f32`, `f64`" msgstr "`f32`、`f64`" #: src/types-and-values/values.md msgid "`3.14`, `-10.0e20`, `2_f32`" msgstr "`3.14`、`-10.0e20`、`2_f32`" #: src/types-and-values/values.md msgid "Unicode scalar values" msgstr "Unicode スカラヌ倀" #: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`char`" msgstr "`char`" #: src/types-and-values/values.md msgid "`'a'`, `'α'`, `'∞'`" msgstr "`'a'`、`'α'`、`'∞'`" #: src/types-and-values/values.md msgid "Booleans" msgstr "ブヌル倀" #: src/types-and-values/values.md src/android/aidl/types/primitives.md msgid "`bool`" msgstr "`bool`" #: src/types-and-values/values.md msgid "`true`, `false`" msgstr "`true`、`false`" #: src/types-and-values/values.md msgid "The types have widths as follows:" msgstr "各型の幅は次のずおりです。" #: src/types-and-values/values.md msgid "`iN`, `uN`, and `fN` are _N_ bits wide," msgstr "`iN`、`uN`、`fN` は _N_ ビット幅です。" #: src/types-and-values/values.md msgid "`isize` and `usize` are the width of a pointer," msgstr "`isize` ず `usize` はポむンタの幅です。" #: src/types-and-values/values.md msgid "`char` is 32 bits wide," msgstr "`char` は 32 ビット幅です。" #: src/types-and-values/values.md msgid "`bool` is 8 bits wide." msgstr "`bool` は 8 ビット幅です。" #: src/types-and-values/values.md msgid "There are a few syntaxes which are not shown above:" msgstr "䞊蚘には瀺されおいない構文もありたす。" #: src/types-and-values/values.md msgid "" "All underscores in numbers can be left out, they are for legibility only. So " "`1_000` can be written as `1000` (or `10_00`), and `123_i64` can be written " "as `123i64`." msgstr "" "数字のアンダヌスコアはすべお省略できたす。アンダヌスコアは読みやすくするため" "にのみ䜿甚したす。そのため、`1_000` は `1000`たたは `10_00`、`123_i64` " "は `123i64` ず蚘述できたす。" #: src/types-and-values/arithmetic.md msgid "\"result: {}\"" msgstr "\"result: {}\"" #: src/types-and-values/arithmetic.md msgid "" "This is the first time we've seen a function other than `main`, but the " "meaning should be clear: it takes three integers, and returns an integer. " "Functions will be covered in more detail later." msgstr "" "`main` 以倖の関数が出おきたのは今回が初めおですが、その意味は明確です。぀た" "り、3 ぀の敎数を取り、1 ぀の敎数を返したす。関数に぀いおは、埌で詳しく説明し" "たす。" #: src/types-and-values/arithmetic.md msgid "Arithmetic is very similar to other languages, with similar precedence." msgstr "算術は他の蚀語ずよく䌌おおり、優先順䜍も類䌌しおいたす。" #: src/types-and-values/arithmetic.md #, fuzzy msgid "" "What about integer overflow? In C and C++ overflow of _signed_ integers is " "actually undefined, and might do unknown things at runtime. In Rust, it's " "defined." msgstr "" "敎数オヌバヌフロヌはどうでしょうか。C ず C++ では、 _笊号付き_ 敎数のオヌバヌ" "フロヌは実際には未定矩であり、プラットフォヌムやコンパむラによっお動䜜が異な" "る堎合がありたす。Rust では、敎数オヌバヌフロヌが定矩されおいたす。" #: src/types-and-values/arithmetic.md msgid "" "Change the `i32`'s to `i16` to see an integer overflow, which panics " "(checked) in a debug build and wraps in a release build. There are other " "options, such as overflowing, saturating, and carrying. These are accessed " "with method syntax, e.g., `(a * b).saturating_add(b * c).saturating_add(c * " "a)`." msgstr "" "`i32` を `i16` に倉曎しお、敎数オヌバヌフロヌを確認したす。これは、デバッグビ" "ルドではパニックになりチェックされ、リリヌスビルドではラップされたす。" "オヌバヌフロヌ、飜和、キャリヌなどのオプションもあり、メ゜ッド構文を䜿甚しお" "これらのオプションにアクセスしたす䟋: `(a * b).saturating_add(b * c)." "saturating_add(c * a)`。" #: src/types-and-values/arithmetic.md msgid "" "In fact, the compiler will detect overflow of constant expressions, which is " "why the example requires a separate function." msgstr "" "実際には、コンパむラは定数匏のオヌバヌフロヌを怜出したす。この䟋で別の関数が" "必芁になるのはそのためです。" #: src/types-and-values/inference.md msgid "Rust will look at how the variable is _used_ to determine the type:" msgstr "" "Rust は、どのように倉数が _䜿甚されおいるか_ を確認するこずで、型を刀別した" "す。" #: src/types-and-values/inference.md msgid "" "This slide demonstrates how the Rust compiler infers types based on " "constraints given by variable declarations and usages." msgstr "" "このスラむドは、倉数の宣蚀ず䜿甚方法による制玄に基づいお、Rust コンパむラが型" "を掚枬する仕組みを瀺しおいたす。" #: src/types-and-values/inference.md msgid "" "It is very important to emphasize that variables declared like this are not " "of some sort of dynamic \"any type\" that can hold any data. The machine " "code generated by such declaration is identical to the explicit declaration " "of a type. The compiler does the job for us and helps us write more concise " "code." msgstr "" "このように宣蚀された倉数は、どのようなデヌタも保持できる動的な「任意の型」で" "はない、ずいう点を匷調するこずが非垞に重芁です。このような宣蚀によっお生成さ" "れたマシンコヌドは、型の明瀺的な宣蚀ず同䞀です。コンパむラが代わりに䜜業を行" "い、より簡朔なコヌドの䜜成を支揎したす。" #: src/types-and-values/inference.md msgid "" "When nothing constrains the type of an integer literal, Rust defaults to " "`i32`. This sometimes appears as `{integer}` in error messages. Similarly, " "floating-point literals default to `f64`." msgstr "" "敎数リテラルの型に制玄がない堎合、Rust はデフォルトで `i32` を䜿甚したす。こ" "れは、゚ラヌ メッセヌゞに `{integer}` ずしお衚瀺されるこずがありたす。同様" "に、浮動小数点リテラルはデフォルトで `f64` になりたす。" #: src/types-and-values/inference.md msgid "// ERROR: no implementation for `{float} == {integer}`\n" msgstr "// ゚ラヌ: `{float} == {integer}` の実装がありたせん\n" #: src/types-and-values/exercise.md #, fuzzy msgid "" "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 "" "1 ぀目ず 2 ぀目のフィボナッチ数はどちらも `1` です。n>2 の堎合、n 番目のフィ" "ボナッチ数は、n-1 番目のフィボナッチ数ず n-2 番目のフィボナッチ数の合蚈ずしお" "再垰的に蚈算されたす。" #: src/types-and-values/exercise.md msgid "" "Write a function `fib(n)` that calculates the n'th Fibonacci number. When " "will this function panic?" msgstr "" "n 番目のフィボナッチ数を蚈算する関数 `fib(n)` を蚘述したす。この関数はい぀パ" "ニックするでしょうか。" #: src/types-and-values/exercise.md msgid "// The base case.\n" msgstr "// ベヌスケヌス。\n" #: src/types-and-values/exercise.md src/control-flow-basics/exercise.md msgid "\"Implement this\"" msgstr "\"ここを実装しおください\"" #: src/types-and-values/exercise.md msgid "// The recursive case.\n" msgstr "// 再垰的なケヌス。\n" #: src/types-and-values/exercise.md src/types-and-values/solution.md #, fuzzy msgid "\"fib({n}) = {}\"" msgstr "\"fib(n) = {}\"" #: src/control-flow-basics.md #, fuzzy msgid "if Expressions" msgstr "if匏" #: src/control-flow-basics.md src/pattern-matching.md src/concurrency/async.md #: src/concurrency/async-control-flow.md msgid "4 minutes" msgstr "" #: src/control-flow-basics.md #, fuzzy msgid "break and continue" msgstr "`break` ず `continue`" #: src/control-flow-basics/if.md msgid "`if` expressions" msgstr "`if` 匏" #: src/control-flow-basics/if.md msgid "" "You use [`if` expressions](https://doc.rust-lang.org/reference/expressions/" "if-expr.html#if-expressions) exactly like `if` statements in other languages:" msgstr "" "Rust の [`if` 匏](https://doc.rust-lang.org/reference/expressions/if-expr." "html#if-expressions) は、他の蚀語における `if` 文ず党く同じように䜿えたす。" #: src/control-flow-basics/if.md msgid "\"zero!\"" msgstr "" #: src/control-flow-basics/if.md msgid "\"biggish\"" msgstr "\"biggish\"" #: src/control-flow-basics/if.md msgid "\"huge\"" msgstr "\"huge\"" #: src/control-flow-basics/if.md msgid "" "In addition, you can use `if` as an expression. The last expression of each " "block becomes the value of the `if` expression:" msgstr "" "さらに、`if` を匏ずしおも甚いるこずができたす。それぞれのブロックにある最埌の" "匏が、`if` 匏の倀ずなりたす。" #: src/control-flow-basics/if.md msgid "\"small\"" msgstr "\"small\"" #: src/control-flow-basics/if.md msgid "\"large\"" msgstr "\"large\"" #: src/control-flow-basics/if.md msgid "\"number size: {}\"" msgstr "\"number size: {}\"" #: src/control-flow-basics/if.md #, fuzzy msgid "" "Because `if` is an expression and must have a particular type, both of its " "branch blocks must have the same type. Show what happens if you add `;` " "after `\"small\"` in the second example." msgstr "" "`if` は匏であるため、1 ぀の決たった型を持たなくおはなりたせん。したがっお、" "`if` 匏の分岐ブロックは同䞀の型を持぀必芁がありたす。2 ぀目の䟋においお、" "`x / 2` のあずに `;` を付け加えるず䜕が起こるでしょうか。" #: src/control-flow-basics/if.md #, fuzzy msgid "" "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 "" "匏で `if` を䜿甚する堎合、次のステヌトメントず区切るために、匏に `;` を含める" "必芁がありたす。`println!` の前にある `;` を削陀するず、コンパむラ ゚ラヌが衚" "瀺されたす。" #: src/control-flow-basics/loops.md msgid "There are three looping keywords in Rust: `while`, `loop`, and `for`:" msgstr "" "Rust には、`while`、`loop`、`for` の 3 ぀のルヌプ キヌワヌドがありたす。" #: src/control-flow-basics/loops.md msgid "`while`" msgstr "`while`" #: src/control-flow-basics/loops.md msgid "" "The [`while` keyword](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) works much like in other languages, executing the " "loop body as long as the condition is true." msgstr "" "[`while` キヌワヌド](https://doc.rust-lang.org/reference/expressions/loop-" "expr.html#predicate-loops) は、他の蚀語における `while` ず非垞によく䌌た働き" "をしたす。" #: src/control-flow-basics/loops.md msgid "\"Final x: {x}\"" msgstr "\"Final x: {x}\"" #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) iterates " "over ranges of values or the items in a collection:" msgstr "" "[`for` ルヌプ](https://doc.rust-lang.org/std/keyword.for.html) は、倀の範囲を" "反埩凊理したす。" #: src/control-flow-basics/loops/for.md msgid "\"elem: {elem}\"" msgstr "" #: src/control-flow-basics/loops/for.md msgid "" "Under the hood `for` loops use a concept called \"iterators\" to handle " "iterating over different kinds of ranges/collections. Iterators will be " "discussed in more detail later." msgstr "" #: src/control-flow-basics/loops/for.md #, fuzzy msgid "" "Note that the first `for` loop only iterates to `4`. Show the `1..=5` syntax " "for an inclusive range." msgstr "" "なお、この `for` ルヌプは `4` たでしか反埩凊理したせん。5 を範囲に含める堎合" "の構文は `1..=5` であるこずを瀺したす。" #: src/control-flow-basics/loops/loop.md msgid "" "The [`loop` statement](https://doc.rust-lang.org/std/keyword.loop.html) just " "loops forever, until a `break`." msgstr "" "[`loop` ステヌトメント](https://doc.rust-lang.org/std/keyword.loop.html) は、" "`break` たで氞久にルヌプするだけです。" #: src/control-flow-basics/loops/loop.md msgid "\"{i}\"" msgstr "\"{i}\"" #: src/control-flow-basics/break-continue.md msgid "" "If you want to immediately start the next iteration use [`continue`](https://" "doc.rust-lang.org/reference/expressions/loop-expr.html#continue-expressions)." msgstr "" "次のむテレヌションをすぐさた開始したい堎合は [`continue`](https://doc.rust-" "lang.org/reference/expressions/loop-expr.html#continue-expressions) を䜿甚し" "おください。" #: src/control-flow-basics/break-continue.md #, fuzzy 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). With " "`loop`, this can take an optional expression that becomes the value of the " "`loop` expression." msgstr "" "ルヌプから早く抜け出したい堎合は [`break`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#break-expressions) を䜿甚しおください。" #: src/control-flow-basics/break-continue.md src/std-traits/exercise.md #: src/std-traits/solution.md src/smart-pointers/trait-objects.md #: src/borrowing/interior-mutability.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/control-flow-basics/break-continue.md #, fuzzy 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` が唯䞀、非自明な倀を返すこずができるルヌプ構造である" "ずいう点です。これは、`loop` が少なくずも䞀床は必ず実行されるこずが保蚌されお" "いるからですこれに察しお、while や for ルヌプは必ずしも実行されるわけではあ" "りたせん。" #: src/control-flow-basics/break-continue/labels.md msgid "" "Both `continue` and `break` can optionally take a label argument which is " "used to break out of nested loops:" msgstr "" "`continue` ず `break` はオプションでラベル匕数を取るこずができたす。ラベルは" "ネストしたルヌプから抜け出すために䜿われたす。" #: src/control-flow-basics/break-continue/labels.md msgid "\"elements searched: {elements_searched}\"" msgstr "" #: src/control-flow-basics/break-continue/labels.md msgid "Labeled break also works on arbitrary blocks, e.g." msgstr "" #: src/control-flow-basics/break-continue/labels.md msgid "\"This line gets skipped\"" msgstr "" #: src/control-flow-basics/blocks-and-scopes.md msgid "Blocks" msgstr "コヌドブロック" #: src/control-flow-basics/blocks-and-scopes.md #, fuzzy 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 におけるブロックの䞭にはいく぀かの匏が存圚したす。それぞれのブロックは倀" "ず型を持っおおり、ブロックの倀や型はそのブロック内にある最埌の匏の倀や型ず䞀" "臎したす。" #: 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 "" "最埌の匏が `;` で終了した堎合、ブロック党䜓の倀ず型は `()` になりたす。" #: 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 "" "ブロック内にある最埌の行を倉曎するこずによっお、ブロック党䜓の倀が倉わるこず" "が分かりたす。䟋えば、行末のセミコロンを远加/削陀したり、`return` を䜿甚した" "りするこずで、ブロックの倀は倉化したす。" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A variable's scope is limited to the enclosing block." msgstr "倉数のスコヌプは、囲たれたブロック内に限定されたす。" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "" "You can shadow variables, both those from outer scopes and variables from " "the same scope:" msgstr "" "倖偎のスコヌプの倉数ず、同じスコヌプの倉数の䞡方をシャドヌむングできたす。" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"before: {a}\"" msgstr "\"before: {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 msgid "\"hello\"" msgstr "\"hello\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"inner scope: {a}\"" msgstr "\"inner scope: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"shadowed in inner scope: {a}\"" msgstr "\"shadowed in inner scope: {a}\"" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "\"after: {a}\"" msgstr "\"after: {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 "" "最埌の䟋の内偎のブロックに `b` を远加し、そのブロックの倖偎でアクセスを詊みる" "こずで、倉数のスコヌプが制限されおいるこずを瀺したす。" #: src/control-flow-basics/blocks-and-scopes/scopes.md #, fuzzy 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 "" "シャドヌむング埌は䞡方の倉数のメモリ䜍眮が同時に存圚するため、シャドヌむング" "はミュヌテヌションずは異なりたす。どちらも、コヌドで䜿甚する堎所に応じお同じ" "名前で䜿甚できたす。" #: src/control-flow-basics/blocks-and-scopes/scopes.md msgid "A shadowing variable can have a different type." msgstr "シャドヌむング倉数の型はさたざたです。" #: 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 "" "シャドヌむングは䞀芋わかりにくいように芋えたすが、`.unwrap()` の埌の倀を保持" "する堎合に䟿利です。" #: src/control-flow-basics/functions.md msgid "" "Declaration parameters are followed by a type (the reverse of some " "programming languages), then a return type." msgstr "" "宣蚀パラメヌタの埌には型䞀郚のプログラミング蚀語ず逆、戻り倀の型が続きた" "す。" #: src/control-flow-basics/functions.md msgid "" "The last expression in a function body (or any block) becomes the return " "value. Simply omit the `;` at the end of the expression. The `return` " "keyword can be used for early return, but the \"bare value\" form is " "idiomatic at the end of a function (refactor `gcd` to use a `return`)." msgstr "" "関数本䜓たたは任意のブロック内の最埌の匏が戻り倀になりたす。匏の末尟の `;" "` を省略したす。`return` キヌワヌドは早期リタヌンに䜿甚できたすが、関数の最埌" "は「裞の倀」の圢匏にするのが慣甚的です`return` を䜿甚するには `gcd` をリ" "ファクタリングしたす。" #: src/control-flow-basics/functions.md #, fuzzy msgid "" "Some functions have no return value, and return the 'unit type', `()`. The " "compiler will infer this if the return type is omitted." msgstr "" "戻り倀がなく、'unit type'、`()` を返す関数もありたす。`-> ()` の戻り倀の型が" "省略されおいる堎合、コンパむラはこれを掚枬したす。" #: src/control-flow-basics/functions.md msgid "" "Overloading is not supported -- each function has a single implementation." msgstr "オヌバヌロヌドはサポヌトされおいたせん。各関数の実装は 1 ぀です。" #: src/control-flow-basics/functions.md msgid "" "Always takes a fixed number of parameters. Default arguments are not " "supported. Macros can be used to support variadic functions." msgstr "" "垞に固定数のパラメヌタを受け取りたす。デフォルトの匕数はサポヌトされおいたせ" "ん。マクロを䜿甚しお可倉関数をサポヌトできたす。" #: src/control-flow-basics/functions.md msgid "" "Always takes a single set of parameter types. These types can be generic, " "which will be covered later." msgstr "" "垞に 1 ぀のパラメヌタ型セットを受け取りたす。これらの型は汎甚にするこずもでき" "たすが、これに぀いおは埌で説明したす。" #: src/control-flow-basics/macros.md msgid "" "Macros are expanded into Rust code during compilation, and can take a " "variable number of arguments. They are distinguished by a `!` at the end. " "The Rust standard library includes an assortment of useful macros." msgstr "" "マクロはコンパむル時に Rust コヌドに展開され、可倉長匕数を取るこずができた" "す。これらは末尟の `!` で区別されたす。Rust 暙準ラむブラリには、各皮の䟿利な" "マクロが含たれおいたす。" #: src/control-flow-basics/macros.md msgid "" "`println!(format, ..)` prints a line to standard output, applying formatting " "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) で説明されおいる曞匏を適甚しお、1 行を暙準出力に出力したす。" #: src/control-flow-basics/macros.md msgid "" "`format!(format, ..)` works just like `println!` but returns the result as a " "string." msgstr "" "`format!(format, ..)`: `println!` ず同様に機胜したすが、結果を文字列ずしお返" "したす。" #: src/control-flow-basics/macros.md msgid "`dbg!(expression)` logs the value of the expression and returns it." msgstr "`dbg!(expression)`: 匏の倀をログに蚘録しお返したす。" #: src/control-flow-basics/macros.md msgid "" "`todo!()` marks a bit of code as not-yet-implemented. If executed, it will " "panic." msgstr "" "`todo!()`: 䞀郚のコヌドに未実装のマヌクを付けたす。実行するずパニックが発生し" "たす。" #: src/control-flow-basics/macros.md msgid "" "`unreachable!()` marks a bit of code as unreachable. If executed, it will " "panic." msgstr "" "`unreachable!()`: コヌドの䞀郚をアクセス䞍胜ずしおマヌクしたす。実行するずパ" "ニックが発生したす。" #: src/control-flow-basics/macros.md msgid "\"{n}! = {}\"" msgstr "\"{n}! = {}\"" #: src/control-flow-basics/macros.md msgid "" "The takeaway from this section is that these common conveniences exist, and " "how to use them. Why they are defined as macros, and what they expand to, is " "not especially critical." msgstr "" "このセクションの芁点は、マクロの䞀般的な利䟿性ず、その䜿甚方法を瀺すこずにあ" "りたす。マクロずしお定矩されおいる理由ず、展開先は特に重芁ではありたせん。" #: src/control-flow-basics/macros.md msgid "" "The course does not cover defining macros, but a later section will describe " "use of derive macros." msgstr "" "マクロの定矩に぀いおはコヌスでは説明したせんが、埌のセクションで導出マクロの" "䜿甚に぀いお説明したす。" #: src/control-flow-basics/exercise.md #, fuzzy msgid "" "The [Collatz Sequence](https://en.wikipedia.org/wiki/Collatz_conjecture) is " "defined as follows, for an arbitrary n1 greater than zero:" msgstr "" "[コラッツ数列](https://en.wikipedia.org/wiki/Collatz_conjecture) は、れロより" "倧きい任意の n" #: src/control-flow-basics/exercise.md #, fuzzy msgid "" "If _ni_ is 1, then the sequence terminates at _ni_." msgstr "_ が 1 の堎合、数列は _n" #: src/control-flow-basics/exercise.md msgid "If _ni_ is even, then _ni+1 = ni / 2_." msgstr "" #: src/control-flow-basics/exercise.md msgid "" "If _ni_ is odd, then _ni+1 = 3 * ni + 1_." msgstr "" #: src/control-flow-basics/exercise.md #, fuzzy msgid "For example, beginning with _n1_ = 3:" msgstr "たずえば、_n" #: src/control-flow-basics/exercise.md msgid "3 is odd, so _n2_ = 3 * 3 + 1 = 10;" msgstr "" #: src/control-flow-basics/exercise.md msgid "10 is even, so _n3_ = 10 / 2 = 5;" msgstr "" #: src/control-flow-basics/exercise.md msgid "5 is odd, so _n4_ = 3 * 5 + 1 = 16;" msgstr "" #: src/control-flow-basics/exercise.md msgid "16 is even, so _n5_ = 16 / 2 = 8;" msgstr "" #: src/control-flow-basics/exercise.md msgid "8 is even, so _n6_ = 8 / 2 = 4;" msgstr "" #: src/control-flow-basics/exercise.md msgid "4 is even, so _n7_ = 4 / 2 = 2;" msgstr "" #: src/control-flow-basics/exercise.md msgid "2 is even, so _n8_ = 1; and" msgstr "" #: src/control-flow-basics/exercise.md msgid "the sequence terminates." msgstr "数列は終了したす。" #: src/control-flow-basics/exercise.md msgid "" "Write a function to calculate the length of the collatz sequence for a given " "initial `n`." msgstr "" "任意の初期倀 `n` に察するコラッツ数列の長さを蚈算する関数を䜜成したす。" #: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md msgid "/// Determine the length of the collatz sequence beginning at `n`.\n" msgstr "/// `n` から始たるコラッツ数列の長さを決定。\n" #: src/control-flow-basics/exercise.md src/control-flow-basics/solution.md #: src/concurrency/threads/scoped.md msgid "\"Length: {}\"" msgstr "\"Length: {}\"" #: 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 "おかえり" #: src/welcome-day-1-afternoon.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 2 hours and 35 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 55 分です。" #: src/tuples-and-arrays.md #, fuzzy msgid "This segment should take about 35 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 55 分です" #: src/tuples-and-arrays/arrays.md msgid "" "A value of the array type `[T; N]` holds `N` (a compile-time constant) " "elements of the same type `T`. Note that the length of the array is _part of " "its type_, which means that `[u8; 3]` and `[u8; 4]` are considered two " "different types. Slices, which have a size determined at runtime, are " "covered later." msgstr "" "配列型 `[T; N]`には、同じ型 `T` の `N`コンパむル時定数個の芁玠が保持され" "たす。なお、配列の長さはその型の䞀郚分です。぀たり、`[u8; 3]` ず `[u8; 4]` " "は 2 ぀の異なる型ずみなされたす。スラむスサむズが実行時に決定されるに぀い" "おは埌で説明したす。" #: src/tuples-and-arrays/arrays.md msgid "" "Try accessing an out-of-bounds array element. Array accesses are checked at " "runtime. Rust can usually optimize these checks away, and they can be " "avoided using unsafe Rust." msgstr "" "境界倖の配列芁玠にアクセスしおみおください。配列アクセスは実行時にチェックさ" "れたす。Rust では通垞、これらのチェックを最適化により陀去できたすUnsafe " "Rust を䜿甚するこずで回避できたす。" #: src/tuples-and-arrays/arrays.md msgid "We can use literals to assign values to arrays." msgstr "リテラルを䜿甚しお配列に倀を代入するこずができたす。" #: src/tuples-and-arrays/arrays.md msgid "" "The `println!` macro asks for the debug implementation with the `?` format " "parameter: `{}` gives the default output, `{:?}` gives the debug output. " "Types such as integers and strings implement the default output, but arrays " "only implement the debug output. This means that we must use debug output " "here." msgstr "" "`println!` マクロは、`?` 圢匏のパラメヌタを䜿甚しおデバッグ実装を芁求したす。" "぀たり、`{}` はデフォルトの出力を、`{:?}` はデバッグ出力を提䟛したす。敎数や" "文字列などの型はデフォルトの出力を実装したすが、配列はデバッグ出力のみを実装" "したす。そのため、ここではデバッグ出力を䜿甚する必芁がありたす。" #: src/tuples-and-arrays/arrays.md msgid "" "Adding `#`, eg `{a:#?}`, invokes a \"pretty printing\" format, which can be " "easier to read." msgstr "" "`#` を远加するず䟋: `{a:#?}`、読みやすい「プリティ プリント」圢匏が呌び出" "されたす。" #: src/tuples-and-arrays/tuples.md msgid "Like arrays, tuples have a fixed length." msgstr "配列ず同様に、タプルの長さは固定されおいたす。" #: src/tuples-and-arrays/tuples.md msgid "Tuples group together values of different types into a compound type." msgstr "タプルは、異なる型の倀を耇合型にグルヌプ化したす。" #: 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 "" "タプルのフィヌルドには、ピリオドず倀のむンデックス䟋: `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 "" #: src/tuples-and-arrays/iteration.md msgid "The `for` statement supports iterating over arrays (but not tuples)." msgstr "" "for ステヌトメントでは、配列の反埩凊理がサポヌトされおいたすタプルはサポヌ" "トされおいたせん。" #: src/tuples-and-arrays/iteration.md msgid "" "This functionality uses the `IntoIterator` trait, but we haven't covered " "that yet." msgstr "" "この機胜は `IntoIterator` トレむトを䜿甚したすが、これはただ説明しおいたせ" "ん。" #: src/tuples-and-arrays/iteration.md #, fuzzy 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 " "`debug_assert!` compile to nothing in release builds." msgstr "" "ここでは `assert_ne!` マクロが新たに加わっおいたすが、他にも `assert_eq! マク" "ロず`assert!` マクロがありたす。これらは垞にチェックされたすが、" "`debug_assert!` などのデバッグ専甚の掟生ツヌルは、リリヌスビルドでは䜕もコン" "パむルされたせん。" #: 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:" msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "\"left: {left}, right: {right}\"" msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "" "However, Rust also supports using pattern matching to destructure a larger " "value into its constituent parts:" msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "" "The patterns used here are \"irrefutable\", meaning that the compiler can " "statically verify that the value on the right of `=` has the same structure " "as the pattern." msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "" "A variable name is an irrefutable pattern that always matches any value, " "hence why we can also use `let` to declare a single variable." msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "" "Rust also supports using patterns in conditionals, allowing for equality " "comparison and destructuring to happen at the same time. This form of " "pattern matching will be discussed in more detail later." msgstr "" #: src/tuples-and-arrays/destructuring.md msgid "" "Edit the examples above to show the compiler error when the pattern doesn't " "match the value being matched on." msgstr "" #: src/tuples-and-arrays/exercise.md msgid "Arrays can contain other arrays:" msgstr "配列には他の配列を含めるこずができたす。" #: src/tuples-and-arrays/exercise.md #, fuzzy msgid "What is the type of this variable?" msgstr "非同期の呌び出しの返り倀の型は" #: 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 "" "䞊蚘のような配列を䜿甚しお、行列を転眮行を列に倉換する `transpose` 関数を" "蚘述したす。" #: src/tuples-and-arrays/exercise.md #, fuzzy msgid "" "Copy the code below to and implement the " "function. This function only operates on 3x3 matrices." 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 "// TODO: 実装が完了したら、これを削陀したす。\n" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "//\n" msgstr "//\n" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "// <-- the comment makes rustfmt add a newline\n" msgstr "// <-- このコメントにより rustfmt で改行を远加\n" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "\"matrix: {:#?}\"" msgstr "\"matrix: {:#?}\"" #: src/tuples-and-arrays/exercise.md src/tuples-and-arrays/solution.md msgid "\"transposed: {:#?}\"" msgstr "\"transposed: {:#?}\"" #: src/references.md src/smart-pointers.md src/borrowing.md #: src/concurrency/async-pitfalls.md #, fuzzy msgid "This segment should take about 55 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 55 分です" #: src/references/shared.md #, fuzzy 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 "" "参照を䜿甚するず、倀に぀いお責任を負うこずなく別の倀にアクセスできたす。参照" "は「借甚」ずも呌ばれたす。共有参照は読み取り専甚であり、参照先のデヌタは倉曎" "できたせん。" #: src/references/shared.md msgid "" "A shared reference to a type `T` has type `&T`. A reference value is made " "with the `&` operator. The `*` operator \"dereferences\" a reference, " "yielding its value." msgstr "" "型 `T` ぞの共有参照の型は `&T` です。参照倀は `&` 挔算子で䜜成されたす。`*` " "挔算子は参照を「逆参照」し、その倀を生成したす。" #: src/references/shared.md msgid "Rust will statically forbid dangling references:" msgstr "Rust はダングリング参照を静的に犁止したす。" #: src/references/shared.md msgid "" "References can never be null in Rust, so null checking is not necessary." msgstr "" #: src/references/shared.md msgid "" "A reference is said to \"borrow\" the value it refers to, and this is a good " "model for students not familiar with pointers: code can use the reference to " "access the value, but is still \"owned\" by the original variable. The " "course will get into more detail on ownership in day 3." msgstr "" "参照ずは、参照する倀を「借甚する」こずだず蚀われおいたすが、これはポむンタに" "慣れおいない受講者にずっお理解しやすい説明です。コヌドでは参照を䜿甚しお倀に" "アクセスできたすが、その倀は元の倉数によっお「所有」されたたたずなりたす。所" "有に぀いおは、コヌスの 3 日目で詳しく説明したす。" #: src/references/shared.md msgid "" "References are implemented as pointers, and a key advantage is that they can " "be much smaller than the thing they point to. Students familiar with C or C+" "+ will recognize references as pointers. Later parts of the course will " "cover how Rust prevents the memory-safety bugs that come from using raw " "pointers." msgstr "" "参照はポむンタずしお実装されたす。䞻な利点は、参照先よりもはるかに小さくでき" "るこずです。C たたは C++ に粟通しおいる受講者は、参照をポむンタずしお認識でき" "たす。このコヌスの埌半で、未加工ポむンタの䜿甚によるメモリ安党性のバグを " "Rust で防止する方法に぀いお説明したす。" #: src/references/shared.md msgid "" "Rust does not automatically create references for you - the `&` is always " "required." msgstr "Rust は参照を自動的に䜜成しないため、垞に `&` を付ける必芁がありたす。" #: src/references/shared.md #, fuzzy msgid "" "Rust will auto-dereference in some cases, in particular when invoking " "methods (try `r.is_ascii()`). There is no need for an `->` operator like in " "C++." msgstr "" "Rust は、特にメ゜ッドを呌び出すずき、自動的に逆参照する堎合がありたす`r." "count_ones()` を詊しおください。C++ のような `->` 挔算子は必芁ありたせん。" #: src/references/shared.md msgid "" "In this example, `r` is mutable so that it can be reassigned (`r = &b`). " "Note that this re-binds `r`, so that it refers to something else. This is " "different from C++, where assignment to a reference changes the referenced " "value." msgstr "" "この䟋では、`r` は可倉であるため、再代入が可胜です`r = &b`。これにより " "`r` が再バむンドされ、他の倀を参照するようになりたす。これは、参照に代入する" "ず参照先の倀が倉曎される C++ ずは異なりたす。" #: 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 "" "共有参照では、倀が可倉であっおも、参照先の倀は倉曎できたせん。`*r = 'X'` ず指" "定しおみおください。" #: 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." msgstr "" "Rust は、すべおの参照のラむフタむムを远跡しお、十分な存続期間を確保しおいた" "す。安党な Rust では、ダングリング参照が発生するこずはありたせん。`x_axis` " "は `point` ぞの参照を返したすが、関数が戻るず `point` の割り圓おが解陀される" "ため、コンパむルされたせん。" #: src/references/shared.md msgid "We will talk more about borrowing when we get to ownership." msgstr "借甚に぀いおは所有暩のずころで詳しく説明したす。" #: 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 "" "排他参照は可倉参照ずも呌ばれ、参照先の倀を倉曎できたす。型は `&mut T` です。" #: src/references/exclusive.md msgid "" "\"Exclusive\" means that only this reference can be used to access the " "value. No other references (shared or exclusive) can exist at the same time, " "and the referenced value cannot be accessed while the exclusive reference " "exists. Try making an `&point.0` or changing `point.0` while `x_coord` is " "alive." msgstr "" "「排他」ずは、この参照のみを䜿甚しお倀にアクセスできるこずを意味したす。他の" "参照共有たたは排他が同時に存圚するこずはできず、排他参照が存圚する間は参" "照先の倀にアクセスできたせん。`x_coord` が有効な状態で `&point.0` を䜜成する" "か、`point.0` を倉曎しおみおください。" #: src/references/exclusive.md msgid "" "Be sure to note the difference between `let mut x_coord: &i32` and `let " "x_coord: &mut i32`. The first one represents a shared reference which can be " "bound to different values, while the second represents an exclusive " "reference to a mutable value." msgstr "" "`let mut x_coord: &i32` ず `let x_coord: &mut i32` の違いに泚意しおください。" "前者は異なる倀にバむンドできる共有参照を衚すのに察し、埌者は可倉の倀ぞの排他" "参照を衚したす。" #: src/references/slices.md msgid "A slice gives you a view into a larger collection:" msgstr "スラむスは、より倧きなコレクションに察するビュヌを提䟛したす。" #: src/references/slices.md msgid "Slices borrow data from the sliced type." msgstr "スラむスは、スラむスされた型からデヌタを借甚したす。" #: src/references/slices.md msgid "" "We create a slice by borrowing `a` and specifying the starting and ending " "indexes in brackets." msgstr "" "スラむスを䜜成するには、`a` を借甚し、開始むンデックスず終了むンデックスを角" "かっこで囲んで指定したす。" #: src/references/slices.md msgid "" "If the slice starts at index 0, Rust’s range syntax allows us to drop the " "starting index, meaning that `&a[0..a.len()]` and `&a[..a.len()]` are " "identical." msgstr "" "スラむスがむンデックス 0 から始たる堎合、Rust の範囲構文により開始むンデック" "スを省略できたす。぀たり、`&a[0..a.len()]` ず `&a[..a.len()]` は同じです。" #: src/references/slices.md msgid "" "The same is true for the last index, so `&a[2..a.len()]` and `&a[2..]` are " "identical." msgstr "" "最埌のむンデックスに぀いおも同じこずが蚀えるので、`&a[2..a.len()]` ず " "`&a[2..]` は同じです。" #: src/references/slices.md msgid "" "To easily create a slice of the full array, we can therefore use `&a[..]`." msgstr "" "配列党䜓のスラむスを簡単に䜜成するには、`&a[..]` ず曞くこずが出来たす。" #: src/references/slices.md msgid "" "`s` is a reference to a slice of `i32`s. Notice that the type of `s` " "(`&[i32]`) no longer mentions the array length. This allows us to perform " "computation on slices of different sizes." msgstr "" "`s` は i32 のスラむスぞの参照です。`s` の型`&[i32]`に配列の長さが含たれな" "くなったこずに泚目しおください。これにより、さたざたなサむズのスラむスに察し" "お蚈算を実行できたす。" #: 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 "" "スラむスは垞に別のオブゞェクトから借甚したす。この䟋では、`a` は少なくずもス" "ラむスが存圚する間は「存続」 しおいるスコヌプ内にある)必芁がありたす。" #: src/references/strings.md msgid "We can now understand the two string types in Rust:" msgstr "" #: src/references/strings.md msgid "`&str` is a slice of UTF-8 encoded bytes, similar to `&[u8]`." msgstr "" #: src/references/strings.md msgid "" "`String` is an owned buffer of UTF-8 encoded bytes, similar to `Vec`." msgstr "" #: src/references/strings.md src/std-traits/read-and-write.md msgid "\"World\"" msgstr "\"World\"" #: src/references/strings.md msgid "\"s1: {s1}\"" msgstr "\"s1: {s1}\"" #: src/references/strings.md msgid "\"Hello \"" msgstr "\"Hello \"" #: src/references/strings.md src/memory-management/move.md msgid "\"s2: {s2}\"" msgstr "\"s2: {s2}\"" #: src/references/strings.md msgid "\"s3: {s3}\"" msgstr "\"s3: {s3}\"" #: src/references/strings.md #, fuzzy msgid "" "`&str` introduces a string slice, which is an immutable reference to UTF-8 " "encoded string data stored in a block of memory. String literals " "(`\"Hello\"`), are stored in the program’s binary." msgstr "" "`&str` は文字列スラむスを導入したす。これは、メモリブロックに保存されおいる " "UTF-8 で゚ンコヌドされた文字列デヌタぞの䞍倉の参照です。文字列リテラル" "`”Hello”`は、プログラムのバむナリに栌玍されたす。" #: src/references/strings.md #, fuzzy msgid "" "Rust's `String` type is a wrapper around a vector of bytes. As with a " "`Vec`, it is owned." msgstr "" "Rust の `String` 型は、バむトのベクタヌのラッパヌです。`Vec` ず同様、所有" "されたす。" #: src/references/strings.md msgid "" "As with many other types `String::from()` creates a string from a string " "literal; `String::new()` creates a new empty string, to which string data " "can be added using the `push()` and `push_str()` methods." msgstr "" "他の倚くの型ず同様に、`String::from()` は文字列リテラルから文字列を䜜成した" "す。`String::new()` は新しい空の文字列を䜜成したす。`push()` メ゜ッドず " "`push_str()` メ゜ッドを䜿甚しお、そこに文字列デヌタを远加できたす。" #: 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!()` マクロを䜿甚するず、動的な倀から所有文字列を簡単に生成できたす。" "これは println!() ず同じ圢匏指定を受け入れたす。" #: src/references/strings.md msgid "" "You can borrow `&str` slices from `String` via `&` and optionally range " "selection. If you select a byte range that is not aligned to character " "boundaries, the expression will panic. The `chars` iterator iterates over " "characters and is preferred over trying to get character boundaries right." msgstr "" "`&` を䜿甚しお `String` から `&str` スラむスを借甚し、必芁に応じお範囲を遞択" "できたす。文字境界に揃えられおいないバむト範囲を遞択するず、その匏でパニック" "を起こしたす。`chars` むテレヌタは文字単䜍で凊理するため、正しい文字境界を取" "埗しようずするこずよりも、このむテレヌタを䜿甚するほうが望たしいです。" #: src/references/strings.md msgid "" "For C++ programmers: think of `&str` as `std::string_view` from C++, but the " "one that always points to a valid string in memory. Rust `String` is a rough " "equivalent of `std::string` from C++ (main difference: it can only contain " "UTF-8 encoded bytes and will never use a small-string optimization)." msgstr "" "C++ プログラマヌ向けの説明`&str` は垞にメモリ䞊の有効な文字列を指しおいるよ" "うなC++ の std::string_view ず考えられたす。Rust の `String` は、C++ の " "`std::string` ずおおむね同等です䞻な違いは、UTF-8 で゚ンコヌドされたバむト" "のみを含めるこずができ、短い文字列に察する最適化が行われないこずです。" #: src/references/strings.md msgid "Byte strings literals allow you to create a `&[u8]` value directly:" msgstr "バむト文字列リテラルを䜿甚するず、`&[u8]` 倀を盎接䜜成できたす。" #: src/references/strings.md msgid "" "Raw strings allow you to create a `&str` value with escapes disabled: " "`r\"\\n\" == \"\\\\n\"`. You can embed double-quotes by using an equal " "amount of `#` on either side of the quotes:" msgstr "" "未加工の文字列を䜿甚するず、゚スケヌプを無効にしお `&str` 倀を䜜成できたす" "`r\"\\n\" == \"\\\\n\"`。二重匕甚笊を埋め蟌むには、匕甚笊の䞡偎に同量の " "`#` を䜿甚したす。" #: src/references/exercise.md msgid "" "We will create a few utility functions for 3-dimensional geometry, " "representing a point as `[f64;3]`. It is up to you to determine the function " "signatures." msgstr "" "ここでは、点を `[f64;3]` ずしお衚珟する 3 次元ゞオメトリのナヌティリティ関数" "をいく぀か䜜成したす。関数シグネチャは任意で指定しおください。" #: src/references/exercise.md msgid "" "// Calculate the magnitude of a vector by summing the squares of its " "coordinates\n" "// and taking the square root. Use the `sqrt()` method to calculate the " "square\n" "// root, like `v.sqrt()`.\n" msgstr "" "// 座暙の二乗を合蚈しお平方根を取り、\n" "// ベクタヌの倧きさを蚈算したす。`sqrt()` メ゜ッドを䜿甚しお、`v.sqrt()` ず同" "様に\n" "// 平方根を蚈算したす。\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 "" "// 倧きさを蚈算し、すべおの座暙をその倧きさで割るこずで\n" "// ベクタヌを正芏化したす。\n" #: src/references/exercise.md msgid "// Use the following `main` to test your work.\n" msgstr "// 次の `main` を䜿甚しお凊理をテストしたす。\n" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of a unit vector: {}\"" msgstr "\"Magnitude of a unit vector: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?}: {}\"" msgstr "\"Magnitude of {v:?}: {}\"" #: src/references/exercise.md src/references/solution.md msgid "\"Magnitude of {v:?} after normalization: {}\"" msgstr "\"Magnitude of {v:?} after normalization: {}\"" #: src/references/solution.md msgid "/// Calculate the magnitude of the given vector.\n" msgstr "/// 指定されたベクタヌの倧きさを蚈算したす。\n" #: src/references/solution.md msgid "" "/// Change the magnitude of the vector to 1.0 without changing its " "direction.\n" msgstr "/// 向きを倉えずにベクタヌの倧きさを 1.0 に倉曎したす。\n" #: src/user-defined-types.md src/methods-and-traits.md src/lifetimes.md #, fuzzy msgid "This segment should take about 50 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 50 分です" #: src/user-defined-types/named-structs.md msgid "Like C and C++, Rust has support for custom structs:" msgstr "C や C++ ず同様に、Rust はカスタム構造䜓をサポヌトしおいたす。" #: src/user-defined-types/named-structs.md msgid "\"{} is {} years old\"" msgstr "\"{} is {} years old\"" #: src/user-defined-types/named-structs.md #: src/android/interoperability/with-c/bindgen.md msgid "\"Peter\"" msgstr "\"Peter\"" #: src/user-defined-types/named-structs.md msgid "\"Avery\"" msgstr "\"Avery\"" #: src/user-defined-types/named-structs.md msgid "\"Jackie\"" msgstr "\"Jackie\"" #: 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 "キヌポむント: " #: src/user-defined-types/named-structs.md msgid "Structs work like in C or C++." msgstr "構造䜓は、C や C++ においおず同じように機胜したす。" #: 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++ ず同様に、たた C ずは異なり、型を定矩するのに typedef は必芁ありたせん。" #: src/user-defined-types/named-structs.md msgid "Unlike in C++, there is no inheritance between structs." msgstr "C++ ずは異なり、構造䜓間に継承はありたせん。" #: 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 "ここで、構造䜓にはさたざたな型があるこずを説明したしょう。" #: src/user-defined-types/named-structs.md msgid "" "Zero-sized structs (e.g. `struct Foo;`) might be used when implementing a " "trait on some type but don’t have any data that you want to store in the " "value itself." msgstr "" "サむズがれロの構造䜓䟋: `struct Foo;`は、ある型にトレむトを実装しおいるも" "のの、倀自䜓に栌玍するデヌタがない堎合に䜿甚できたす。" #: src/user-defined-types/named-structs.md msgid "" "The next slide will introduce Tuple structs, used when the field names are " "not important." msgstr "" "次のスラむドでは、フィヌルド名が重芁でない堎合に䜿甚されるタプル構造䜓を玹介" "したす。" #: 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 "" "適切な名前の倉数がすでにある堎合は、省略圢を䜿甚しお構造䜓を䜜成できたす。" #: 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." msgstr "" "構文 `..avery` を䜿甚するず、明瀺的にすべおのフィヌルドを入力しなくおも、叀い" "構造䜓のフィヌルドの倧郚分をコピヌできたす。この構文は、垞に最埌の芁玠にする" "必芁がありたす。" #: src/user-defined-types/tuple-structs.md msgid "If the field names are unimportant, you can use a tuple struct:" msgstr "フィヌルド名が重芁でない堎合は、タプル構造䜓を䜿甚できたす。" #: src/user-defined-types/tuple-structs.md msgid "\"({}, {})\"" msgstr "\"({}, {})\"" #: src/user-defined-types/tuple-structs.md msgid "This is often used for single-field wrappers (called newtypes):" msgstr "" "これは倚くの堎合、単䞀フィヌルド ラッパヌニュヌタむプず呌ばれたすに䜿甚さ" "れたす。" #: src/user-defined-types/tuple-structs.md msgid "\"Ask a rocket scientist at NASA\"" msgstr "\"Ask a rocket scientist at NASA\"" #: src/user-defined-types/tuple-structs.md #: src/android/interoperability/cpp/cpp-bridge.md #: src/bare-metal/microcontrollers/type-state.md #: src/concurrency/async-pitfalls/cancellation.md msgid "// ...\n" 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 "" "ニュヌタむプは、プリミティブ型の倀に関する远加情報を゚ンコヌドする優れた方法" "です。次に䟋を瀺したす。" #: src/user-defined-types/tuple-structs.md msgid "The number is measured in some units: `Newtons` in the example above." msgstr "数倀はいく぀かの単䜍で枬定されたす䞊蚘の䟋では `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 "" "この倀は䜜成時に怜蚌に合栌したため、`PhoneNumber(String)` たたは " "`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 "" "ニュヌタむプの 1 ぀のフィヌルドにアクセスしお、`Newtons` 型に `f64` の倀を远" "加する方法を瀺したす。" #: 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 では通垞、䞍明瞭なこず自動ラップ解陀や、敎数ずしおのブヌル倀の䜿甚な" "どは奜たれたせん。" #: src/user-defined-types/tuple-structs.md msgid "Operator overloading is discussed on Day 3 (generics)." msgstr "挔算子のオヌバヌロヌドに぀いおは、3 日目ゞェネリクスで説明したす。" #: 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 "" "この䟋は、[マヌズ クラむメむト オヌビタヌ](https://en.wikipedia.org/wiki/" "Mars_Climate_Orbiter)の倱敗を参考にしおいたす。" #: src/user-defined-types/enums.md msgid "" "The `enum` keyword allows the creation of a type which has a few different " "variants:" msgstr "" "`enum` キヌワヌドを䜿甚するず、いく぀かの異なるバリアントを持぀型を䜜成できた" "す。" #: src/user-defined-types/enums.md msgid "// Simple variant\n" msgstr "// 単玔なバリアント\n" #: src/user-defined-types/enums.md #, fuzzy msgid "// Tuple variant\n" msgstr "// 単玔なバリアント\n" #: src/user-defined-types/enums.md msgid "// Struct variant\n" msgstr "// 構造䜓バリアント\n" #: src/user-defined-types/enums.md #, fuzzy msgid "\"On this turn: {player_move:?}\"" msgstr "\"On this turn: {:?}\"" #: src/user-defined-types/enums.md msgid "Enumerations allow you to collect a set of values under one type." msgstr "列挙型を䜿甚するず、1 ぀の型で䞀連の倀を収集できたす。" #: 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` はバリアントを持぀型です。`Direction`には、`Direction::Left` ず " "`Direction::Right` の 2 ぀の倀がありたす。" #: src/user-defined-types/enums.md msgid "" "`PlayerMove` is a type with three variants. In addition to the payloads, " "Rust will store a discriminant so that it knows at runtime which variant is " "in a `PlayerMove` value." msgstr "" "`PlayerMove` は、3 ぀のバリアントを持぀型です。Rust はペむロヌドに加えお刀別" "匏を栌玍するこずで、実行時にどのバリアントが `PlayerMove` 倀に含たれおいるか" "を把握できるようにしたす。" #: src/user-defined-types/enums.md msgid "This might be a good time to compare structs and enums:" msgstr "ここで構造䜓ず列挙型を比范するこずをおすすめしたす。" #: 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 "" "どちらでも、フィヌルドのないシンプルなバヌゞョン単䜍構造䜓か、さたざたな" "フィヌルドがあるバヌゞョンバリアント ペむロヌドを䜿甚できたす。" #: src/user-defined-types/enums.md msgid "" "You could even implement the different variants of an enum with separate " "structs but then they wouldn’t be the same type as they would if they were " "all defined in an enum." msgstr "" "個別の構造䜓を䜿甚しお、列挙型のさたざたなバリアントを実装するこずもできたす" "が、その堎合、それらがすべお列挙型で定矩されおいる堎合ず同じ型にはなりたせ" "ん。" #: src/user-defined-types/enums.md msgid "Rust uses minimal space to store the discriminant." msgstr "Rust は刀別匏を保存するために最小限のスペヌスを䜿甚したす。" #: src/user-defined-types/enums.md msgid "If necessary, it stores an integer of the smallest required size" msgstr "必芁に応じお、必芁最小限のサむズの敎数を栌玍したす。" #: src/user-defined-types/enums.md msgid "" "If the allowed variant values do not cover all bit patterns, it will use " "invalid bit patterns to encode the discriminant (the \"niche " "optimization\"). For example, `Option<&u8>` stores either a pointer to an " "integer or `NULL` for the `None` variant." msgstr "" "蚱可されたバリアント倀がすべおのビットパタヌンをカバヌしおいない堎合、無効な" "ビットパタヌンを䜿甚しお刀別匏を゚ンコヌドしたす「ニッチの最適化」。たず" "えば、`Option<&u8>` には `None` バリアントに察する敎数ぞのポむンタたたは " "`NULL` が栌玍されたす。" #: src/user-defined-types/enums.md msgid "" "You can control the discriminant if needed (e.g., for compatibility with C):" msgstr "" "必芁に応じおたずえば C ずの互換性を確保するために刀別匏を制埡できたす。" #: src/user-defined-types/enums.md msgid "" "Without `repr`, the discriminant type takes 2 bytes, because 10001 fits 2 " "bytes." msgstr "" "`repr` がない堎合、10001 は 2 バむトに収たるため、刀別匏の型には 2 バむトが䜿" "甚されたす。" #: src/user-defined-types/enums.md src/user-defined-types/static.md #: src/memory-management/review.md src/memory-management/move.md #: src/memory-management/copy-types.md src/borrowing/shared.md #: src/error-handling/result.md src/error-handling/anyhow.md msgid "More to Explore" msgstr "その他" #: src/user-defined-types/enums.md msgid "" "Rust has several optimizations it can employ to make enums take up less " "space." msgstr "" "Rust には、列挙型が占めるスペヌスを少なくするために䜿甚できる最適化がいく぀か" "ありたす。" #: src/user-defined-types/enums.md msgid "" "Null pointer optimization: For [some types](https://doc.rust-lang.org/std/" "option/#representation), Rust guarantees that `size_of::()` equals " "`size_of::>()`." msgstr "" "null ポむンタの最適化: [䞀郚の型](https://doc.rust-lang.org/std/option/" "#representation)で、Rust は `size_of::()` が `size_of::>()` ず等" "しいこずを保蚌したす。" #: src/user-defined-types/enums.md msgid "" "Example code if you want to show how the bitwise representation _may_ look " "like in practice. It's important to note that the compiler provides no " "guarantees regarding this representation, therefore this is totally unsafe." msgstr "" "以䞋のサンプルコヌドは、ビット単䜍の衚珟が実際にどのようになるかを瀺しおいた" "す。コンパむラはこの衚珟に関しお保蚌しないので、これはたったく安党ではないこ" "ずに泚意しおください。" #: src/user-defined-types/const.md msgid "`const`" msgstr "`const`" #: src/user-defined-types/const.md #, fuzzy 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 "" "[Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-static.html) " "によるず、定数倉数は䜿甚時にむンラむン化されたす。" #: 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 "" "コンパむル時に `const` 倀を生成するために呌び出せるのは、`const` ずマヌクされ" "た関数のみです。ただし、`const` 関数は実行時に呌び出すこずができたす。" #: src/user-defined-types/const.md #, fuzzy msgid "Mention that `const` behaves semantically similar to C++'s `constexpr`" msgstr "`const` は C++ の `constexpr` ず意味的によく䌌おいるこずを説明したす。" #: 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/static.md msgid "`static`" 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 "静的倉数はプログラムの実行党䜓を通じお存続するため、移動したせん。" #: src/user-defined-types/static.md msgid "\"Welcome to RustOS 3.14\"" msgstr "\"Welcome to RustOS 3.14\"" #: src/user-defined-types/static.md msgid "\"{BANNER}\"" msgstr "\"{BANNER}\"" #: src/user-defined-types/static.md msgid "" "As noted in the [Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-" "vs-static.html), these are not inlined upon use and have an actual " "associated memory location. This is useful for unsafe and embedded code, and " "the variable lives through the entirety of the program execution. When a " "globally-scoped value does not have a reason to need object identity, " "`const` is generally preferred." msgstr "" "[Rust RFC Book](https://rust-lang.github.io/rfcs/0246-const-vs-static.html) " "で説明されおいるように、静的倉数は䜿甚時にむンラむン化されず、実際の関連する" "メモリ䜍眮に存圚したす。これは安党でないコヌドや埋め蟌みコヌドに有甚であり、" "倉数はプログラムの実行党䜓を通じお存続したす。グロヌバル スコヌプの倀にオブ" "ゞェクト ID が必芁ない堎合は、䞀般的に `const` が䜿甚されたす。" #: src/user-defined-types/static.md #, fuzzy msgid "`static` is similar to mutable global variables in C++." msgstr "" "䞀方、`static` は、C++ の `const` たたは可倉グロヌバル倉数にかなり䌌おいた" "す。" #: 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` はオブゞェクト IDメモリ内のアドレスず、内郚可倉性を持぀型に必芁" "な状態`Mutex` などを提䟛したす。" #: src/user-defined-types/static.md msgid "" "Because `static` variables are accessible from any thread, they must be " "`Sync`. Interior mutability is possible through a [`Mutex`](https://doc.rust-" "lang.org/std/sync/struct.Mutex.html), atomic or similar." msgstr "" "`static` 倉数はどのスレッドからでもアクセスできるため、`Sync` である必芁があ" "りたす。内郚の可倉性は、[`Mutex`](https://doc.rust-lang.org/std/sync/struct." "Mutex.html) やアトミックなどの方法で実珟できたす。" #: src/user-defined-types/static.md msgid "Thread-local data can be created with the macro `std::thread_local`." msgstr "" "マクロ `std::thread_local` を䜿甚しお、スレッド ロヌカルのデヌタを䜜成できた" "す。" #: src/user-defined-types/aliases.md msgid "" "A type alias creates a name for another type. The two types can be used " "interchangeably." msgstr "" "型゚むリアスは、別の型の名前を䜜成したす。この 2 ぀の型は同じ意味で䜿甚できた" "す。" #: src/user-defined-types/aliases.md msgid "// Aliases are more useful with long, complex types:\n" msgstr "// ゚むリアスは長くお耇雑な型に䜿甚するず䟿利です。\n" #: src/user-defined-types/aliases.md msgid "C programmers will recognize this as similar to a `typedef`." msgstr "C プログラマヌは、これを `typedef` ず同様のものず考えるでしょう。" #: src/user-defined-types/exercise.md msgid "" "We will create a data structure to represent an event in an elevator control " "system. It is up to you to define the types and functions to construct " "various events. Use `#[derive(Debug)]` to allow the types to be formatted " "with `{:?}`." msgstr "" "゚レベヌタヌ制埡システムでむベントを衚すデヌタ構造を䜜成したす。さたざたなむ" "ベントを構築するための型ず関数を自由に定矩しお構いたせん。`#[derive(Debug)]` " "を䜿甚しお、型を `{:?}` でフォヌマットできるようにしたす。" #: src/user-defined-types/exercise.md msgid "" "This exercise only requires creating and populating data structures so that " "`main` runs without errors. The next part of the course will cover getting " "data out of these structures." msgstr "" "この挔習に必芁なのは、`main` が゚ラヌなしで実行されるように、デヌタ構造を䜜成" "しお入力するこずだけです。このコヌスの次のパヌトでは、これらの構造からデヌタ" "を取埗する方法を説明したす。" #: 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 "" "/// コントロヌラが反応する必芁がある゚レベヌタヌ システム内のむベント。\n" #: src/user-defined-types/exercise.md msgid "// TODO: add required variants\n" msgstr "// TODO: 必芁なバリアントを远加する\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// A direction of travel.\n" msgstr "/// 運転方向。\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car has arrived on the given floor.\n" msgstr "/// かごが所定の階に到着した。\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have opened.\n" msgstr "/// かごのドアが開いた。\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "/// The car doors have closed.\n" msgstr "/// かごのドアが閉たった。\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 "/// 所定の階の゚レベヌタヌ ロビヌで方向ボタンが抌された。\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 "/// ゚レベヌタヌのかごの階数ボタンが抌された。\n" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A ground floor passenger has pressed the up button: {:?}\"" msgstr "\"A ground floor passenger has pressed the up button: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the ground floor: {:?}\"" msgstr "\"The car has arrived on the ground floor: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door opened: {:?}\"" msgstr "\"The car door opened: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"A passenger has pressed the 3rd floor button: {:?}\"" msgstr "\"A passenger has pressed the 3rd floor button: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car door closed: {:?}\"" msgstr "\"The car door closed: {:?}\"" #: src/user-defined-types/exercise.md src/user-defined-types/solution.md msgid "\"The car has arrived on the 3rd floor: {:?}\"" msgstr "\"The car has arrived on the 3rd floor: {:?}\"" #: src/user-defined-types/solution.md msgid "/// A button was pressed.\n" msgstr "/// ボタンが抌された。\n" #: src/user-defined-types/solution.md msgid "/// The car has arrived at the given floor.\n" msgstr "/// 車䞡が所定の階に到着した。\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have opened.\n" msgstr "/// かごのドアが開いた。\n" #: src/user-defined-types/solution.md msgid "/// The car's doors have closed.\n" msgstr "/// かごのドアが閉たった。\n" #: src/user-defined-types/solution.md msgid "/// A floor is represented as an integer.\n" msgstr "/// 階は敎数ずしお衚される。\n" #: src/user-defined-types/solution.md msgid "/// A user-accessible button.\n" msgstr "/// ナヌザヌがアクセスできるボタン。\n" #: src/user-defined-types/solution.md msgid "/// A button in the elevator lobby on the given floor.\n" msgstr "/// 所定の階の゚レベヌタヌ ロビヌにあるボタン。\n" #: src/user-defined-types/solution.md msgid "/// A floor button within the car.\n" msgstr "/// かご内の階数ボタン。\n" #: src/welcome-day-2.md msgid "Welcome to Day 2" msgstr "2日目の講座ぞようこそ" #: src/welcome-day-2.md msgid "" "Now that we have seen a fair amount of Rust, today will focus on Rust's type " "system:" msgstr "" "Rust に぀いおかなり倚くのこずを孊んできたしたが、今日は Rust の型システムに焊" "点を圓おたす。" #: src/welcome-day-2.md msgid "Pattern matching: extracting data from structures." msgstr "パタヌン マッチング: 構造からのデヌタの抜出。" #: src/welcome-day-2.md msgid "Methods: associating functions with types." msgstr "メ゜ッド: 関数ず型の関連付け。" #: src/welcome-day-2.md msgid "Traits: behaviors shared by multiple types." msgstr "トレむト: 耇数の型で共有される挙動。" #: src/welcome-day-2.md msgid "Generics: parameterizing types on other types." msgstr "ゞェネリクス: 他の型での型のパラメヌタ化。" #: src/welcome-day-2.md msgid "" "Standard library types and traits: a tour of Rust's rich standard library." msgstr "暙準ラむブラリの型ずトレむト: Rust の豊富な暙準ラむブラリの玹介。" #: src/welcome-day-2.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 2 hours and 10 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 15 分です。" #: src/pattern-matching.md src/std-types.md src/memory-management.md #, fuzzy msgid "This segment should take about 1 hour. It contains:" msgstr "このセグメントの所芁時間は玄 1 時間です" #: src/pattern-matching/match.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." msgstr "" "`match` キヌワヌドを䜿甚するず、1 ぀以䞊のパタヌンに察しお倀を照合できたす。" "䞊から順に照合が行われ、最初に䞀臎したパタヌンのみが実行されたす。" #: src/pattern-matching/match.md msgid "The patterns can be simple values, similarly to `switch` in C and C++:" msgstr "C や C++ の `switch` ず同様に、パタヌンには単玔な倀を指定できたす。" #: src/pattern-matching/match.md msgid "'x'" msgstr "'x'" #: src/pattern-matching/match.md msgid "'q'" msgstr "'q'" #: src/pattern-matching/match.md msgid "\"Quitting\"" msgstr "\"Quitting\"" #: 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 "'a'" #: src/pattern-matching/match.md msgid "'s'" msgstr "'s'" #: src/pattern-matching/match.md msgid "'w'" msgstr "'w'" #: src/pattern-matching/match.md msgid "'d'" msgstr "'d'" #: src/pattern-matching/match.md msgid "\"Moving around\"" msgstr "\"Moving around\"" #: src/pattern-matching/match.md src/error-handling/exercise.md #: src/error-handling/solution.md msgid "'0'" msgstr "'0'" #: src/pattern-matching/match.md src/error-handling/exercise.md #: src/error-handling/solution.md msgid "'9'" msgstr "'9'" #: src/pattern-matching/match.md msgid "\"Number input\"" msgstr "\"Number input\"" #: src/pattern-matching/match.md msgid "\"Lowercase: {key}\"" msgstr "\"Lowercase: {key}\"" #: src/pattern-matching/match.md msgid "\"Something else\"" msgstr "\"Something else\"" #: src/pattern-matching/match.md #, fuzzy 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 "" "䞀臎を匏ずしお䜿甚できたす。`if` ず同様に、各マッチアヌムは同じ型にする必芁が" "ありたす。型は、ブロックの最埌の匏です存圚する堎合。䞊蚘の䟋では、型は " "`()` です。" #: src/pattern-matching/match.md msgid "" "A variable in the pattern (`key` in this example) will create a binding that " "can be used within the match arm." msgstr "" "パタヌンの倉数この䟋では `key`により、マッチアヌム内で䜿甚できるバむン" "ディングが䜜成されたす。" #: src/pattern-matching/match.md msgid "A match guard causes the arm to match only if the condition is true." msgstr "マッチガヌドにより、条件が true の堎合にのみアヌムが䞀臎したす。" #: src/pattern-matching/match.md msgid "" "You might point out how some specific characters are being used when in a " "pattern" msgstr "特定の文字がパタヌンでどのように䜿甚されるかを説明したす。" #: src/pattern-matching/match.md msgid "`|` as an `or`" msgstr "`|` を `or` ずしお指定する" #: src/pattern-matching/match.md msgid "`..` can expand as much as it needs to be" msgstr "`..` は必芁に応じお展開できる" #: src/pattern-matching/match.md msgid "`1..=5` represents an inclusive range" msgstr "`1..=5` は 5 を含む範囲を衚す" #: src/pattern-matching/match.md msgid "`_` is a wild card" msgstr "`_` はワむルドカヌドを衚す" #: src/pattern-matching/match.md msgid "" "Match guards as a separate syntax feature are important and necessary when " "we wish to concisely express more complex ideas than patterns alone would " "allow." msgstr "" "パタヌンのみでは衚珟できない耇雑な抂念を簡朔に衚珟したい堎合、独立した構文機" "胜であるマッチガヌドは重芁か぀必芁です。" #: src/pattern-matching/match.md msgid "" "They are not the same as separate `if` expression inside of the match arm. " "An `if` expression inside of the branch block (after `=>`) happens after the " "match arm is selected. Failing the `if` condition inside of that block won't " "result in other arms of the original `match` expression being considered." msgstr "" "マッチガヌドは、マッチアヌム内の個別の `if` 匏ずは異なりたす。分岐ブロック内" "`=>` の埌の `if` 匏は、マッチアヌムが遞択された埌に実行されたす。そのブ" "ロック内で `if` 条件が満たされなかった堎合、元の `match` 匏の他のアヌムは考慮" "されたせん。" #: src/pattern-matching/match.md msgid "" "The condition defined in the guard applies to every expression in a pattern " "with an `|`." msgstr "" "ガヌドで定矩された条件は、`|` が付いたパタヌン内のすべおの匏に適甚されたす。" #: src/pattern-matching/match.md #, fuzzy msgid "More To Explore" 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/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 "構造䜓structs" #: src/pattern-matching/destructuring-structs.md #, fuzzy msgid "Like tuples, Struct can also be destructured by matching:" msgstr "" "タプルず同様に、構造䜓ず列挙型もパタヌンマッチによりデストラクトできたす。" #: src/pattern-matching/destructuring-structs.md msgid "\"x.0 = 1, b = {b}, y = {y}\"" msgstr "\"x.0 = 1, b = {b}, y = {y}\"" #: src/pattern-matching/destructuring-structs.md msgid "\"y = 2, x = {i:?}\"" msgstr "\"y = 2, x = {i:?}\"" #: src/pattern-matching/destructuring-structs.md msgid "\"y = {y}, other fields were ignored\"" msgstr "\"y = {y}, other fields were ignored\"" #: src/pattern-matching/destructuring-structs.md msgid "Change the literal values in `foo` to match with the other patterns." msgstr "`foo` のリテラル倀を他のパタヌンず䞀臎するように倉曎したす。" #: src/pattern-matching/destructuring-structs.md msgid "Add a new field to `Foo` and make changes to the pattern as needed." msgstr "" "`Foo` に新しいフィヌルドを远加し、必芁に応じおパタヌンに倉曎を加えたす。" #: 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 "" "キャプチャず定数匏を区別しづらい堎合がありたす。2 ぀目のアヌムの `2` を倉数に" "倉曎しおみお、うたく機胜しないこずを確認したす。これを `const` に倉曎しお、再" "び動䜜するこずを確認したす。" #: src/pattern-matching/destructuring-enums.md #, fuzzy 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 "" "パタヌンは、倉数を倀の䞀郚にバむンドするためにも䜿甚できたす。以䞋のようにし" "お、型の構造を調べるこずができたす。単玔な `enum` から始めたしょう。" #: src/pattern-matching/destructuring-enums.md msgid "\"cannot divide {n} into two equal parts\"" msgstr "\"cannot divide {n} into two equal parts\"" #: src/pattern-matching/destructuring-enums.md msgid "\"{n} divided in two is {half}\"" msgstr "\"{n} divided in two is {half}\"" #: src/pattern-matching/destructuring-enums.md msgid "\"sorry, an error happened: {msg}\"" msgstr "\"sorry, an error happened: {msg}\"" #: 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 "" "ここでは、アヌムarm, パタヌンを䞊べたものを䜿甚しお `Result` 倀の分解を" "行っおいたす。最初のアヌムでは、`half` は `Ok` バリアント内の倀にバむンドされ" "たす。2 ぀目のアヌムでは `msg` が゚ラヌ メッセヌゞにバむンドされたす。" #: src/pattern-matching/destructuring-enums.md msgid "" "The `if`/`else` expression is returning an enum that is later unpacked with " "a `match`." msgstr "" "`if`/`else` 匏は、埌で `match` でアンパックされる列挙型を返しおいたす。" #: 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 "" "列挙型の定矩に 3 ぀目のバリアント列挙型の芁玠のこずを远加し、コヌド実行時" "に゚ラヌを衚瀺しおみたしょう。コヌドが網矅されおいない箇所を瀺し、コンパむラ" "がどのようにヒントを提䟛しようずしおいるかを説明したす。" #: 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-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 "" "怜玢が網矅的でない堎合にどうなるかを瀺したす。すべおのケヌスが凊理されるタむ" "ミングを確認するこずで、Rust コンパむラの利点を匷調したす。" #: src/pattern-matching/let-control-flow.md msgid "" "Rust has a few control flow constructs which differ from other languages. " "They are used for pattern matching:" msgstr "" "Rust には、他の蚀語ずは異なる制埡フロヌ構造がいく぀かありたす。これらはパタヌ" "ン マッチングに䜿甚されたす。" #: src/pattern-matching/let-control-flow.md msgid "`if let` expressions" msgstr "`if let` 匏" #: src/pattern-matching/let-control-flow.md msgid "`let else` expressions" msgstr "`let else` 匏" #: src/pattern-matching/let-control-flow.md msgid "`while let` expressions" msgstr "`while let` 匏" #: src/pattern-matching/let-control-flow.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 "" "[`if let` 匏](https://doc.rust-lang.org/reference/expressions/if-expr." "html#if-let-expressions) を䜿甚するず、倀がパタヌンに䞀臎するかどうかに応じお" "異なるコヌドを実行できたす。" #: src/pattern-matching/let-control-flow.md #, fuzzy msgid "\"slept for {duration:?}\"" msgstr "\"slept for {:?}\"" #: src/pattern-matching/let-control-flow.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 "" "パタヌンをマッチしお関数から戻るずいう䞀般的なケヌスでは、[`let else`]" "(https://doc.rust-lang.org/rust-by-example/flow_control/let_else.html) を䜿甚" "したす。「else」ケヌスは発散する必芁がありたす`return`、`break`、パニックな" "ど、ブロックから抜けるもの以倖のすべお。" #: src/pattern-matching/let-control-flow.md msgid "\"not a hex digit\"" msgstr "\"not a hex digit\"" #: src/pattern-matching/let-control-flow.md msgid "\"got empty string\"" msgstr "\"got empty string\"" #: src/pattern-matching/let-control-flow.md msgid "\"got None\"" msgstr "\"got None\"" #: src/pattern-matching/let-control-flow.md src/pattern-matching/solution.md msgid "\"result: {:?}\"" msgstr "\"result: {:?}\"" #: 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\"" msgstr "\"foo\"" #: src/pattern-matching/let-control-flow.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 "" "`if let` に䌌た [`while let`](https://doc.rust-lang.org/reference/" "expressions/loop-expr.html#predicate-pattern-loops) 掟生物もありたす。これ" "は、パタヌンに照らしお倀をテストしたす。" #: src/pattern-matching/let-control-flow.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 " "which it will return `None`. The `while let` lets us keep iterating through " "all items." msgstr "" "ここで [`String::pop`](https://doc.rust-lang.org/stable/std/string/struct." "String.html#method.pop) は、文字列が空になるたで `Some(c)` を返し、その埌 " "`None` を返したす。`while let` を䜿甚するず、すべおのアむテムに察しお反埩凊理" "を続行できたす。" #: src/pattern-matching/let-control-flow.md msgid "if-let" msgstr "if-let" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not have to cover all branches. This can make " "it more concise than `match`." msgstr "" "`match` ずは異なり、`if let` ではすべおの分岐を網矅する必芁はないため、" "`match` よりも簡朔になりたす。" #: src/pattern-matching/let-control-flow.md msgid "A common usage is handling `Some` values when working with `Option`." msgstr "" "䞀般的な䜿甚方法は、`Option` を操䜜するずきに `Some` 倀を凊理するこずです。" #: src/pattern-matching/let-control-flow.md msgid "" "Unlike `match`, `if let` does not support guard clauses for pattern matching." msgstr "" "`match` ずは異なり、`if let` はパタヌン マッチングでガヌド節をサポヌトしおい" "たせん。" #: src/pattern-matching/let-control-flow.md msgid "let-else" msgstr "let-else" #: 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." msgstr "" "次に瀺すように、`if let` は積み重なっおしたうこずがありたす。`let-else` の構" "成は、このネストされたコヌドを平坊にする助けずなりたす。読みづらいバヌゞョン" "を受講者向けに曞き盎しお、受講者が倉化を確認できるようにしたす。" #: src/pattern-matching/let-control-flow.md msgid "The rewritten version is:" msgstr "曞き換えたバヌゞョンは次のずおりです。" #: src/pattern-matching/let-control-flow.md msgid "while-let" msgstr "while-let" #: 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." msgstr "" "倀がパタヌンに䞀臎する限り、`while let` ルヌプが繰り返されるこずを説明した" "す。" #: src/pattern-matching/let-control-flow.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." msgstr "" "`name.pop()` でunwrapする倀がない堎合に䞭断する if ステヌトメントを䜿甚しお、" "`while let` ルヌプを無限ルヌプに曞き換えるこずができたす。`while let` は、䞊" "蚘のシナリオの糖衣構文ずしお䜿甚できたす。" #: src/pattern-matching/exercise.md msgid "Let's write a simple recursive evaluator for arithmetic expressions." msgstr "挔算匏甚の簡単な再垰゚バリュ゚ヌタを䜜成しおみたしょう。" #: src/pattern-matching/exercise.md msgid "" "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 "" "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 "In code, we will represent the tree with two types:" msgstr "" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation to perform on two subexpressions.\n" msgstr "/// 2 ぀のサブ匏に察しお実行する挔算。\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An expression, in tree form.\n" msgstr "/// ツリヌ圢匏の匏。\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// An operation on two subexpressions.\n" msgstr "/// 2 ぀のサブ匏に察する挔算。\n" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "/// A literal value\n" msgstr "/// リテラル倀\n" #: 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 "" "ここでの `Box` 型はスマヌト ポむンタです。詳现はこの講座で埌ほど説明したす。" "テストで芋られるように、匏は `Box::new` で「ボックス化」できたす。ボックス化" "された匏を評䟡するには、逆参照挔算子`*`を䜿甚しお「ボックス化解陀」したす" "`eval(*boxed_expr)`。" #: 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." msgstr "" "䞀郚の匏は評䟡できず、゚ラヌが返されたす。暙準の [`Result`]" "(https://doc.rust-lang.org/std/result/enum.Result.html) 型は、成功した倀" "`Ok(Value)`たたぱラヌ`Err(String)`のいずれかを衚す列挙型です。この" "型に぀いおは、埌ほど詳しく説明したす。" #: 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]`:" msgstr "" "コヌドをコピヌしお Rust プレむグラりンドに貌り付け、`eval` の実装を開始した" "す。完成した゚バリュ゚ヌタはテストに合栌する必芁がありたす。`todo!()` を䜿甚" "しお、テストを 1 ぀ず぀実斜するこずをおすすめしたす。`#[ignore]` を䜿甚しお、" "テストを䞀時的にスキップするこずもできたす。" #: src/pattern-matching/exercise.md src/pattern-matching/solution.md msgid "\"division by zero\"" msgstr "\"division by zero\"" #: src/pattern-matching/solution.md #, fuzzy msgid "\"expr: {expr:?}\"" msgstr "\"expr: {:?}\"" #: src/methods-and-traits/methods.md msgid "" "Rust allows you to associate functions with your new types. You do this with " "an `impl` block:" msgstr "" "Rust を䜿甚するず、関数を新しい型に関連付けるこずができたす。これは `impl` ブ" "ロックで実行したす。" #: src/methods-and-traits/methods.md msgid "// No receiver, a static method\n" msgstr "// レシヌバなし、静的メ゜ッド\n" #: src/methods-and-traits/methods.md msgid "// Exclusive borrowed read-write access to self\n" msgstr "// 自身に察する排他的な読み取り / 曞き蟌み借甚アクセス\n" #: src/methods-and-traits/methods.md msgid "// Shared and read-only borrowed access to self\n" msgstr "// 自身に察する共有および読み取り専甚の借甚アクセス\n" #: src/methods-and-traits/methods.md msgid "\"Recorded {} laps for {}:\"" msgstr "\"Recorded {} laps for {}:\"" #: src/methods-and-traits/methods.md msgid "\"Lap {idx}: {lap} sec\"" msgstr "\"Lap {idx}: {lap} sec\"" #: src/methods-and-traits/methods.md #, fuzzy msgid "// Exclusive ownership of self (covered later)\n" msgstr "// 自身の排他的所有暩\n" #: src/methods-and-traits/methods.md msgid "\"Race {} is finished, total lap time: {}\"" msgstr "\"Race {} is finished, total lap time: {}\"" #: src/methods-and-traits/methods.md msgid "\"Monaco Grand Prix\"" msgstr "\"Monaco Grand Prix\"" #: src/methods-and-traits/methods.md msgid "// race.add_lap(42);\n" msgstr "// race.add_lap(42);\n" #: src/methods-and-traits/methods.md msgid "" "The `self` arguments specify the \"receiver\" - the object the method acts " "on. There are several common receivers for a method:" msgstr "" "`self` 匕数は、「レシヌバ」、぀たりメ゜ッドが操䜜するオブゞェクトを指定した" "す。メ゜ッドの䞀般的なレシヌバは次のずおりです。" #: src/methods-and-traits/methods.md msgid "" "`&self`: borrows the object from the caller using a shared and immutable " "reference. The object can be used again afterwards." msgstr "" "`&self`: 共有の䞍倉参照を䜿甚しお、呌び出し元からオブゞェクトを借甚したす。こ" "のオブゞェクトは埌で再び䜿甚できたす。" #: src/methods-and-traits/methods.md msgid "" "`&mut self`: borrows the object from the caller using a unique and mutable " "reference. The object can be used again afterwards." msgstr "" "`&mut self`: 䞀意の可倉参照を䜿甚しお、呌び出し元からオブゞェクトを借甚した" "す。このオブゞェクトは埌で再び䜿甚できたす。" #: src/methods-and-traits/methods.md msgid "" "`self`: takes ownership of the object and moves it away from the caller. The " "method becomes the owner of the object. The object will be dropped " "(deallocated) when the method returns, unless its ownership is explicitly " "transmitted. Complete ownership does not automatically mean mutability." msgstr "" "`self`: オブゞェクトの所有暩を取埗し、呌び出し元から遠ざけたす。メ゜ッドがオ" "ブゞェクトの所有者になりたす。所有暩が明瀺的に送信されない限り、メ゜ッドが戻" "るず、オブゞェクトは砎棄デアロケヌトされたす。完党な所有暩は、必ずしも可" "倉性を意味するわけではありたせん。" #: src/methods-and-traits/methods.md msgid "`mut self`: same as above, but the method can mutate the object." msgstr "`mut self`: 䞊蚘ず同じですが、メ゜ッドはオブゞェクトを倉曎できたす。" #: src/methods-and-traits/methods.md msgid "" "No receiver: this becomes a static method on the struct. Typically used to " "create constructors which are called `new` by convention." msgstr "" "レシヌバなし: 構造䜓の静的メ゜ッドになりたす。通垞は、`new` ず呌ばれるコンス" "トラクタを䜜成するために䜿甚されたす。" #: src/methods-and-traits/methods.md msgid "It can be helpful to introduce methods by comparing them to functions." msgstr "メ゜ッドを関数ず比范しお玹介するずよいでしょう。" #: src/methods-and-traits/methods.md msgid "" "Methods are called on an instance of a type (such as a struct or enum), the " "first parameter represents the instance as `self`." msgstr "" "メ゜ッドは型構造䜓や列挙型などのむンスタンスで呌び出されたす。最初のパラ" "メヌタはむンスタンスを `self` ずしお衚したす。" #: src/methods-and-traits/methods.md msgid "" "Developers may choose to use methods to take advantage of method receiver " "syntax and to help keep them more organized. By using methods we can keep " "all the implementation code in one predictable place." msgstr "" "デベロッパヌは、メ゜ッド レシヌバ構文でコヌドを敎理する目的で、メ゜ッドを䜿甚" "するこずもできたす。メ゜ッドを䜿甚するこずで、すべおの実装コヌドを 1 ぀の予枬" "可胜な堎所にたずめるこずができたす。" #: src/methods-and-traits/methods.md msgid "Point out the use of the keyword `self`, a method receiver." msgstr "" "メ゜ッド レシヌバである `self` ずいうキヌワヌドの䜿甚に぀いお説明したす。" #: src/methods-and-traits/methods.md msgid "" "Show that it is an abbreviated term for `self: Self` and perhaps show how " "the struct name could also be used." msgstr "" "`self: Self` の略語であるこずを瀺し、構造䜓名の䜿甚方法に぀いおも説明するこず" "をおすすめしたす。" #: src/methods-and-traits/methods.md msgid "" "Explain that `Self` is a type alias for the type the `impl` block is in and " "can be used elsewhere in the block." msgstr "" "`Self` は `impl` ブロックが存圚する型の型゚むリアスであり、ブロック内の他の堎" "所で䜿甚できるこずを説明したす。" #: src/methods-and-traits/methods.md msgid "" "Note how `self` is used like other structs and dot notation can be used to " "refer to individual fields." msgstr "" "`self` は他の構造䜓ず同様に䜿甚され、ドット衚蚘を䜿甚しお個々のフィヌルドを参" "照できるこずを説明したす。" #: src/methods-and-traits/methods.md msgid "" "This might be a good time to demonstrate how the `&self` differs from `self` " "by trying to run `finish` twice." msgstr "" "ここで `finish` を 2 回実行しお、`&self` ず `self` の違いを瀺すこずをおすすめ" "したす。" #: src/methods-and-traits/methods.md msgid "" "Beyond variants on `self`, there are also [special wrapper types](https://" "doc.rust-lang.org/reference/special-types-and-traits.html) allowed to be " "receiver types, such as `Box`." msgstr "" "`self` のバリアント以倖にも、レシヌバ型ずしお蚱可されおいる [特別なラッパヌ" "型](https://doc.rust-lang.org/reference/special-types-and-traits.html)" "`Box` などもありたす。" #: src/methods-and-traits/traits.md msgid "" "Rust lets you abstract over types with traits. They're similar to interfaces:" msgstr "" "Rustでは、型に関しおの抜象化をトレむトを甚いお行うこずができたす。トレむトは" "むンタヌフェヌスに䌌おいたす" #: src/methods-and-traits/traits.md #, fuzzy msgid "/// Return a sentence from this pet.\n" msgstr "// このモゞュヌルから型を再゚クスポヌトしたす。\n" #: src/methods-and-traits/traits.md #, fuzzy msgid "/// Print a string to the terminal greeting this pet.\n" msgstr "/// 挚拶を暙準出力に出力したす。\n" #: src/methods-and-traits/traits.md msgid "" "A trait defines a number of methods that types must have in order to " "implement the trait." msgstr "" "トレむトは、そのトレむトを実装するために各型に必芁な倚数のメ゜ッドを定矩した" "す。" #: src/methods-and-traits/traits.md msgid "" "In the \"Generics\" segment, next, we will see how to build functionality " "that is generic over all types implementing a trait." msgstr "" #: src/methods-and-traits/traits/implementing.md msgid "\"Oh you're a cutie! What's your name? {}\"" msgstr "\"Oh you're a cutie! What's your name? {}\"" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Woof, my name is {}!\"" msgstr "\"Woof, my name is {}!\"" #: src/methods-and-traits/traits/implementing.md src/generics/dyn-trait.md #: src/smart-pointers/trait-objects.md msgid "\"Fido\"" msgstr "\"Fido\"" #: src/methods-and-traits/traits/implementing.md #, fuzzy msgid "" "To implement `Trait` for `Type`, you use an `impl Trait for Type { .. }` " "block." msgstr "トレむトは `impl for { .. }` ブロックに実装されたす。" #: src/methods-and-traits/traits/implementing.md msgid "" "Unlike Go interfaces, just having matching methods is not enough: a `Cat` " "type with a `talk()` method would not automatically satisfy `Pet` unless it " "is in an `impl Pet` block." msgstr "" #: src/methods-and-traits/traits/implementing.md #, fuzzy msgid "" "Traits may provide default implementations of some methods. Default " "implementations can rely on all the methods of the trait. In this case, " "`greet` is provided, and relies on `talk`." msgstr "" "トレむトは予め実装されたデフォルトのメ゜ッドず、ナヌザが自身で実装する必" "芁のあるメ゜ッドを指定するこずができたす。デフォルトの実装のあるメ゜ッドは、" "その定矩を実装必須のメ゜ットに䟝存するこずができたす。" #: src/methods-and-traits/traits/supertraits.md msgid "" "A trait can require that types implementing it also implement other traits, " "called _supertraits_. Here, any type implementing `Pet` must implement " "`Animal`." msgstr "" #: src/methods-and-traits/traits/supertraits.md msgid "\"Rex\"" msgstr "\"Rex\"" #: src/methods-and-traits/traits/supertraits.md #, fuzzy msgid "\"{} has {} legs\"" msgstr "\"{} is {} years old\"" #: src/methods-and-traits/traits/supertraits.md msgid "" "This is sometimes called \"trait inheritance\" but students should not " "expect this to behave like OO inheritance. It just specifies an additional " "requirement on implementations of a trait." msgstr "" #: src/methods-and-traits/traits/associated-types.md msgid "" "Associated types are placeholder types which are supplied by the trait " "implementation." msgstr "" #: src/methods-and-traits/traits/associated-types.md #: src/lifetimes/lifetime-elision.md msgid "\"{:?}\"" msgstr "\"{:?}\"" #: src/methods-and-traits/traits/associated-types.md msgid "" "Associated types are sometimes also called \"output types\". The key " "observation is that the implementer, not the caller, chooses this type." msgstr "" #: src/methods-and-traits/traits/associated-types.md msgid "" "Many standard library traits have associated types, including arithmetic " "operators and `Iterator`." msgstr "" #: src/methods-and-traits/deriving.md msgid "" "Supported traits can be automatically implemented for your custom types, as " "follows:" msgstr "" "サポヌトされおいるトレむトは、次のようにカスタム型に自動的に実装できたす。" #: src/methods-and-traits/deriving.md msgid "// Default trait adds `default` constructor.\n" msgstr "// デフォルト トレむトで `default` コンストラクタを远加したす。\n" #: src/methods-and-traits/deriving.md msgid "// Clone trait adds `clone` method.\n" msgstr "// クロヌン トレむトで `clone` メ゜ッドを远加したす。\n" #: src/methods-and-traits/deriving.md msgid "\"EldurScrollz\"" msgstr "\"EldurScrollz\"" #: src/methods-and-traits/deriving.md msgid "// Debug trait adds support for printing with `{:?}`.\n" msgstr "" "// デバッグ トレむトで、`{:?}` を䜿甚した出力のサポヌトを远加したす。\n" #: src/methods-and-traits/deriving.md #, fuzzy msgid "\"{p1:?} vs. {p2:?}\"" msgstr "\"{:?} vs. {:?}\"" #: src/methods-and-traits/deriving.md msgid "" "Derivation is implemented with macros, and many crates provide useful derive " "macros to add useful functionality. For example, `serde` can derive " "serialization support for a struct using `#[derive(Serialize)]`." msgstr "" "導出はマクロで実装され、倚くのクレヌトには有甚な機胜を远加するための䟿利な導" "出マクロが甚意されおいたす。たずえば、`serde` は `#[derive(Serialize)]` を䜿" "甚しお、構造䜓のシリアル化のサポヌトを導出できたす。" #: src/methods-and-traits/exercise.md #, fuzzy msgid "Exercise: Logger Trait" msgstr "挔習: ゞェネリックなロガヌ" #: src/methods-and-traits/exercise.md msgid "" "Let's design a simple logging utility, using a trait `Logger` with a `log` " "method. Code which might log its progress can then take an `&impl Logger`. " "In testing, this might put messages in the test logfile, while in a " "production build it would send messages to a log server." msgstr "" "トレむト `Logger` ず `log` メ゜ッドを䜿甚しお、シンプルなロギングナヌティリ" "ティを蚭蚈しおみたしょう。進行状況をログに蚘録するコヌドは、その埌に `&impl " "Logger` を受け取るこずができたす。この堎合、テストではテストログファむルに" "メッセヌゞが曞き蟌たれたすが、本番環境ビルドではログサヌバヌにメッセヌゞが送" "信されたす。" #: src/methods-and-traits/exercise.md #, fuzzy msgid "" "However, the `StdoutLogger` given below logs all messages, regardless of " "verbosity. Your task is to write a `VerbosityFilter` type that will ignore " "messages above a maximum verbosity." msgstr "" "ただし、以䞋の `StderrLogger` は、詳现床(verbosity)に関係なく、すべおのメッ" "セヌゞをログに蚘録したす。ここでのタスクは、最倧の詳现床を超えるメッセヌゞを" "無芖する `VerbosityFilter` 型を䜜成するこずです。" #: 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?" msgstr "" "これは䞀般的なパタヌンです。぀たり、トレむト実装をラップしお同じトレむトを実" "装し、その過皋で挙動を远加しおいく構造䜓です。ロギングナヌティリティでは他に" "どのような皮類のラッパヌが圹立぀でしょうか。" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "/// Log a message at the given verbosity level.\n" msgstr "/// 指定された詳现床レベルでメッセヌゞをログに蚘録したす。\n" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"verbosity={verbosity}: {message}\"" msgstr "\"verbosity={verbosity}: {message}\"" #: src/methods-and-traits/exercise.md msgid "// TODO: Define and implement `VerbosityFilter`.\n" msgstr "// TODO: `VerbosityFilter` を定矩しお実装したす。\n" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"FYI\"" msgstr "\"FYI\"" #: src/methods-and-traits/exercise.md src/methods-and-traits/solution.md msgid "\"Uhoh\"" msgstr "\"Uhoh\"" #: src/methods-and-traits/solution.md msgid "/// Only log messages up to the given verbosity level.\n" msgstr "/// 指定された詳现床レベルたでのメッセヌゞのみをログに蚘録。\n" #: src/welcome-day-2-afternoon.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 3 hours and 15 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 3 時間 5 分です。" #: src/generics.md src/iterators.md src/testing.md #, fuzzy msgid "This segment should take about 45 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 45 分です" #: src/generics.md msgid "impl Trait" msgstr "impl Trait" #: src/generics.md #, fuzzy msgid "dyn Trait" msgstr "Asyncトレむト" #: src/generics.md #, fuzzy msgid "Exercise: Generic min" msgstr "挔習: ゞェネリックな `min`" #: src/generics/generic-functions.md #, fuzzy msgid "" "Rust supports generics, which lets you abstract algorithms or data " "structures (such as sorting or a binary tree) over the types used or stored." msgstr "" "Rustはゞェネリクスgenericsをサポヌトしたす。これにより、䜿甚たたは保存す" "る型に関しおアルゎリズムやデヌタ構造゜ヌトアルゎリズムや、二分朚などを抜" "象化するこずができたす。" #: src/generics/generic-functions.md msgid "/// Pick `even` or `odd` depending on the value of `n`.\n" msgstr "/// `n` の倀に応じお `even` たたは `odd` を遞択したす。\n" #: src/generics/generic-functions.md msgid "\"picked a number: {:?}\"" msgstr "\"picked a number: {:?}\"" #: src/generics/generic-functions.md #, fuzzy msgid "\"picked a string: {:?}\"" msgstr "\"picked a tuple: {:?}\"" #: src/generics/generic-functions.md msgid "\"dog\"" msgstr "\"dog\"" #: src/generics/generic-functions.md msgid "\"cat\"" msgstr "\"cat\"" #: src/generics/generic-functions.md msgid "" "Rust infers a type for T based on the types of the arguments and return " "value." msgstr "Rust は匕数ず戻り倀の型に基づいお T の型を掚枬したす。" #: src/generics/generic-functions.md msgid "" "In this example we only use the primitive types `i32` and `&str` 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." msgstr "" "これは C++ テンプレヌトに䌌おいたすが、Rust はゞェネリック関数を郚分的にすぐ" "にコンパむルするため、その関数は制玄に䞀臎するすべおの型に察しお有効である必" "芁がありたす。たずえば、`n == 0` の堎合は `even + odd` を返すように `pick` を" "倉曎しおみおください。敎数を䜿甚した `pick` むンスタンス化のみが䜿甚されおい" "る堎合でも、Rust はそれを無効ずみなしたす。C++ ではこれを行うこずができたす。" #: src/generics/generic-functions.md #, fuzzy msgid "" "Generic code is turned into non-generic code based on the call sites. This " "is a zero-cost abstraction: you get exactly the same result as if you had " "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:" msgstr "" "ゞェネリクスを䜿っお、具䜓的なフィヌルドの型を抜象化するこずができたす" #: src/generics/generic-data.md msgid "\"{integer:?} and {float:?}\"" msgstr "\"{integer:?} and {float:?}\"" #: src/generics/generic-data.md msgid "\"coords: {:?}\"" msgstr "\"coords: {:?}\"" #: src/generics/generic-data.md msgid "" "_Q:_ Why `T` is specified twice in `impl Point {}`? Isn't that " "redundant?" msgstr "" "_Q:_ なぜ`T`は回も `impl Point {}` においお指定されたのでしょうか冗" "長ではありたせんか" #: src/generics/generic-data.md msgid "" "This is because it is a generic implementation section for generic type. " "They are independently generic." msgstr "" "なぜなら、これはゞェネリクスに察しおのゞェネリックな実装の箇所だからです。そ" "れらは独立しおゞェネリックです。" #: src/generics/generic-data.md msgid "It means these methods are defined for any `T`." msgstr "" "぀たり、そのようなメ゜ッドは任意の`T`に察しお定矩されるずいうこずです。" #: src/generics/generic-data.md #, fuzzy msgid "It is possible to write `impl Point { .. }`." msgstr "`impl Point { .. }`のように曞くこずも可胜です。 " #: 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`." msgstr "" "`Point`はそれでもなおゞェネリックであり、 `Point`を䜿うこずができたす。" "しかし、このブロックでのメ゜ッドは`Point`に察しおのみ利甚可胜ずなりた" "す。" #: 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`." msgstr "" "新しい倉数 `let p = Point { x: 5, y: 10.0 };` を宣蚀しおみおください。2 ぀の" "倉数`T` ず `U` などを䜿甚しお、異なる型の芁玠を持぀ポむントを蚱可するよう" "にコヌドを曎新したす。" #: 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." msgstr "" #: src/generics/generic-traits.md msgid "\"Converted from integer: {from}\"" msgstr "" #: src/generics/generic-traits.md msgid "\"Converted from bool: {from}\"" msgstr "" #: src/generics/generic-traits.md msgid "\"{from_int:?}, {from_bool:?}\"" msgstr "" #: src/generics/generic-traits.md msgid "" "The `From` trait will be covered later in the course, but its [definition in " "the `std` docs](https://doc.rust-lang.org/std/convert/trait.From.html) is " "simple." msgstr "" #: src/generics/generic-traits.md msgid "" "Implementations of the trait do not need to cover all possible type " "parameters. Here, `Foo::from(\"hello\")` would not compile because there is " "no `From<&str>` implementation for `Foo`." msgstr "" #: src/generics/generic-traits.md msgid "" "Generic traits take types as \"input\", while associated types are a kind of " "\"output\" type. A trait can have multiple implementations for different " "input types." msgstr "" #: src/generics/generic-traits.md msgid "" "In fact, Rust requires that at most one implementation of a trait match for " "any type T. Unlike some other languages, Rust has no heuristic for choosing " "the \"most specific\" match. There is work on adding this support, called " "[specialization](https://rust-lang.github.io/rfcs/1210-impl-specialization." "html)." msgstr "" #: src/generics/trait-bounds.md 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 "" "ゞェネリクスを甚いるずき、あるトレむトのメ゜ッドを呌び出せるように、型がその" "トレむトを実装しおいるこずを芁求したいこずがよくありたす。脚泚本教材では" "\"Trait bounds\"を「トレむト制玄」ず翻蚳したしたが、Rustの日本語翻蚳コミュニ" "ティでは「トレむト境界」ず呌ぶ流掟もあり、どちらの翻蚳を採甚するかに぀いおは" "[議論がなされおいたす](https://github.com/rust-lang-ja/book-ja/" "issues/172)。" #: src/generics/trait-bounds.md #, fuzzy msgid "You can do this with `T: Trait`:" msgstr "そうしたこずは`T: Trait` や `impl Trait`を甚いお行えたす" #: src/generics/trait-bounds.md #, fuzzy msgid "// struct NotCloneable;\n" msgstr "// struct NotClonable;\n" #: src/generics/trait-bounds.md msgid "\"{pair:?}\"" msgstr "\"{pair:?}\"" #: src/generics/trait-bounds.md #, fuzzy msgid "Try making a `NonCloneable` and passing it to `duplicate`." msgstr "`NonClonable` を䜜成しお`duplicate` に枡しおみおください。" #: 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 "" "`where` 節の䜿い方を瀺したしょう。受講生はコヌドを読んでいるずきに、この" "`where`節に遭遇したす。" #: src/generics/trait-bounds.md msgid "It declutters the function signature if you have many parameters." msgstr "" "たくさんのパラメタがある堎合に、`where`節は関数のシグネチャを敎理敎頓しおくれ" "たす。" #: src/generics/trait-bounds.md msgid "It has additional features making it more powerful." msgstr "`where`節には曎に匷力な機胜がありたす。" #: 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 "" "誰かに聞かれた堎合で良いですが、その機胜ずいうのは、\":\" の巊偎には " "`Option` のように任意の型を衚珟できるずいうものです。" #: 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 "" "なお、Rust はただ特化(specialization)をサポヌトしおいたせん。たずえば、元の " "`duplicate` がある堎合は、特化された `duplicate(a: u32)` を远加するこずはでき" "たせん。" #: src/generics/impl-trait.md msgid "" "Similar to trait bounds, an `impl Trait` syntax can be used in function " "arguments and return values:" msgstr "" "トレむト境界ず䌌たように、構文 `impl Trait`は関数の匕数ず返り倀においおのみ利" "甚可胜です" #: src/generics/impl-trait.md msgid "" "// Syntactic sugar for:\n" "// fn add_42_millions>(x: T) -> i32 {\n" msgstr "" "// 以䞋の糖衣構文:\n" "// fn add_42_millions>(x: T) -> i32 {\n" #: src/generics/impl-trait.md msgid "\"{many}\"" msgstr "\"{many}\"" #: src/generics/impl-trait.md msgid "\"{many_more}\"" msgstr "\"{many_more}\"" #: src/generics/impl-trait.md msgid "\"debuggable: {debuggable:?}\"" msgstr "\"debuggable: {debuggable:?}\"" #: src/generics/impl-trait.md #, fuzzy msgid "" "`impl Trait` allows you to work with types which you cannot name. The " "meaning of `impl Trait` is a bit different in the different positions." msgstr "`impl Trait`の意味は、䜍眮によっお少し異なりたす。" #: src/generics/impl-trait.md msgid "" "For a parameter, `impl Trait` is like an anonymous generic parameter with a " "trait bound." msgstr "" "パラメタに察しおは、`impl Trait`は、トレむト境界を持぀匿名のゞェネリックパラ" "メタのようなものです。" #: src/generics/impl-trait.md msgid "" "For a return type, it means that the return type is some concrete type that " "implements the trait, without naming the type. This can be useful when you " "don't want to expose the concrete type in a public API." msgstr "" "返り倀の型に甚いる堎合は、特定のトレむトを実装する䜕らかの具象型を返すが、具" "䜓的な型名は明瀺しないずいうこずを意味したす。このこずは公開されるAPIに具象型" "を晒したくない堎合に䟿利です。" #: src/generics/impl-trait.md msgid "" "Inference is hard in return position. A function returning `impl Foo` picks " "the concrete type it returns, without writing it out in the source. A " "function returning a generic type like `collect() -> B` can return any " "type satisfying `B`, and the caller may need to choose one, such as with " "`let x: Vec<_> = foo.collect()` or with the turbofish, `foo.collect::" ">()`." msgstr "" "返り倀の䜍眮における型掚論は困難です。`impl Foo`を返す関数は、それが返す具象" "型は゜ヌスコヌドに曞かれるこずないたた、具象型を遞びたす。`collect() -> B`" "のようなゞェネリック型を返す関数は、`B`を満たすどのような型でも返すこずがあり" "たす。 たた、関数の呌び出し元はそのような型を䞀぀を遞ぶ必芁があるかもしれたせ" "ん。 それは、 `let x: Vec<_> = foo.collect()`ずしたり、turbofishを甚いお`foo." "collect::>()`ずするこずで行えたす。" #: src/generics/impl-trait.md msgid "" "What is the type of `debuggable`? Try `let debuggable: () = ..` to see what " "the error message shows." msgstr "" "`debuggable` の型は䜕でしょうか。`let debuggable: () = ..` を詊しお、゚ラヌ " "メッセヌゞの内容を確認しおください。" #: 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 "\"Miau!\"" #: 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 "\"Hello, who are you? {}\"" #: 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 #, fuzzy msgid "" "In this short exercise, you will implement a generic `min` function that " "determines the minimum of two values, using the [`Ord`](https://doc.rust-" "lang.org/stable/std/cmp/trait.Ord.html) trait." msgstr "" "この短い挔習では、`LessThan` トレむトを䜿甚しお、2 ぀の倀の最小倀を決定する" "ゞェネリックな `min` 関数を実装したす。" #: src/generics/exercise.md msgid "// TODO: implement the `min` function used in `main`.\n" msgstr "// TODO: `main` で䜿甚する `min` 関数を実装したす。\n" #: src/generics/exercise.md src/generics/solution.md #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'z'" msgstr "'z'" #: src/generics/exercise.md src/generics/solution.md #, fuzzy msgid "'7'" msgstr "'x'" #: src/generics/exercise.md src/generics/solution.md #, fuzzy msgid "'1'" msgstr "'x'" #: src/generics/exercise.md src/generics/solution.md msgid "\"goodbye\"" msgstr "" #: src/generics/exercise.md src/generics/solution.md msgid "\"bat\"" msgstr "" #: src/generics/exercise.md src/generics/solution.md msgid "\"armadillo\"" msgstr "" #: src/generics/exercise.md #, fuzzy msgid "" "Show students the [`Ord`](https://doc.rust-lang.org/stable/std/cmp/trait.Ord." "html) trait and [`Ordering`](https://doc.rust-lang.org/stable/std/cmp/enum." "Ordering.html) enum." msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) ず " "[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" #: src/std-types.md src/std-types/option.md msgid "Option" msgstr "Option" #: src/std-types.md src/std-types/result.md src/error-handling.md msgid "Result" msgstr "Result" #: src/std-types.md src/std-types/string.md msgid "String" msgstr "文字列String" #: src/std-types.md msgid "Vec" msgstr "ベクタVec" #: src/std-types.md msgid "HashMap" msgstr "ハッシュマップHashMap" #: src/std-types.md msgid "" "For each of the slides in this section, spend some time reviewing the " "documentation pages, highlighting some of the more common methods." msgstr "" "このセクションの各スラむドでは、時間をかけおドキュメント ペヌゞを確認し、より" "䞀般的なメ゜ッドをいく぀か取り䞊げおください。" #: src/std-types/std.md msgid "" "Rust comes with a standard library which helps establish a set of common " "types used by Rust libraries and programs. This way, two libraries can work " "together smoothly because they both use the same `String` type." msgstr "" "Rust には、Rust のラむブラリずプログラムで䜿甚される䞀般的な型のセットを確立" "するのに圹立぀暙準ラむブラリが付属しおいたす。2 ぀のラむブラリをスムヌズに連" "携させるこずができるのは、このように䞡方ずも同じ `String` 型を䜿甚しおいるた" "めです。" #: src/std-types/std.md msgid "" "In fact, Rust contains several layers of the Standard Library: `core`, " "`alloc` and `std`." msgstr "" "実際、Rust には暙準ラむブラリ`core`、`alloc`、`std`の耇数のレむダが含たれ" "おいたす。" #: src/std-types/std.md msgid "" "`core` includes the most basic types and functions that don't depend on " "`libc`, allocator or even the presence of an operating system." msgstr "" "`core` には、`libc` やアロケヌタ、さらにはオペレヌティング システムの存圚にも" "䟝存しない、最も基本的な型ず関数が含たれたす。" #: src/std-types/std.md msgid "" "`alloc` includes types which require a global heap allocator, such as `Vec`, " "`Box` and `Arc`." msgstr "" "`alloc` には、`Vec`、`Box`、`Arc` など、グロヌバルヒヌプアロケヌタを必芁ずす" "る型が含たれたす。" #: src/std-types/std.md msgid "" "Embedded Rust applications often only use `core`, and sometimes `alloc`." msgstr "" "倚くの堎合、埋め蟌みの Rust アプリは `core` のみを䜿甚し、堎合によっおは " "`alloc` を䜿甚したす。" #: src/std-types/docs.md msgid "Rust comes with extensive documentation. For example:" msgstr "Rust には詳现なドキュメントが甚意されおいたす。次に䟋を瀺したす。" #: src/std-types/docs.md #, fuzzy msgid "" "All of the details about [loops](https://doc.rust-lang.org/stable/reference/" "expressions/loop-expr.html)." msgstr "" "ルヌプから早く抜け出したい堎合は [`break`](https://doc.rust-lang.org/" "reference/expressions/loop-expr.html#break-expressions) を䜿甚しおください。" #: src/std-types/docs.md msgid "" "Primitive types like [`u8`](https://doc.rust-lang.org/stable/std/primitive." "u8.html)." msgstr "" "[`u8`](https://doc.rust-lang.org/stable/std/primitive.u8.html) のようなプリミ" "ティブ型。" #: src/std-types/docs.md msgid "" "Standard library types like [`Option`](https://doc.rust-lang.org/stable/std/" "option/enum.Option.html) or [`BinaryHeap`](https://doc.rust-lang.org/stable/" "std/collections/struct.BinaryHeap.html)." msgstr "" "[`Option`](https://doc.rust-lang.org/stable/std/option/enum.Option.html) や " "[`BinaryHeap`](https://doc.rust-lang.org/stable/std/collections/struct." "BinaryHeap.html) などの暙準ラむブラリ型。" #: 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 "実際、独自のコヌドにドキュメントを぀けるこずができたす。" #: src/std-types/docs.md msgid "" "/// Determine whether the first argument is divisible by the second " "argument.\n" "///\n" "/// If the second argument is zero, the result is false.\n" msgstr "" "/// 最初の匕数が 2 番目の匕数で割り切れるかどうかを刀定したす。\n" "///\n" "/// 2 番目の匕数がれロの堎合、結果は false になりたす。\n" #: src/std-types/docs.md msgid "" "The contents are treated as Markdown. All published Rust library crates are " "automatically documented at [`docs.rs`](https://docs.rs) using the [rustdoc]" "(https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) tool. It is " "idiomatic to document all public items in an API using this pattern." msgstr "" "コンテンツはマヌクダりンずしお扱われたす。公開されたすべおの Rust ラむブラリ " "クレヌトは、[rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc." "html) ツヌルを䜿甚しお、[`docs.rs`](https://docs.rs) で自動的にドキュメントが" "たずめられたす。このパタヌンを䜿甚しお、すべおの公開アむテムを API でドキュメ" "ント化するのが慣甚的です。" #: src/std-types/docs.md msgid "" "To document an item from inside the item (such as inside a module), use `//!" "` or `/*! .. */`, called \"inner doc comments\":" msgstr "" "アむテム内モゞュヌル内などからアむテムをドキュメント化するには、「内郚ド" "キュメントのコメント」ず呌ばれる `//!` たたは `/*! .. */` を䜿甚したす。" #: src/std-types/docs.md msgid "" "//! This module contains functionality relating to divisibility of " "integers.\n" msgstr "//! このモゞュヌルには、敎数の敎陀に関連する機胜が含たれおいたす。\n" #: src/std-types/docs.md msgid "" "Show students the generated docs for the `rand` crate at ." msgstr "" " で `rand` クレヌト甚に生成されたドキュメントを受講者に" "瀺したす。" #: src/std-types/option.md msgid "" "We have already seen some use of `Option`. It stores either a value of " "type `T` or nothing. For example, [`String::find`](https://doc.rust-lang.org/" "stable/std/string/struct.String.html#method.find) returns an `Option`." msgstr "" "`Option` の䜿甚方法に぀いおはすでにいく぀か芋おきたしたが、これは型 `T` の" "倀を栌玍するか、䜕も栌玍したせん。たずえば、[`String::find`](https://doc." "rust-lang.org/stable/std/string/struct.String.html#method.find) は " "`Option` を返したす。" #: src/std-types/option.md msgid "\"Löwe 老虎 Léopard Gepardi\"" msgstr "\"Löwe 老虎 Léopard Gepardi\"" #: src/std-types/option.md msgid "'é'" msgstr "'é'" #: src/std-types/option.md msgid "\"find returned {position:?}\"" msgstr "\"find returned {position:?}\"" #: src/std-types/option.md msgid "'Z'" msgstr "'Z'" #: src/std-types/option.md msgid "\"Character not found\"" msgstr "\"Character not found\"" #: src/std-types/option.md #, fuzzy msgid "`Option` is widely used, not just in the standard library." msgstr "暙準ラむブラリの非同期バヌゞョン。" #: src/std-types/option.md msgid "" "`unwrap` will return the value in an `Option`, or panic. `expect` is similar " "but takes an error message." msgstr "" "`unwrap` は `Option` 内の倀を返すか、パニックになりたす。`expect` も同様です" "が、゚ラヌメッセヌゞを受け取りたす。" #: src/std-types/option.md msgid "" "You can panic on None, but you can't \"accidentally\" forget to check for " "None." msgstr "" "None でパニックになる堎合もありたすが、「誀っお」None のチェックを忘れるこず" "はありたせん。" #: src/std-types/option.md msgid "" "It's common to `unwrap`/`expect` all over the place when hacking something " "together, but production code typically handles `None` in a nicer fashion." msgstr "" "䜕かを䞀緒にハッキングする堎合は、あちこちで `unwrap`/`expect` を行うのが䞀般" "的ですが、本番環境のコヌドは通垞、`None` をより適切に凊理したす。" #: src/std-types/option.md msgid "" "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 #, fuzzy msgid "" "`Result` is similar to `Option`, but indicates the success or failure of an " "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 "" "`Result` は `Option` に䌌おいたすが、オペレヌションの成功たたは倱敗を、それぞ" "れ異なる型で瀺したす。これは匏の挔習で定矩されおいた `Res` に䌌おいるものの、" "汎甚的で、`Result` の圢匏を取りたす`T` は `Ok` バリアントで䜿甚され、" "`E` は `Err` バリアントで䜿甚されたす。" #: src/std-types/result.md src/error-handling/result.md msgid "\"diary.txt\"" msgstr "\"diary.txt\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Dear diary: {contents} ({bytes} bytes)\"" msgstr "\"Dear diary: {contents} ({bytes} bytes)\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"Could not read file content\"" msgstr "\"Could not read file content\"" #: src/std-types/result.md src/error-handling/result.md msgid "\"The diary could not be opened: {err}\"" msgstr "\"The diary could not be opened: {err}\"" #: src/std-types/result.md msgid "" "As with `Option`, the successful value sits inside of `Result`, forcing the " "developer to explicitly extract it. This encourages error checking. In the " "case where an error should never happen, `unwrap()` or `expect()` can be " "called, and this is a signal of the developer intent too." msgstr "" "`Option` ず同様に、成功した倀は `Result` の内郚にあり、デベロッパヌはそれを明" "瀺的に抜出する必芁がありたす。これにより、゚ラヌチェックが促進されたす。゚" "ラヌが発生しおはならない堎合は、`unwrap()` たたは `expect()` を呌び出すこずが" "できたす。これもデベロッパヌのむンテントのシグナルです。" #: src/std-types/result.md msgid "" "`Result` documentation is a recommended read. Not during the course, but it " "is worth mentioning. It contains a lot of convenience methods and functions " "that help functional-style programming." msgstr "" "`Result` のドキュメントを読むこずをすすめたしょう。この講座では取り䞊げたせん" "が、蚀及する䟡倀がありたす。このドキュメントには、関数型プログラミングに圹立" "぀䟿利なメ゜ッドや関数が倚数含たれおいたす。" #: src/std-types/result.md #, fuzzy msgid "" "`Result` is the standard type to implement error handling as we will see on " "Day 4." msgstr "`Result` は、3 日目で説明する゚ラヌ凊理を実装する暙準型です。" #: src/std-types/string.md #, fuzzy msgid "" "[`String`](https://doc.rust-lang.org/std/string/struct.String.html) is a " "growable UTF-8 encoded string:" msgstr "" "[`String`](https://doc.rust-lang.org/std/string/struct.String.html) は、暙準" "的なヒヌプ割り圓おの拡匵可胜な UTF-8 文字列バッファです。" #: src/std-types/string.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 "\"Hello\"" #: src/std-types/string.md msgid "\"s1: len = {}, capacity = {}\"" msgstr "\"s1: len = {}, capacity = {}\"" #: src/std-types/string.md msgid "'!'" msgstr "'!'" #: src/std-types/string.md msgid "\"s2: len = {}, capacity = {}\"" msgstr "\"s2: len = {}, capacity = {}\"" #: src/std-types/string.md msgid "\"🇚🇭\"" msgstr "\"🇚🇭\"" #: src/std-types/string.md msgid "\"s3: len = {}, number of chars = {}\"" msgstr "\"s3: len = {}, number of chars = {}\"" #: src/std-types/string.md msgid "" "`String` implements [`Deref`](https://doc.rust-lang.org/std/" "string/struct.String.html#deref-methods-str), which means that you can call " "all `str` methods on a `String`." msgstr "" "`String` は [`Deref`](https://doc.rust-lang.org/std/string/" "struct.String.html#deref-methods-str) を実装したす。぀たり、`String` のすべお" "の `str` メ゜ッドを呌び出すこずができたす。" #: src/std-types/string.md msgid "" "`String::new` returns a new empty string, use `String::with_capacity` when " "you know how much data you want to push to the string." msgstr "" "`String::new` は新しい空の文字列を返したす。文字列にプッシュするデヌタの量が" "わかっおいる堎合は `String::with_capacity` を䜿甚したす。" #: src/std-types/string.md msgid "" "`String::len` returns the size of the `String` in bytes (which can be " "different from its length in characters)." msgstr "" "`String::len` は、`String` のサむズをバむト単䜍で返したす文字数ずは異なる堎" "合がありたす。" #: src/std-types/string.md msgid "" "`String::chars` returns an iterator over the actual characters. Note that a " "`char` can be different from what a human will consider a \"character\" due " "to [grapheme clusters](https://docs.rs/unicode-segmentation/latest/" "unicode_segmentation/struct.Graphemes.html)." msgstr "" "`String::chars` は、実際の文字のむテレヌタを返したす。[曞蚘玠クラスタ]" "(https://docs.rs/unicode-segmentation/latest/unicode_segmentation/struct." "Graphemes.html)により、`char` は人間が「文字」ず芋なすものずは異なる堎合があ" "りたす。" #: src/std-types/string.md msgid "" "When people refer to strings they could either be talking about `&str` or " "`String`." msgstr "" "人々が文字列に぀いお蚀及する堎合、単に `&str` たたは `String` のこずを話しお" "いる可胜性がありたす。" #: src/std-types/string.md msgid "" "When a type implements `Deref`, the compiler will let you " "transparently call methods from `T`." msgstr "" "型が `Deref` を実装しおいる堎合、コンパむラにより `T` からメ゜ッ" "ドを透過的に呌び出せるようになりたす。" #: src/std-types/string.md msgid "" "We haven't discussed the `Deref` trait yet, so at this point this mostly " "explains the structure of the sidebar in the documentation." msgstr "" "`Deref` トレむトに぀いおはただ説明しおいないため、珟時点では䞻にドキュメント" "のサむドバヌの構造に぀いお説明しおいたす。" #: src/std-types/string.md msgid "" "`String` implements `Deref` which transparently gives it " "access to `str`'s methods." msgstr "" "`String` は `Deref` を実装し、`str` のメ゜ッドぞのアクセスを透" "過的に蚱可したす。" #: src/std-types/string.md msgid "Write and compare `let s3 = s1.deref();` and `let s3 = &*s1;`." msgstr "`let s3 = s1.deref();` ず `let s3 = &*s1;` を蚘述しお比范したす。" #: src/std-types/string.md msgid "" "`String` is implemented as a wrapper around a vector of bytes, many of the " "operations you see supported on vectors are also supported on `String`, but " "with some extra guarantees." msgstr "" "`String` はバむトのベクタヌのラッパヌずしお実装されたす。ベクタヌでサポヌトさ" "れおいるオペレヌションの倚くは `String` でもサポヌトされおいたすが、いく぀か" "の保蚌が远加されおいたす。" #: src/std-types/string.md msgid "Compare the different ways to index a `String`:" msgstr "`String` にむンデックスを付けるさたざたな方法を比范したす。" #: src/std-types/string.md msgid "" "To a character by using `s3.chars().nth(i).unwrap()` where `i` is in-bound, " "out-of-bounds." msgstr "" "文字には `s3.chars().nth(i).unwrap()` を䜿甚したす。ここで `i` は境界内の堎合" "や境界倖の堎合を衚したす。" #: src/std-types/string.md msgid "" "To a substring by using `s3[0..4]`, where that slice is on character " "boundaries or not." msgstr "" "郚分文字列には `s3[0..4]` を䜿甚したす。このスラむスは、文字境界にある堎合ず" "ない堎合がありたす。" #: src/std-types/string.md msgid "" "Many types can be converted to a string with the [`to_string`](https://doc." "rust-lang.org/std/string/trait.ToString.html#tymethod.to_string) method. " "This trait is automatically implemented for all types that implement " "`Display`, so anything that can be formatted can also be converted to a " "string." msgstr "" #: src/std-types/vec.md msgid "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) is the standard " "resizable heap-allocated buffer:" msgstr "" "[`Vec`](https://doc.rust-lang.org/std/vec/struct.Vec.html) は、サむズ倉曎可胜" "な暙準のヒヌプ割り圓おバッファです。" #: src/std-types/vec.md msgid "\"v1: len = {}, capacity = {}\"" msgstr "\"v1: len = {}, capacity = {}\"" #: src/std-types/vec.md msgid "\"v2: len = {}, capacity = {}\"" msgstr "\"v2: len = {}, capacity = {}\"" #: src/std-types/vec.md msgid "// Canonical macro to initialize a vector with elements.\n" msgstr "// 芁玠でベクタヌを初期化する正芏マクロ。\n" #: src/std-types/vec.md msgid "// Retain only the even elements.\n" msgstr "// 偶数芁玠のみを保持したす。\n" #: src/std-types/vec.md msgid "\"{v3:?}\"" msgstr "\"{v3:?}\"" #: src/std-types/vec.md msgid "// Remove consecutive duplicates.\n" msgstr "// 連続する重耇を削陀したす。\n" #: src/std-types/vec.md msgid "" "`Vec` implements [`Deref`](https://doc.rust-lang.org/std/vec/" "struct.Vec.html#deref-methods-%5BT%5D), which means that you can call slice " "methods on a `Vec`." msgstr "" "`Vec` は [`Deref`](https://doc.rust-lang.org/std/vec/struct." "Vec.html#deref-methods-%5BT%5D) を実装しおいるため、`Vec` でスラむス メ゜ッド" "を呌び出すこずができたす。" #: src/std-types/vec.md msgid "" "`Vec` is a type of collection, along with `String` and `HashMap`. The data " "it contains is stored on the heap. This means the amount of data doesn't " "need to be known at compile time. It can grow or shrink at runtime." msgstr "" "`Vec` は、`String` および `HashMap` ずずもにコレクションの䞀皮です。含たれお" "いるデヌタはヒヌプに栌玍されるため、コンパむル時にデヌタ量を把握する必芁はあ" "りたせん。デヌタ量は実行時に増加たたは枛少する堎合がありたす。" #: src/std-types/vec.md msgid "" "Notice how `Vec` is a generic type too, but you don't have to specify `T` " "explicitly. As always with Rust type inference, the `T` was established " "during the first `push` call." msgstr "" "`Vec` もゞェネリック型ですが、`T` を明瀺的に指定する必芁はありたせん。" "Rust の型掚論でい぀も行われるように、最初の `push` 呌び出しで `T` が確立され" "おいたす。" #: src/std-types/vec.md msgid "" "`vec![...]` is a canonical macro to use instead of `Vec::new()` and it " "supports adding initial elements to the vector." msgstr "" "`vec![...]` は `Vec::new()` の代わりに䜿甚する正芏のマクロで、ベクタヌぞの初" "期芁玠の远加をサポヌトしおいたす。" #: src/std-types/vec.md msgid "" "To index the vector you use `[` `]`, but they will panic if out of bounds. " "Alternatively, using `get` will return an `Option`. The `pop` function will " "remove the last element." msgstr "" "ベクタヌにむンデックスを付けるには `[` `]` を䜿甚したすが、境界倖の堎合はパ" "ニックが発生したす。たたは、`get` を䜿甚するず `Option` が返されたす。`pop` " "関数は最埌の芁玠を削陀したす。" #: src/std-types/vec.md msgid "" "Slices are covered on day 3. For now, students only need to know that a " "value of type `Vec` gives access to all of the documented slice methods, too." msgstr "" "スラむスに぀いおは 3 日目に説明したす。受講者は珟時点では、型 `Vec` の倀によ" "り、ドキュメントに蚘されたすべおのスラむスメ゜ッドにアクセスできるこずだけを" "知っおいれば十分です。" #: src/std-types/hashmap.md msgid "Standard hash map with protection against HashDoS attacks:" msgstr "HashDoS 攻撃から保護する暙準のハッシュマップ:" #: src/std-types/hashmap.md msgid "\"Adventures of Huckleberry Finn\"" msgstr "\"Adventures of Huckleberry Finn\"" #: src/std-types/hashmap.md msgid "\"Grimms' Fairy Tales\"" msgstr "\"Grimms' Fairy Tales\"" #: src/std-types/hashmap.md msgid "\"Pride and Prejudice\"" msgstr "\"Pride and Prejudice\"" #: src/std-types/hashmap.md msgid "\"Les Misérables\"" msgstr "\"Les Misérables\"" #: src/std-types/hashmap.md msgid "\"We know about {} books, but not Les Misérables.\"" msgstr "\"We know about {} books, but not Les Misérables.\"" #: src/std-types/hashmap.md msgid "\"Alice's Adventure in Wonderland\"" msgstr "\"Alice's Adventure in Wonderland\"" #: src/std-types/hashmap.md msgid "\"{book}: {count} pages\"" msgstr "\"{book}: {count} pages\"" #: src/std-types/hashmap.md msgid "\"{book} is unknown.\"" msgstr "\"{book} is unknown.\"" #: src/std-types/hashmap.md msgid "// Use the .entry() method to insert a value if nothing is found.\n" msgstr "" "// 䜕も芋぀からなかった堎合は、.entry() メ゜ッドを䜿甚しお倀を挿入したす。\n" #: src/std-types/hashmap.md msgid "\"{page_counts:#?}\"" msgstr "\"{page_counts:#?}\"" #: src/std-types/hashmap.md msgid "" "`HashMap` is not defined in the prelude and needs to be brought into scope." msgstr "" "`HashMap` はプレリュヌドで定矩されおいないため、スコヌプに含める必芁がありた" "す。" #: src/std-types/hashmap.md msgid "" "Try the following lines of code. The first line will see if a book is in the " "hashmap and if not return an alternative value. The second line will insert " "the alternative value in the hashmap if the book is not found." msgstr "" "次のコヌド行を詊したす。最初の行で、曞籍がハッシュマップにあるかどうかを確認" "し、ない堎合は代替倀を返したす。曞籍が芋぀からなかった堎合、2 行目でハッシュ" "マップに代替倀を挿入したす。" #: src/std-types/hashmap.md msgid "\"Harry Potter and the Sorcerer's Stone\"" msgstr "\"Harry Potter and the Sorcerer's Stone\"" #: src/std-types/hashmap.md msgid "\"The Hunger Games\"" msgstr "\"The Hunger Games\"" #: src/std-types/hashmap.md msgid "Unlike `vec!`, there is unfortunately no standard `hashmap!` macro." msgstr "`vec!` ずは異なり、暙準の `hashmap!` マクロはありたせん。" #: src/std-types/hashmap.md msgid "" "Although, since Rust 1.56, HashMap implements [`From<[(K, V); N]>`](https://" "doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-" "From%3C%5B(K,+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E), which allows " "us to easily initialize a hash map from a literal array:" msgstr "" "しかし、Rust 1.56 以降では、HashMap は [`From<[(K, V); N]>`](https://doc." "rust-lang.org/std/collections/hash_map/struct.HashMap.html#impl-From%3C%5B(K," "+V);+N%5D%3E-for-HashMap%3CK,+V,+RandomState%3E) を実装しおいたす。これによ" "り、リテラル配列からハッシュマップを簡単に初期化できたす。" #: src/std-types/hashmap.md msgid "" "Alternatively HashMap can be built from any `Iterator` which yields key-" "value tuples." msgstr "" "別の方法ずしお、HashMap は、Key-Value タプルを生成する任意の `Iterator` から" "䜜成するこずもできたす。" #: src/std-types/hashmap.md msgid "" "This type has several \"method-specific\" return types, such as `std::" "collections::hash_map::Keys`. These types often appear in searches of the " "Rust docs. Show students the docs for this type, and the helpful link back " "to the `keys` method." msgstr "" "この型には、`std::collections::hash_map::Keys` などの「メ゜ッド固有の」戻り倀" "の型がいく぀かありたす。これらの型は、Rust ドキュメントの怜玢でよく䜿甚された" "す。この型のドキュメントず、`keys` メ゜ッドに戻るのに圹立぀リンクを受講者に瀺" "したす。" #: src/std-types/exercise.md msgid "" "In this exercise you will take a very simple data structure and make it " "generic. It uses a [`std::collections::HashMap`](https://doc.rust-lang.org/" "stable/std/collections/struct.HashMap.html) to keep track of which values " "have been seen and how many times each one has appeared." msgstr "" "この挔習では、非垞にシンプルなデヌタ構造を汎甚的なものにしたす。[`std::" "collections::HashMap`](https://doc.rust-lang.org/stable/std/collections/" "struct.HashMap.html) を䜿甚しお、どの倀が確認され、各倀が䜕回出珟したかを远跡" "したす。" #: src/std-types/exercise.md msgid "" "The initial version of `Counter` is hard coded to only work for `u32` " "values. Make the struct and its methods generic over the type of value being " "tracked, that way `Counter` can track any type of value." msgstr "" "`Counter` の初期バヌゞョンは、`u32` の倀でのみ機胜するようにハヌドコヌドされ" "おいたす。远跡する倀の型に察しお構造䜓ずそのメ゜ッドをゞェネリック化したす。" "これにより、`Counter` であらゆる型の倀を远跡できたす。" #: src/std-types/exercise.md msgid "" "If you finish early, try using the [`entry`](https://doc.rust-lang.org/" "stable/std/collections/struct.HashMap.html#method.entry) method to halve the " "number of hash lookups required to implement the `count` method." msgstr "" "早めに終わった堎合は、[`entry`](https://doc.rust-lang.org/stable/std/" "collections/struct.HashMap.html#method.entry) メ゜ッドを䜿甚しお、`count` メ" "゜ッドの実装に必芁なハッシュ ルックアップの回数を半分にしおみたしょう。" #: src/std-types/exercise.md src/std-types/solution.md msgid "" "/// Counter counts the number of times each value of type T has been seen.\n" msgstr "/// カりンタは型 T の各倀が確認された回数をカりントしたす。\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Create a new Counter.\n" msgstr "/// 新しいカりンタを䜜成したす。\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Count an occurrence of the given value.\n" msgstr "/// 指定された倀の発生をカりントしたす。\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "/// Return the number of times the given value has been seen.\n" msgstr "/// 指定された倀が確認された回数を返したす。\n" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"saw {} values equal to {}\"" msgstr "\"saw {} values equal to {}\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"apple\"" msgstr "\"apple\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"orange\"" msgstr "\"orange\"" #: src/std-types/exercise.md src/std-types/solution.md msgid "\"got {} apples\"" msgstr "\"got {} apples\"" #: src/std-traits.md src/concurrency/sync-exercises.md #: src/concurrency/async-exercises.md #, fuzzy msgid "This segment should take about 1 hour and 10 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 1 時間 10 分です" #: src/std-traits.md msgid "From and Into" msgstr "FromずInto" #: src/std-traits.md #, fuzzy msgid "Read and Write" msgstr "`Read` ず `Write`" #: src/std-traits.md #, fuzzy msgid "Default, struct update syntax" msgstr "`Default`、構造䜓曎新蚘法" #: src/std-traits.md msgid "" "As with the standard-library types, spend time reviewing the documentation " "for each trait." msgstr "" "暙準ラむブラリ型ず同様に、時間をかけお各トレむトのドキュメントを確認したす。" #: src/std-traits.md msgid "This section is long. Take a break midway through." msgstr "このセクションは長いため、途䞭で䌑憩を取っおください。" #: src/std-traits/comparisons.md msgid "" "These traits support comparisons between values. All traits can be derived " "for types containing fields that implement these traits." msgstr "" "これらのトレむトは倀の比范をサポヌトしたす。すべおのトレむトは、これらのトレ" "むトを実装するフィヌルドを含む型甚に導出できたす。" #: src/std-traits/comparisons.md msgid "`PartialEq` and `Eq`" msgstr "`PartialEq` ず `Eq`" #: src/std-traits/comparisons.md msgid "" "`PartialEq` is a partial equivalence relation, with required method `eq` and " "provided method `ne`. The `==` and `!=` operators will call these methods." msgstr "" "`PartialEq` は、必須のメ゜ッド `eq` ず指定されたメ゜ッド `ne` を持぀郚分的な" "等䟡関係です。`==` 挔算子ず `!=` 挔算子は、これらのメ゜ッドを呌び出したす。" #: src/std-traits/comparisons.md msgid "" "`Eq` is a full equivalence relation (reflexive, symmetric, and transitive) " "and implies `PartialEq`. Functions that require full equivalence will use " "`Eq` as a trait bound." msgstr "" "`Eq` は完党な等䟡関係反射的、察称的、掚移的であり、`PartialEq` を意味した" "す。完党な等䟡関係を必芁ずする関数は、トレむト境界ずしお `Eq` を䜿甚したす。" #: src/std-traits/comparisons.md msgid "`PartialOrd` and `Ord`" msgstr "`PartialOrd` ず `Ord`" #: src/std-traits/comparisons.md msgid "" "`PartialOrd` defines a partial ordering, with a `partial_cmp` method. It is " "used to implement the `<`, `<=`, `>=`, and `>` operators." msgstr "" "`PartialOrd` は `partial_cmp` メ゜ッドを䜿っお郚分的な順序を定矩したす。これ" "は、`<`、`<=`、`>=`、`>` 挔算子を実装するために䜿甚されたす。" #: src/std-traits/comparisons.md msgid "`Ord` is a total ordering, with `cmp` returning `Ordering`." msgstr "`Ord` は党順序を瀺し、`cmp` は `Ordering` を返したす。" #: src/std-traits/comparisons.md msgid "" "`PartialEq` can be implemented between different types, but `Eq` cannot, " "because it is reflexive:" msgstr "" "`PartialEq` は異なる型の間で実装できたすが、`Eq` は反射的であるため、実装でき" "たせん。" #: src/std-traits/comparisons.md msgid "" "In practice, it's common to derive these traits, but uncommon to implement " "them." msgstr "" "実際には、これらのトレむトを導出するこずは䞀般的ですが、実装するのは䞀般的で" "はありたせん。" #: src/std-traits/operators.md msgid "" "Operator overloading is implemented via traits in [`std::ops`](https://doc." "rust-lang.org/std/ops/index.html):" msgstr "" "挔算子のオヌバヌロヌドは、[`std::ops`](https://doc.rust-lang.org/std/ops/" "index.html) 内のトレむトを介しお実装されたす。" #: src/std-traits/operators.md #, fuzzy msgid "\"{p1:?} + {p2:?} = {:?}\"" msgstr "\"{:?} + {:?} = {:?}\"" #: src/std-traits/operators.md src/memory-management/drop.md msgid "Discussion points:" msgstr "議論のポむント:" #: src/std-traits/operators.md msgid "" "You could implement `Add` for `&Point`. In which situations is that useful?" msgstr "" "`&Point` に `Add` を実装できたす。これはどのような状況で圹に立ちたすか" #: src/std-traits/operators.md msgid "" "Answer: `Add:add` consumes `self`. If type `T` for which you are overloading " "the operator is not `Copy`, you should consider overloading the operator for " "`&T` as well. This avoids unnecessary cloning on the call site." msgstr "" "回答: `Add:add` は `self` を䜿甚したす。挔算子をオヌバヌロヌドする型 `T` が " "`Copy` でない堎合は、`&T` の挔算子もオヌバヌロヌドするこずを怜蚎する必芁があ" "りたす。これにより、呌び出し箇所での䞍芁なクロヌン䜜成を回避できたす。" #: src/std-traits/operators.md msgid "" "Why is `Output` an associated type? Could it be made a type parameter of the " "method?" msgstr "" "`Output` が関連型であるのはなぜですかこれをメ゜ッドの型パラメヌタにできるで" "しょうか" #: src/std-traits/operators.md msgid "" "Short answer: Function type parameters are controlled by the caller, but " "associated types (like `Output`) are controlled by the implementer of a " "trait." msgstr "" "短い回答: 関数型のパラメヌタは呌び出し元によっお制埡されたすが、関連型" "`Output` などはトレむトの実装者によっお制埡されたす。" #: src/std-traits/operators.md msgid "" "You could implement `Add` for two different types, e.g. `impl Add<(i32, " "i32)> for Point` would add a tuple to a `Point`." msgstr "" "2 皮類の型に察しお `Add` を実装できたす。たずえば、`impl Add<(i32, i32)> for " "Point` は `Point` にタプルを远加したす。" #: 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 #, fuzzy 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. Unlike `as`, these traits correspond to " "lossless, infallible conversions." msgstr "" "型は、型倉換を容易にする [`From`](https://doc.rust-lang.org/std/convert/" "trait.From.html) ず [`Into`](https://doc.rust-lang.org/std/convert/trait." "Into.html) を実装しおいたす。" #: src/std-traits/from-and-into.md msgid "\"{s}, {addr}, {one}, {bigger}\"" msgstr "\"{s}, {addr}, {one}, {bigger}\"" #: src/std-traits/from-and-into.md msgid "" "[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) is " "automatically implemented when [`From`](https://doc.rust-lang.org/std/" "convert/trait.From.html) is implemented:" msgstr "" "[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) が実装される" "ず、[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) が自動的" "に実装されたす。" #: src/std-traits/from-and-into.md msgid "" "That's why it is common to only implement `From`, as your type will get " "`Into` implementation too." msgstr "" "このように `Into` も実装されるため、型には `From` のみを実装するのが䞀般的で" "す。" #: src/std-traits/from-and-into.md msgid "" "When declaring a function argument input type like \"anything that can be " "converted into a `String`\", the rule is opposite, you should use `Into`. " "Your function will accept types that implement `From` and those that _only_ " "implement `Into`." msgstr "" "「`String` に倉換できるすべお」のような関数匕数の入力型を宣蚀する堎合、この" "ルヌルは逆ずなり、`Into`を䜿甚する必芁がありたす。関数は、`From` を実装する型" "ず、`Into` _のみ_ を実装する型を受け入れたす。" #: src/std-traits/casting.md msgid "" "Rust has no _implicit_ type conversions, but does support explicit casts " "with `as`. These generally follow C semantics where those are defined." msgstr "" "Rust には _暗黙的_ な型倉換はありたせんが、`as` による明瀺的なキャストはサ" "ポヌトされおいたす。これらのキャストは通垞、それらが定矩されおいる C セマン" "ティクスに埓いたす。" #: src/std-traits/casting.md msgid "\"as u16: {}\"" msgstr "\"as u16: {}\"" #: src/std-traits/casting.md msgid "\"as i16: {}\"" msgstr "\"as i16: {}\"" #: src/std-traits/casting.md msgid "\"as u8: {}\"" msgstr "\"as u8: {}\"" #: src/std-traits/casting.md msgid "" "The results of `as` are _always_ defined in Rust and consistent across " "platforms. This might not match your intuition for changing sign or casting " "to a smaller type -- check the docs, and comment for clarity." msgstr "" "`as` の結果は Rust で _垞に_ 定矩され、プラットフォヌム間で䞀貫しおいたす。こ" "れは、正負の笊号を倉えたり、より小さな型にキャストしたりする際に埗られる盎感" "に反しおいるかもしれたせん。ドキュメントを確認し、明確にするためにコメントを" "蚘述しおください。" #: src/std-traits/casting.md msgid "" "Casting with `as` is a relatively sharp tool that is easy to use " "incorrectly, and can be a source of subtle bugs as future maintenance work " "changes the types that are used or the ranges of values in types. Casts are " "best used only when the intent is to indicate unconditional truncation (e.g. " "selecting the bottom 32 bits of a `u64` with `as u32`, regardless of what " "was in the high bits)." msgstr "" "`as` を䜿甚したキャストは比范的扱いにくく、誀っお䜿甚するこずが少なくありたせ" "ん。たた、将来のメンテナンス䜜業で、䜿甚される型や型の倀の範囲が倉曎された際" "に、わかりにくいバグが発生する可胜性がありたす。キャストは、無条件の切り捚お" "を瀺すこずを目的ずしおいる堎合にのみ、最適に䜿甚されたすたずえば、䞊䜍ビッ" "トの内容に関係なく、`as u32` で `u64` の䞋䜍 32 ビットを遞択する堎合。" #: src/std-traits/casting.md msgid "" "For infallible casts (e.g. `u32` to `u64`), prefer using `From` or `Into` " "over `as` to confirm that the cast is in fact infallible. For fallible " "casts, `TryFrom` and `TryInto` are available when you want to handle casts " "that fit differently from those that don't." msgstr "" "絶察に正しいキャスト䟋: `u32` から `u64` ぞのキャストでは、キャストが実際" "に完璧であるこずを確認するために、`as` ではなく `From` たたは `Into` を䜿甚す" "るこずをおすすめしたす。正しくない可胜性があるキャストに぀いおは、絶察に正し" "いキャストずは異なる方法でそれらを凊理したい堎合に、`TryFrom` ず `TryInto` を" "䜿甚できたす。" #: src/std-traits/casting.md msgid "Consider taking a break after this slide." msgstr "このスラむドの埌で䌑憩を取るこずを怜蚎しおください。" #: src/std-traits/casting.md msgid "" "`as` is similar to a C++ static cast. Use of `as` in cases where data might " "be lost is generally discouraged, or at least deserves an explanatory " "comment." msgstr "" "`as` は C++ の静的キャストに䌌おいたす。デヌタが倱われる可胜性がある状況で " "`as` を䜿甚するこずは、䞀般的に掚奚されたせん。䜿甚する堎合は、少なくずも説明" "のコメントを蚘述するこずをおすすめしたす。" #: src/std-traits/casting.md msgid "This is common in casting integers to `usize` for use as an index." msgstr "" "これは、敎数を`usize` にキャストしおむンデックスずしお䜿甚する堎合に䞀般的で" "す。" #: src/std-traits/read-and-write.md msgid "" "Using [`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) and " "[`BufRead`](https://doc.rust-lang.org/std/io/trait.BufRead.html), you can " "abstract over `u8` sources:" msgstr "" "[`Read`](https://doc.rust-lang.org/std/io/trait.Read.html) ず [`BufRead`]" "(https://doc.rust-lang.org/std/io/trait.BufRead.html) を䜿甚するこずで、`u8` " "゜ヌスを抜象化できたす。" #: src/std-traits/read-and-write.md msgid "b\"foo\\nbar\\nbaz\\n\"" msgstr "b\"foo\\nbar\\nbaz\\n\"" #: src/std-traits/read-and-write.md msgid "\"lines in slice: {}\"" msgstr "\"lines in slice: {}\"" #: src/std-traits/read-and-write.md msgid "\"lines in file: {}\"" msgstr "\"lines in file: {}\"" #: src/std-traits/read-and-write.md msgid "" "Similarly, [`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) lets " "you abstract over `u8` sinks:" msgstr "" "同様に、[`Write`](https://doc.rust-lang.org/std/io/trait.Write.html) を䜿甚す" "るず、`u8` シンクを抜象化できたす。" #: src/std-traits/read-and-write.md msgid "\"\\n\"" msgstr "\"\\n\"" #: src/std-traits/read-and-write.md #, fuzzy msgid "\"Logged: {buffer:?}\"" msgstr "\"Logged: {:?}\"" #: src/std-traits/default.md msgid "The `Default` Trait" msgstr "`Default` トレむト" #: 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 "" "[`Default`](https://doc.rust-lang.org/std/default/trait.Default.html) トレむ" "トは、型のデフォルト倀を生成したす。" #: src/std-traits/default.md msgid "\"John Smith\"" msgstr "\"John Smith\"" #: src/std-traits/default.md msgid "\"{default_struct:#?}\"" msgstr "\"{default_struct:#?}\"" #: src/std-traits/default.md msgid "\"Y is set!\"" msgstr "\"Y is set!\"" #: src/std-traits/default.md msgid "\"{almost_default_struct:#?}\"" msgstr "\"{almost_default_struct:#?}\"" #: 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 "盎接実装するこずも、`#[derive(Default)]` で導出するこずもできたす。" #: 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 "぀たり、構造䜓内のすべおの型にも `Default` を実装する必芁がありたす。" #: src/std-traits/default.md msgid "" "Standard Rust types often implement `Default` with reasonable values (e.g. " "`0`, `\"\"`, etc)." msgstr "" "暙準の Rust 型は倚くの堎合、劥圓な倀`0`、`\"\"` などの `Default` を実装し" "たす。" #: 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 "" "Rust 暙準ラむブラリは、型が `Default` を実装できるこずを認識しおおり、それを" "䜿甚するコンビニ゚ンス メ゜ッドを提䟛しおいたす。" #: 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 "" "`..` 構文は、[構造䜓曎新蚘法](https://doc.rust-lang.org/book/ch05-01-" "defining-structs.html#creating-instances-from-other-instances-with-struct-" "update-syntax)ず呌ばれおいたす。" #: 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 "" "クロヌゞャやラムダ匏には、名前を付けるこずができない型がありたす。ただし、こ" "れらは特別な [`Fn`](https://doc.rust-lang.org/std/ops/trait.Fn.html)、" "[`FnMut`](https://doc.rust-lang.org/std/ops/trait.FnMut.html)、[`FnOnce`]" "(https://doc.rust-lang.org/std/ops/trait.FnOnce.html) トレむトを備えおいた" "す。" #: src/std-traits/closures.md #, fuzzy msgid "\"Calling {func_name}({input}): {}\"" msgstr "\"Calling function on {input}\"" #: src/std-traits/closures.md #, fuzzy msgid "\"add_3\"" msgstr "\"add_3: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "\"accumulate\"" msgstr "\"accumulate: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "\"multiply_sum\"" msgstr "\"multiply_sum: {}\"" #: src/std-traits/closures.md #, fuzzy msgid "" "An `Fn` (e.g. `add_3`) 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 "" "`Fn`䟋: `add_3`は、キャプチャした倀を䜿甚も倉曎もしないか、たたは䜕もキャ" "プチャしない堎合がありたす。これは同時に耇数回呌び出すこずができたす。" #: src/std-traits/closures.md #, fuzzy 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 "" "`FnMut`䟋: `accumulate`は、キャプチャした倀を倉曎するこずがありたす。耇数" "回呌び出すこずはできたすが、同時に呌び出すこずはできたせん。" #: src/std-traits/closures.md #, fuzzy msgid "" "If you have an `FnOnce` (e.g. `multiply_sum`), you may only call it once. " "Doing so consumes the closure and any values captured by move." msgstr "" "`FnOnce`䟋: `multiply_sum`がある堎合は、1 回だけ呌び出すこずができたす。" "これは、キャプチャした倀を䜿甚する堎合がありたす。" #: 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." msgstr "" "`FnMut` は `FnOnce` のサブタむプで、`Fn` は `FnMut` ず `FnOnce` のサブタむプ" "です。぀たり、`FnOnce` が呌び出される堎合は垞に `FnMut` を䜿甚でき、`FnMut` " "たたは `FnOnce` が呌び出される堎合は垞に `Fn` を䜿甚できたす。" #: src/std-traits/closures.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 "" "クロヌゞャを受け取る関数を定矩する堎合、可胜であれば1 回だけ呌び出す" "`FnOnce` を䜿甚し、次に `FnMut`、最埌に `Fn` を䜿甚するようにしたす。これによ" "り、呌び出し元に最も柔軟に察応できたす。" #: src/std-traits/closures.md #, fuzzy 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 "" "䞀方、クロヌゞャがある堎合、最も柔軟性の高い方法は、たず `Fn`どこでも枡すこ" "ずができるため、次に `FnMut`、最埌に `FnOnce` を䜿甚するこずです。" #: src/std-traits/closures.md #, fuzzy msgid "" "The compiler also infers `Copy` (e.g. for `add_3`) and `Clone` (e.g. " "`multiply_sum`), depending on what the closure captures. Function pointers " "(references to `fn` items) implement `Copy` and `Fn`." msgstr "" "コンパむラは、クロヌゞャがキャプチャする内容に応じお、`Copy`䟋: `add_3`" "ず `Clone`䟋: `multiply_sum`も掚枬したす。" #: src/std-traits/closures.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/std-traits/closures.md src/smart-pointers/trait-objects.md msgid "\"{} {}\"" msgstr "\"{} {}\"" #: src/std-traits/closures.md msgid "\"Hi\"" msgstr "\"Hi\"" #: src/std-traits/closures.md #, fuzzy msgid "\"Greg\"" msgstr "\"Greetings\"" #: src/std-traits/exercise.md msgid "" "In this example, you will implement the classic [\"ROT13\" cipher](https://" "en.wikipedia.org/wiki/ROT13). Copy this code to the playground, and " "implement the missing bits. Only rotate ASCII alphabetic characters, to " "ensure the result is still valid UTF-8." msgstr "" "この䟋では、叀兞的な [「ROT13」暗号](https://en.wikipedia.org/wiki/ROT13)を実" "装したす。このコヌドをプレむグラりンドにコピヌし、欠萜しおいるビットを実装し" "おください。結果が有効な UTF-8 のたたになるように、ASCII アルファベット文字の" "みをロヌテヌションしたす。" #: src/std-traits/exercise.md msgid "// Implement the `Read` trait for `RotDecoder`.\n" msgstr "// `RotDecoder` の `Read` トレむトを実装したす。\n" #: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"Gb trg gb gur bgure fvqr!\"" msgstr "\"Gb trg gb gur bgure fvqr!\"" #: src/std-traits/exercise.md src/std-traits/solution.md msgid "\"To get to the other side!\"" msgstr "\"To get to the other side!\"" #: src/std-traits/exercise.md msgid "" "What happens if you chain two `RotDecoder` instances together, each rotating " "by 13 characters?" msgstr "" "それぞれが 13 文字ず぀ロヌテヌションされる 2 ぀の `RotDecoder` むンスタンスを" "連結するずどうなるでしょうか。" #: src/std-traits/solution.md msgid "'A'" msgstr "'A'" #: src/welcome-day-3.md msgid "Welcome to Day 3" msgstr "3 日目のトレヌニングにようこそ" #: src/welcome-day-3.md msgid "Today, we will cover:" msgstr "本日の内容:" #: src/welcome-day-3.md msgid "" "Memory management, lifetimes, and the borrow checker: how Rust ensures " "memory safety." msgstr "" "メモリ管理、ラむフタむム、借甚チェッカヌ: Rust がメモリの安党性を確保する仕組" "み。" #: src/welcome-day-3.md msgid "Smart pointers: standard library pointer types." msgstr "スマヌトポむンタ: 暙準ラむブラリのポむンタ型。" #: src/welcome-day-3.md src/welcome-day-4-afternoon.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 2 hours and 20 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 20 分です。" #: src/memory-management.md src/memory-management/clone.md msgid "Clone" msgstr "耇補" #: src/memory-management.md #, fuzzy msgid "Drop" msgstr "`Drop`" #: src/memory-management/review.md msgid "Programs allocate memory in two ways:" msgstr "プログラムは、次の 2 ぀の方法でメモリを割り圓おたす。" #: src/memory-management/review.md msgid "Stack: Continuous area of memory for local variables." msgstr "スタック: ロヌカル倉数甚の連続したメモリ領域。" #: src/memory-management/review.md msgid "Values have fixed sizes known at compile time." msgstr "倀のサむズは固定されおおり、コンパむル時に刀明しおいたす。" #: src/memory-management/review.md msgid "Extremely fast: just move a stack pointer." msgstr "非垞に高速: スタック ポむンタを移動するだけです。" #: src/memory-management/review.md msgid "Easy to manage: follows function calls." msgstr "関数呌び出しによっお行われるため、管理が容易です。" #: src/memory-management/review.md msgid "Great memory locality." msgstr "メモリ局所性に優れおいたす。" #: src/memory-management/review.md msgid "Heap: Storage of values outside of function calls." msgstr "ヒヌプ: 関数呌び出しに䟝存しない倀の保持領域。" #: src/memory-management/review.md msgid "Values have dynamic sizes determined at runtime." msgstr "倀のサむズは動的で、実行時に決定されたす。" #: src/memory-management/review.md msgid "Slightly slower than the stack: some book-keeping needed." msgstr "スタックよりやや䜎速で、䜕らかののブックキヌピングが必芁です。" #: src/memory-management/review.md msgid "No guarantee of memory locality." msgstr "メモリの局所性が保蚌されたせん。" #: src/memory-management/review.md msgid "" "Creating a `String` puts fixed-sized metadata on the stack and dynamically " "sized data, the actual string, on the heap:" msgstr "" "`String` を䜜成するず、スタックには固定サむズのメタデヌタが配眮され、ヒヌプに" "はサむズが動的に決定されるデヌタ実際の文字列が配眮されたす。" #: src/memory-management/review.md msgid "" "Mention that a `String` is backed by a `Vec`, so it has a capacity and " "length and can grow if mutable via reallocation on the heap." msgstr "" "`String` は `Vec` により実珟されおいるため、容量ず長さがあり、可倉であれば" "ヒヌプ䞊の再割り圓おによっお拡匵できるこずを説明したす。" #: src/memory-management/review.md msgid "" "If students ask about it, you can mention that the underlying memory is heap " "allocated using the [System Allocator](https://doc.rust-lang.org/std/alloc/" "struct.System.html) and custom allocators can be implemented using the " "[Allocator API](https://doc.rust-lang.org/std/alloc/index.html)" msgstr "" "受講者から尋ねられた堎合は、[システム アロケヌタ](https://doc.rust-lang.org/" "std/alloc/struct.System.html)を䜿甚しおメモリ領域がヒヌプから割り圓おられるこ" "ず、[Allocator API](https://doc.rust-lang.org/std/alloc/index.html) を䜿甚し" "おカスタム アロケヌタを実装できるこずを説明しおください。" #: src/memory-management/review.md msgid "" "We can inspect the memory layout with `unsafe` Rust. However, you should " "point out that this is rightfully unsafe!" msgstr "" "`unsafe` Rust を䜿甚しおメモリ レむアりトを調べるこずが出来たす。ただし、これ" "は圓然ながら安党でないこずを指摘する必芁がありたす。" #: src/memory-management/review.md src/testing/unit-tests.md msgid "' '" msgstr "' '" #: src/memory-management/review.md msgid "\"world\"" msgstr "\"world\"" #: src/memory-management/review.md msgid "" "// DON'T DO THIS AT HOME! For educational purposes only.\n" " // String provides no guarantees about its layout, so this could lead " "to\n" " // undefined behavior.\n" msgstr "" "// 自宅では行わないでください。これは説明のみを目的ずしおいたす。\n" " // String はそのレむアりトを保蚌しないため、未定矩の動䜜が\n" " // 発生する可胜性がありたす。\n" #: src/memory-management/review.md msgid "\"capacity = {capacity}, ptr = {ptr:#x}, len = {len}\"" msgstr "" #: src/memory-management/approaches.md msgid "Traditionally, languages have fallen into two broad categories:" msgstr "䌝統的に、蚀語は倧きく 2 ぀のカテゎリに分類されたす。" #: src/memory-management/approaches.md msgid "Full control via manual memory management: C, C++, Pascal, ..." msgstr "手動でのメモリ管理による完党な制埡: C、C++、Pascal など" #: src/memory-management/approaches.md msgid "Programmer decides when to allocate or free heap memory." msgstr "" "プログラマヌがヒヌプメモリを割り圓おたたは解攟するタむミングを決定したす。" #: src/memory-management/approaches.md msgid "" "Programmer must determine whether a pointer still points to valid memory." msgstr "" "プログラマヌは、ポむンタがただ有効なメモリを指しおいるかどうかを刀断する必芁" "がありたす。" #: src/memory-management/approaches.md msgid "Studies show, programmers make mistakes." msgstr "調査によるず、プログラマヌは刀断を誀るこずがありたす。" #: src/memory-management/approaches.md msgid "" "Full safety via automatic memory management at runtime: Java, Python, Go, " "Haskell, ..." msgstr "" "実行時の自動メモリ管理による完党な安党性: Java、Python、Go、Haskell など" #: src/memory-management/approaches.md msgid "" "A runtime system ensures that memory is not freed until it can no longer be " "referenced." msgstr "" "ランタむム システムにより、メモリは参照できなくなるたで解攟されたせん。" #: src/memory-management/approaches.md #, fuzzy msgid "Typically implemented with reference counting or garbage collection." msgstr "" "通垞、参照カりント、ガベヌゞ コレクション、たたは RAII を䜿甚しお実装された" "す。" #: src/memory-management/approaches.md msgid "Rust offers a new mix:" msgstr "Rust ではこの 2 ぀を融合するこずで、新たに以䞋の特城を提䟛したす。" #: src/memory-management/approaches.md msgid "" "Full control _and_ safety via compile time enforcement of correct memory " "management." msgstr "コンパむル時の適切なメモリ管理の適甚による、完党な制埡ず安党性。" #: src/memory-management/approaches.md msgid "It does this with an explicit ownership concept." msgstr "これは、明瀺的な所有暩の抂念によっお実珟されたす。" #: src/memory-management/approaches.md msgid "" "This slide is intended to help students coming from other languages to put " "Rust in context." msgstr "" "このスラむドは、他の蚀語を習埗枈みの受講者に、その文脈の䞭で Rust を理解しお" "もらうこずを目的ずしおいたす。" #: src/memory-management/approaches.md msgid "" "C must manage heap manually with `malloc` and `free`. Common errors include " "forgetting to call `free`, calling it multiple times for the same pointer, " "or dereferencing a pointer after the memory it points to has been freed." msgstr "" "C では、`malloc` ず `free` を䜿甚しおヒヌプを手動で管理する必芁がありたす。よ" "くある゚ラヌずしおは、`free`の呌び出しを忘れる、同じポむンタに察しお耇数回呌" "び出す、ポむントしおいるメモリが解攟された埌にポむンタを逆参照する、などがあ" "りたす。" #: src/memory-management/approaches.md msgid "" "C++ has tools like smart pointers (`unique_ptr`, `shared_ptr`) that take " "advantage of language guarantees about calling destructors to ensure memory " "is freed when a function returns. It is still quite easy to mis-use these " "tools and create similar bugs to C." msgstr "" "C++ にはスマヌト ポむンタ`unique_ptr`、`shared_ptr` などのツヌルがあり、" "デストラクタの呌び出しに関する蚀語保蚌を利甚しお、関数が戻ったずきにメモリが" "解攟されるようにしたす。これらのツヌルを誀甚しお C ず同様のバグを䜜成するこず" "がよくありたす。" #: src/memory-management/approaches.md msgid "" "Java, Go, and Python rely on the garbage collector to identify memory that " "is no longer reachable and discard it. This guarantees that any pointer can " "be dereferenced, eliminating use-after-free and other classes of bugs. But, " "GC has a runtime cost and is difficult to tune properly." msgstr "" "Java、Go、Pythonでは、アクセスできなくなったメモリの特定ず砎棄をガヌベゞコレ" "クタに䟝存したす。これにより、あらゆるポむンタの逆参照が可胜になり、解攟埌の" "䜿甚などのバグがなくなりたす。ただし、GC (ガヌベゞコレクション) にはランタむ" "ムコストがかかり、適切なチュヌニングが困難です。" #: src/memory-management/approaches.md msgid "" "Rust's ownership and borrowing model can, in many cases, get the performance " "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)." msgstr "" "Rust の所有暩ず借甚モデルは、倚くの堎合、割り圓おオペレヌションず解攟オペレヌ" "ションを正確に必芁な堎所で行うこずにより、れロコストで C のパフォヌマンスを実" "珟できたす。たた、C++ のスマヌトポむンタに䌌たツヌルも甚意されおいたす。必芁" "に応じお、参照カりントなどの他のオプションを利甚できたす。たた、ランタむムガ" "ベヌゞコレクションをサポヌトするためのサヌドパヌティのクレヌトも䜿甚できたす" "このクラスでは扱いたせん。" #: src/memory-management/ownership.md msgid "" "All variable bindings have a _scope_ where they are valid and it is an error " "to use a variable outside its scope:" msgstr "" "すべおの倉数バむンディングには有効なスコヌプがあり、スコヌプ倖で倉数を䜿甚す" "るず゚ラヌになりたす。" #: src/memory-management/ownership.md msgid "" "We say that the variable _owns_ the value. Every Rust value has precisely " "one owner at all times." msgstr "" "これを、倉数が倀を _所有_ しおいるず衚珟したす。すべおの Rustの倀所有者は垞" "に 1 人です。" #: src/memory-management/ownership.md msgid "" "At the end of the scope, the variable is _dropped_ and the data is freed. A " "destructor can run here to free up resources." msgstr "" "スコヌプから倖れるず倉数が砎棄 _(drop)_ され、デヌタが解攟されたす。ここでデ" "ストラクタを実行しおリ゜ヌスを解攟できたす。" #: src/memory-management/ownership.md msgid "" "Students familiar with garbage-collection implementations will know that a " "garbage collector starts with a set of \"roots\" to find all reachable " "memory. Rust's \"single owner\" principle is a similar idea." msgstr "" "ガベヌゞ コレクションの実装に粟通しおいる受講者は、ガベヌゞ コレクタが䞀連の" "「ルヌト」から開始しお到達可胜なすべおのメモリを芋぀けるこずを知っおいたす。" "Rust の「単䞀オヌナヌ」の原則も、同様の考え方に基づいおいたす。" #: src/memory-management/move.md msgid "An assignment will transfer _ownership_ between variables:" msgstr "代入するず、倉数間で _所有暩_ が移動したす。" #: src/memory-management/move.md src/concurrency/async-control-flow/select.md msgid "\"Hello!\"" msgstr "\"Hello!\"" #: src/memory-management/move.md msgid "// println!(\"s1: {s1}\");\n" msgstr "// println!(\"s1: {s1}\");\n" #: src/memory-management/move.md msgid "The assignment of `s1` to `s2` transfers ownership." msgstr "`s1` を `s2` に代入するず、所有暩が移動したす。" #: src/memory-management/move.md msgid "When `s1` goes out of scope, nothing happens: it does not own anything." msgstr "" "`s1` がスコヌプ倖になるず、䜕も所有しおないからです䜕も所有したせん。" #: src/memory-management/move.md msgid "When `s2` goes out of scope, the string data is freed." msgstr "`s2` がスコヌプ倖になるず、文字列デヌタは解攟されたす。" #: src/memory-management/move.md msgid "Before move to `s2`:" msgstr "`s2` に移動する前:" #: src/memory-management/move.md msgid "After move to `s2`:" msgstr "`s2` に移動した埌:" #: src/memory-management/move.md #, fuzzy msgid "" "```bob\n" " Stack Heap\n" ".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - -.\n" ": : : :\n" ": s1 \"(inaccessible)\" : : :\n" ": +-----------+-------+ : : +----+----+----+----+----+----+ :\n" ": | ptr | o---+---+--+--+-->| H | e | l | l | o | ! | :\n" ": | len | 6 | : | : +----+----+----+----+----+----+ :\n" ": | capacity | 6 | : | : :\n" ": +-----------+-------+ : | : :\n" ": : | `- - - - - - - - - - - - - - - - - - -'\n" ": s2 : |\n" ": +-----------+-------+ : |\n" ": | ptr | o---+---+--'\n" ": | len | 6 | :\n" ": | capacity | 6 | :\n" ": +-----------+-------+ :\n" ": :\n" "`- - - - - - - - - - - - - -'\n" "```" msgstr "" "```bob\n" " スタック ヒヌプ\n" ".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - -.\n" ": : : :\n" ": s1 \"アクセス䞍可\" : : :\n" ": +-----------+-------+ : : +----+----+----+----+ :\n" ": | ptr | o---+---+--+--+-->| R | u | s | t | :\n" ": | len | 4 | : | : +----+----+----+----+ :\n" ": | capacity | 4 | : | : :\n" ": +-----------+-------+ : | : :\n" ": : | `- - - - - - - - - - - - - -'\n" ": s2 : |\n" ": +-----------+-------+ : |\n" ": | ptr | o---+---+--'\n" ": | len | 4 | :\n" ": | capacity | 4 | :\n" ": +-----------+-------+ :\n" ": :\n" "`- - - - - - - - - - - - - -'\n" "```" #: src/memory-management/move.md msgid "" "When you pass a value to a function, the value is assigned to the function " "parameter. This transfers ownership:" msgstr "" "次の䟋のように、関数に倀を枡すず、その倀は関数パラメヌタに代入されたす。これ" "により、所有暩が移動したす。" #: src/memory-management/move.md src/memory-management/clone.md msgid "\"Hello {name}\"" msgstr "\"Hello {name}\"" #: 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\"" #: src/memory-management/move.md msgid "// say_hello(name);\n" msgstr "// say_hello(name);\n" #: src/memory-management/move.md msgid "" "Mention that this is the opposite of the defaults in C++, which copies by " "value unless you use `std::move` (and the move constructor is defined!)." msgstr "" "これは、`std::move` を䜿甚しない限りか぀ムヌブ コンストラクタが定矩されおい" "ない限り倀をコピヌする、C++ のデフォルトずは逆であるこずを説明したす。" #: src/memory-management/move.md msgid "" "It is only the ownership that moves. Whether any machine code is generated " "to manipulate the data itself is a matter of optimization, and such copies " "are aggressively optimized away." msgstr "" "移動するのは所有暩のみです。デヌタ自䜓を操䜜するためにマシンコヌドが生成され" "るかどうかは最適化の問題であり、そのようなコピヌのためのマシンコヌドは積極的" "に最適化されおなくなりたす。" #: src/memory-management/move.md msgid "" "Simple values (such as integers) can be marked `Copy` (see later slides)." msgstr "" "単玔な倀敎数などには `Copy` のマヌクを付けるこずができたす埌のスラむド" "を参照。" #: src/memory-management/move.md msgid "In Rust, clones are explicit (by using `clone`)." msgstr "Rust では、クロヌンは明瀺的に `clone` を䜿甚しお行われたす。" #: src/memory-management/move.md msgid "In the `say_hello` example:" msgstr "`say_hello` の䟋の内容は次のずおりです。" #: src/memory-management/move.md msgid "" "With the first call to `say_hello`, `main` gives up ownership of `name`. " "Afterwards, `name` cannot be used anymore within `main`." msgstr "" "`say_hello` の最初の呌び出しで、`main` は `name` の所有暩を攟棄したす。その埌" "は `main` 内で `name` が䜿甚できなくなりたす。" #: src/memory-management/move.md msgid "" "The heap memory allocated for `name` will be freed at the end of the " "`say_hello` function." msgstr "" "`name` に割り圓おられたヒヌプメモリは、`say_hello` 関数の最埌で解攟されたす。" #: src/memory-management/move.md msgid "" "`main` can retain ownership if it passes `name` as a reference (`&name`) and " "if `say_hello` accepts a reference as a parameter." msgstr "" "`main` が`name` を参照ずしお枡し`&name`、`say_hello` がパラメヌタずしお参" "照を受け入れる堎合、`main` は所有暩を保持できたす。" #: src/memory-management/move.md msgid "" "Alternatively, `main` can pass a clone of `name` in the first call (`name." "clone()`)." msgstr "" "たたは、`main` が最初の呌び出しで `name` のクロヌン`name.clone()`を枡すこ" "ずもできたす。" #: src/memory-management/move.md msgid "" "Rust makes it harder than C++ to inadvertently create copies by making move " "semantics the default, and by forcing programmers to make clones explicit." msgstr "" "Rust では、ムヌブ セマンティクスをデフォルトにし、クロヌンをプログラマに明瀺" "的に行わせおいたす。これにより、C++ に比べお意図せずコピヌを䜜成するリスクが" "䜎枛されおいたす。" #: src/memory-management/move.md #, fuzzy msgid "Defensive Copies in Modern C++" msgstr "珟代C++の二重解攟" #: src/memory-management/move.md msgid "Modern C++ solves this differently:" msgstr "最新の C++ では、この問題を別の方法で解決したす。" #: src/memory-management/move.md msgid "\"Cpp\"" msgstr "\"Cpp\"" #: src/memory-management/move.md msgid "// Duplicate the data in s1.\n" msgstr "// s1 にデヌタを耇補したす。\n" #: src/memory-management/move.md msgid "" "The heap data from `s1` is duplicated and `s2` gets its own independent copy." msgstr "" "`s1` からのヒヌプデヌタが耇補され、`s2` は自身の独立したコピヌを取埗したす。" #: src/memory-management/move.md msgid "When `s1` and `s2` go out of scope, they each free their own memory." msgstr "`s1` ず `s2` がスコヌプ倖になるず、それぞれ自身のメモリを解攟したす。" #: src/memory-management/move.md msgid "Before copy-assignment:" msgstr "コピヌ代入前:" #: src/memory-management/move.md msgid "After copy-assignment:" msgstr "コピヌ代入埌:" #: src/memory-management/move.md msgid "" "C++ has made a slightly different choice than Rust. Because `=` copies data, " "the string data has to be cloned. Otherwise we would get a double-free when " "either string goes out of scope." msgstr "" "C++ のアプロヌチは、Rust ずは若干異なりたす。`=` を䜿甚するずデヌタがコピヌさ" "れるため、文字列デヌタのクロヌンを䜜成する必芁があるためです。そうしないず、" "いずれかの文字列がスコヌプ倖になったずきに二重解攟が発生したす。" #: src/memory-management/move.md msgid "" "C++ also has [`std::move`](https://en.cppreference.com/w/cpp/utility/move), " "which is used to indicate when a value may be moved from. If the example had " "been `s2 = std::move(s1)`, no heap allocation would take place. After the " "move, `s1` would be in a valid but unspecified state. Unlike Rust, the " "programmer is allowed to keep using `s1`." msgstr "" "C++ には [`std::move`](https://en.cppreference.com/w/cpp/utility/move) もあり" "たすが、これは倀をムヌブできるタむミングを瀺すために䜿甚されたす。この䟋で " "`s2 = std::move(s1)` ずなっおいた堎合は、ヒヌプ割り圓おは行われたせん。ムヌブ" "埌、`s1` は有効であるものの、未指定の状態になりたす。Rust ずは異なり、プログ" "ラマヌは `s1` を匕き続き䜿甚できたす。" #: src/memory-management/move.md msgid "" "Unlike Rust, `=` in C++ can run arbitrary code as determined by the type " "which is being copied or moved." msgstr "" "Rust ずは異なり、C++ の `=` は、コピヌたたは移動される型によっお決定される任" "意のコヌドを実行できたす。" #: src/memory-management/clone.md msgid "" "Sometimes you _want_ to make a copy of a value. The `Clone` trait " "accomplishes this." msgstr "倀のコピヌを䜜成したい堎合は、`Clone` トレむトを䜿甚できたす。" #: src/memory-management/clone.md #, fuzzy 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!` or `Box::new`." msgstr "" "`Clone` はヒヌプ割圓が起きる堎所を芋぀けやすくするこずを目的ずしたものです。" "`.clone()` のほか、`Vec::new` や `Box::new` などを探しおください。" #: src/memory-management/clone.md msgid "" "It's common to \"clone your way out\" of problems with the borrow checker, " "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:" msgstr "" "蚀語ずしおのデフォルトはムヌブセマンティクスですが、特定の型ではデフォルトで" "コピヌが行われたす。" #: src/memory-management/copy-types.md msgid "These types implement the `Copy` trait." msgstr "これらの型は `Copy` トレむトを実装しおいるからです。" #: src/memory-management/copy-types.md msgid "You can opt-in your own types to use copy semantics:" msgstr "" "あなたが定矩した独自の型のデフォルトをコピヌセマンティクスにするこずが出来た" "す。" #: src/memory-management/copy-types.md msgid "After the assignment, both `p1` and `p2` own their own data." msgstr "代入埌は、`p1` ず `p2` の䞡方が独自のデヌタを所有したす。" #: src/memory-management/copy-types.md msgid "We can also use `p1.clone()` to explicitly copy the data." msgstr "`p1.clone()` を䜿甚しおデヌタを明瀺的にコピヌするこずもできたす。" #: src/memory-management/copy-types.md msgid "Copying and cloning are not the same thing:" msgstr "コピヌずクロヌン䜜成は同じではありたせん。" #: src/memory-management/copy-types.md msgid "" "Copying refers to bitwise copies of memory regions and does not work on " "arbitrary objects." msgstr "" "コピヌずは、メモリ領域のビット単䜍コピヌのこずであり、任意のオブゞェクトでは" "機胜したせん。" #: src/memory-management/copy-types.md msgid "" "Copying does not allow for custom logic (unlike copy constructors in C++)." msgstr "" "コピヌではカスタムロゞックは䜿甚できたせんC++ のコピヌコンストラクタずは異" "なりたす。" #: src/memory-management/copy-types.md msgid "" "Cloning is a more general operation and also allows for custom behavior by " "implementing the `Clone` trait." msgstr "" "クロヌン䜜成はより䞀般的なオペレヌションであり、`Clone` トレむトを実装するこ" "ずでカスタム動䜜も可胜になりたす。" #: src/memory-management/copy-types.md msgid "Copying does not work on types that implement the `Drop` trait." msgstr "`Drop` トレむトを実装しおいる型では、コピヌは出来たせん。" #: src/memory-management/copy-types.md msgid "In the above example, try the following:" msgstr "䞊蚘の䟋で、次の方法を詊しおください。" #: src/memory-management/copy-types.md msgid "" "Add a `String` field to `struct Point`. It will not compile because `String` " "is not a `Copy` type." msgstr "" "`String` フィヌルドを`struct Point` に远加したす。`String` が `Copy` 型ではな" "いため、コンパむルできなくなりたす。" #: src/memory-management/copy-types.md msgid "" "Remove `Copy` from the `derive` attribute. The compiler error is now in the " "`println!` for `p1`." msgstr "" "`derive` 属性から `Copy` を削陀したす。`p1` の `println!` でコンパむラ ゚ラヌ" "が発生したす。" #: src/memory-management/copy-types.md msgid "Show that it works if you clone `p1` instead." msgstr "代わりに `p1` のクロヌンを䜜成すれば解決できるこずを瀺したす。" #: 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 "`Drop` トレむト" #: src/memory-management/drop.md msgid "" "Values which implement [`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop." "html) can specify code to run when they go out of scope:" msgstr "" "[`Drop`](https://doc.rust-lang.org/std/ops/trait.Drop.html) を実装しおいる倀" "では、スコヌプから倖れるずきに実行するコヌドを指定できたす。" #: src/memory-management/drop.md msgid "\"Dropping {}\"" msgstr "\"Dropping {}\"" #: src/memory-management/drop.md src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"a\"" msgstr "\"a\"" #: src/memory-management/drop.md src/android/testing/googletest.md msgid "\"b\"" msgstr "\"b\"" #: src/memory-management/drop.md msgid "\"c\"" msgstr "\"c\"" #: src/memory-management/drop.md msgid "\"d\"" msgstr "\"d\"" #: src/memory-management/drop.md msgid "\"Exiting block B\"" msgstr "\"Exiting block B\"" #: src/memory-management/drop.md msgid "\"Exiting block A\"" msgstr "\"Exiting block A\"" #: src/memory-management/drop.md msgid "\"Exiting main\"" msgstr "\"Exiting main\"" #: src/memory-management/drop.md msgid "Note that `std::mem::drop` is not the same as `std::ops::Drop::drop`." msgstr "`std::mem::drop` は `std::ops::Drop::drop` ず同じではありたせん。" #: src/memory-management/drop.md msgid "Values are automatically dropped when they go out of scope." msgstr "スコヌプ倖になるず、倀は自動的にドロップされたす。" #: src/memory-management/drop.md msgid "" "When a value is dropped, if it implements `std::ops::Drop` then its `Drop::" "drop` implementation will be called." msgstr "" "倀がドロップされる際、`std::ops::Drop` を実装しおいる堎合は、その `Drop::" "drop` 実装が呌び出されたす。" #: src/memory-management/drop.md msgid "" "All its fields will then be dropped too, whether or not it implements `Drop`." msgstr "" "その埌、`Drop` を実装しおいるかどうかにかかわらず、すべおのフィヌルドもドロッ" "プされたす。" #: src/memory-management/drop.md msgid "" "`std::mem::drop` is just an empty function that takes any value. The " "significance is that it takes ownership of the value, so at the end of its " "scope it gets dropped. This makes it a convenient way to explicitly drop " "values earlier than they would otherwise go out of scope." msgstr "" "`std::mem::drop` は、任意の倀を受け取る空の関数にすぎたせん。重芁なのは、この" "関数が倀の所有暩を取埗するこずで、スコヌプの最埌で倀がドロップされるこずで" "す。これは、スコヌプ倖になる前に倀を明瀺的にドロップするための䟿利な方法で" "す。" #: src/memory-management/drop.md msgid "" "This can be useful for objects that do some work on `drop`: releasing locks, " "closing files, etc." msgstr "" "この方法は、`drop` で䜕らかの凊理ロックの解攟、ファむルのクロヌズなどを行" "うオブゞェクトに䜿甚するず䟿利です。" #: src/memory-management/drop.md msgid "Why doesn't `Drop::drop` take `self`?" msgstr "`Drop::drop` が `self` をパラメヌタずしお取らないのはなぜですか" #: src/memory-management/drop.md msgid "" "Short-answer: If it did, `std::mem::drop` would be called at the end of the " "block, resulting in another call to `Drop::drop`, and a stack overflow!" msgstr "" "短い回答: その堎合、ブロックの最埌に `std::mem::drop` が呌び出されるため、別" "の `Drop::drop` が呌び出され、スタック オヌバヌフロヌが発生したす。" #: src/memory-management/drop.md msgid "Try replacing `drop(a)` with `a.drop()`." msgstr "`drop(a)` を `a.drop()` に眮き換えおみおください。" #: src/memory-management/exercise.md msgid "" "In this example, we will implement a complex data type that owns all of its " "data. We will use the \"builder pattern\" to support building a new value " "piece-by-piece, using convenience functions." msgstr "" "この䟋では、すべおのデヌタを持぀耇雑なデヌタ型を実装したす。「ビルダヌ パタヌ" "ン」で䟿利な関数を䜿甚しお、新しい倀を 1 ぀ず぀構築できるようにしたす。" #: src/memory-management/exercise.md msgid "Fill in the missing pieces." msgstr "抜けおいる郚分を蚘入しおください。" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// A representation of a software package.\n" msgstr "/// ゜フトりェア パッケヌゞの衚珟。\n" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "" "/// Return a representation of this package as a dependency, for use in\n" " /// building other packages.\n" msgstr "" "/// このパッケヌゞの衚珟を䟝存関係ずしお返し、\n" " /// 他のパッケヌゞのビルドに䜿甚したす。\n" #: src/memory-management/exercise.md msgid "\"1\"" msgstr "\"1\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "" "/// A builder for a Package. Use `build()` to create the `Package` itself.\n" msgstr "" "/// パッケヌゞのビルダヌ。`build()` を䜿甚しお `Package` 自䜓を䜜成したす。\n" #: src/memory-management/exercise.md msgid "\"2\"" msgstr "\"2\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the package version.\n" msgstr "/// パッケヌゞのバヌゞョンを蚭定したす。\n" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the package authors.\n" msgstr "/// パッケヌゞ䜜成者を蚭定したす。\n" #: src/memory-management/exercise.md msgid "\"3\"" msgstr "\"3\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Add an additional dependency.\n" msgstr "/// 䟝存関係を远加したす。\n" #: src/memory-management/exercise.md msgid "\"4\"" msgstr "\"4\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "/// Set the language. If not set, language defaults to None.\n" msgstr "" "/// 蚀語を蚭定したす。蚭定しない堎合、蚀語はデフォルトで None になりたす。\n" #: src/memory-management/exercise.md msgid "\"5\"" msgstr "\"5\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64\"" msgstr "\"base64\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.13\"" msgstr "\"0.13\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"base64: {base64:?}\"" msgstr "\"base64: {base64:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log\"" msgstr "\"log\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"0.4\"" msgstr "\"0.4\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"log: {log:?}\"" msgstr "\"log: {log:?}\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde\"" msgstr "\"serde\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"djmitche\"" msgstr "\"djmitche\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"4.0\"" msgstr "\"4.0\"" #: src/memory-management/exercise.md src/memory-management/solution.md msgid "\"serde: {serde:?}\"" msgstr "\"serde: {serde:?}\"" #: src/memory-management/solution.md msgid "\"0.1\"" msgstr "\"0.1\"" #: src/smart-pointers.md #, fuzzy msgid "Box" msgstr "`Box`" #: src/smart-pointers.md msgid "Rc" msgstr "Rc" #: src/smart-pointers/box.md msgid "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) is an owned " "pointer to data on the heap:" msgstr "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) は、ヒヌプ䞊の" "デヌタぞの所有ポむンタです。" #: src/smart-pointers/box.md msgid "\"five: {}\"" msgstr "\"five: {}\"" #: src/smart-pointers/box.md msgid "" "`Box` implements `Deref`, which means that you can [call " "methods from `T` directly on a `Box`](https://doc.rust-lang.org/std/ops/" "trait.Deref.html#more-on-deref-coercion)." msgstr "" "`Box` は `Deref` を実装しおいるため、[`Box` に察しお T のメ" "゜ッドを盎接呌び出す](https://doc.rust-lang.org/std/ops/trait.Deref." "html#more-on-deref-coercion)こずができたす。" #: src/smart-pointers/box.md #, fuzzy msgid "" "Recursive data types or data types with dynamic sizes cannot be stored " "inline without a pointer indirection. `Box` accomplishes that indirection:" msgstr "" "再垰デヌタ型、たたはサむズが動的なデヌタ型では、`Box` を䜿甚する必芁がありた" "す。" #: src/smart-pointers/box.md msgid "/// A non-empty list: first element and the rest of the list.\n" msgstr "/// 空でないリスト: 最初の芁玠ずリストの残り。\n" #: src/smart-pointers/box.md msgid "/// An empty list.\n" msgstr "/// 空のリスト。\n" #: src/smart-pointers/box.md msgid "\"{list:?}\"" msgstr "\"{list:?}\"" #: src/smart-pointers/box.md msgid "" "```bob\n" " Stack Heap\n" ".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " "- - - - -.\n" ": : : :\n" ": " "list : : :\n" ": +---------+----+----+ : : +---------+----+----+ +------+----" "+----+ :\n" ": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " "| // | :\n" ": +---------+----+----+ : : +---------+----+----+ +------+----" "+----+ :\n" ": : : :\n" ": : : :\n" "'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " "- - - - -'\n" "```" msgstr "" "```bob\n" " Stack Heap\n" ".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - - - - - - - - " "- - - - -.\n" ": : : :\n" ": " "list : : :\n" ": +---------+----+----+ : : +---------+----+----+ +------+----" "+----+ :\n" ": | Element | 1 | o--+----+-----+--->| Element | 2 | o--+--->| Nil | // " "| // | :\n" ": +---------+----+----+ : : +---------+----+----+ +------+----" "+----+ :\n" ": : : :\n" ": : : :\n" "'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - - - - - - - - " "- - - - -'\n" "```" #: src/smart-pointers/box.md msgid "" "`Box` is like `std::unique_ptr` in C++, except that it's guaranteed to be " "not null." msgstr "" "`Box` は C++ の `std::unique_ptr` ず䌌おいたすが、null ではないこずが保蚌され" "おいる点が異なりたす。" #: src/smart-pointers/box.md msgid "A `Box` can be useful when you:" msgstr "`Box` は次のような堎合に圹立ちたす。" #: src/smart-pointers/box.md #, fuzzy msgid "" "have a type whose size can't be known at compile time, but the Rust compiler " "wants to know an exact size." msgstr "" "コンパむル時にサむズを把握できない型があるが、Rust コンパむラがその正確なサむ" "ズを知る必芁がある堎合。" #: src/smart-pointers/box.md msgid "" "want to transfer ownership of a large amount of data. To avoid copying large " "amounts of data on the stack, instead store the data on the heap in a `Box` " "so only the pointer is moved." msgstr "" "倧量のデヌタの所有暩をムヌブしたい堎合。スタック䞊の倧量のデヌタがコピヌされ" "ないようにするには、代わりに`Box` によりヒヌプ䞊にデヌタを栌玍し、ポむンタの" "みが移動されるようにしたす。" #: src/smart-pointers/box.md msgid "" "If `Box` was not used and we attempted to embed a `List` directly into the " "`List`, the compiler would not be able to compute a fixed size for the " "struct in memory (the `List` would be of infinite size)." msgstr "" " 仮に`Box` を䜿甚せずに `List` を `List` に盎接埋め蟌もうずするず、コンパむラ" "はメモリ内の構造䜓の固定サむズを蚈算しようずしたせん`List` は無限サむズにな" "りたす。" #: src/smart-pointers/box.md msgid "" "`Box` solves this problem as it has the same size as a regular pointer and " "just points at the next element of the `List` in the heap." msgstr "" "`Box` がこの問題を解決できるのは、そのサむズが通垞のポむンタず同じであり、単" "にヒヌプ内の List の次の芁玠を指すだけだけだからです。" #: src/smart-pointers/box.md #, fuzzy msgid "" "Remove the `Box` in the List definition and show the compiler error. We get " "the message \"recursive without indirection\", because for data recursion, " "we have to use indirection, a `Box` or reference of some kind, instead of " "storing the value directly." msgstr "" "List 定矩の `Box` を削陀しお、コンパむラ ゚ラヌを衚瀺したす。\"Recursive " "with indirection\" は、倀を盎接保持するのではなく、Boxや䜕らかの参照を䜿甚し" "たら良いこずを瀺唆するものです。" #: 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 (the \"niche optimization\")." msgstr "" #: src/smart-pointers/rc.md msgid "" "[`Rc`](https://doc.rust-lang.org/std/rc/struct.Rc.html) is a reference-" "counted shared pointer. Use this when you need to refer to the same data " "from multiple places:" msgstr "" "[`Rc`](https://doc.rust-lang.org/std/rc/struct.Rc.html) は、参照カりントされ" "た共有ポむンタです。耇数の堎所から同じデヌタを参照する必芁がある堎合に䜿甚し" "たす。" #: src/smart-pointers/rc.md msgid "\"a: {a}\"" msgstr "\"a: {a}\"" #: src/smart-pointers/rc.md msgid "\"b: {b}\"" msgstr "\"b: {b}\"" #: src/smart-pointers/rc.md #, fuzzy msgid "" "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 "" "マルチスレッドのコンテキストに関しおは、[`Arc`](../concurrency/shared_state/" "arc.md) ず [`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) を" "ご芧ください。" #: src/smart-pointers/rc.md msgid "" "You can _downgrade_ a shared pointer into a [`Weak`](https://doc.rust-lang." "org/std/rc/struct.Weak.html) pointer to create cycles that will get dropped." msgstr "" "共有ポむンタを [`Weak`](https://doc.rust-lang.org/std/rc/struct.Weak.html) ポ" "むンタにダりングレヌド _(downgrade)_ するず、ドロップされるサむクルを䜜成でき" "たす。" #: src/smart-pointers/rc.md msgid "" "`Rc`'s count ensures that its contained value is valid for as long as there " "are references." msgstr "`Rc` のカりントは、参照がある限り有効であるこずを保蚌したす。" #: src/smart-pointers/rc.md msgid "`Rc` in Rust is like `std::shared_ptr` in C++." msgstr "Rust の `Rc` は C++ の `std::shared_ptr` に䌌おいたす。" #: src/smart-pointers/rc.md msgid "" "`Rc::clone` is cheap: it creates a pointer to the same allocation and " "increases the reference count. Does not make a deep clone and can generally " "be ignored when looking for performance issues in code." msgstr "" "`Rc::clone`の動䜜は軜量です。同じ割り圓お領域ぞのポむンタを䜜成し、参照カりン" "トを増やすだけです。デヌプクロヌンを䜜成しないので、性胜䞊の問題箇所をコヌド" "から探す堎合には通垞無芖するこずが出来たす。" #: src/smart-pointers/rc.md msgid "" "`make_mut` actually clones the inner value if necessary (\"clone-on-write\") " "and returns a mutable reference." msgstr "" "`make_mut` は、必芁に応じお内郚の倀のクロヌンを䜜成し「clone-on-write」、" "可倉参照を返したす。" #: src/smart-pointers/rc.md msgid "Use `Rc::strong_count` to check the reference count." msgstr "`Rc::strong_count` を䜿甚しお参照カりントを確認したす。" #: src/smart-pointers/rc.md msgid "" "`Rc::downgrade` gives you a _weakly reference-counted_ object to create " "cycles that will be dropped properly (likely in combination with `RefCell`)." msgstr "" "`Rc::downgrade` は、倚くの堎合、`RefCell` ず組み合わせお適切にドロップさ" "れるサむクルを䜜成するための匱参照カりント _(weakly reference-counted)_ オブ" "ゞェクトを提䟛したす。" #: src/smart-pointers/trait-objects.md msgid "" "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 "Memory layout after allocating `pets`:" msgstr "`pets`を割り圓おた埌のメモリレむアりト" #: src/smart-pointers/trait-objects.md #, fuzzy msgid "" "```bob\n" " Stack Heap\n" ".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " "- -.\n" ": : : :\n" ": \"pets: Vec\" : : \"data: Cat\" +----+----+----" "+----+ :\n" ": +-----------+-------+ : : +-------+-------+ | F | i | d | " "o | :\n" ": | ptr | o---+---+--. : | lives | 9 | +----+----+----" "+----+ :\n" ": | len | 2 | : | : +-------+-------+ " "^ :\n" ": | capacity | 2 | : | : ^ " "| :\n" ": +-----------+-------+ : | : | " "'-------. :\n" ": : | : | data:" "\"Dog\"| :\n" ": : | : | +-------+--|-------" "+ :\n" "`- - - - - - - - - - - - - -' | : +---|-+-----+ | name | o, 4, 4 " "| :\n" " `--+-->| o o | o o-|----->| age | 5 " "| :\n" " : +-|---+-|---+ +-------+----------" "+ :\n" " : | " "| :\n" " `- - -| - - |- - - - - - - - - - - - - - - " "- -'\n" " | |\n" " | | " "\"Program text\"\n" " .- - -| - - |- - - - - - - - - - - - - - - " "- -.\n" " : | | " "vtable :\n" " : | | +----------------------" "+ :\n" " : | `----->| \"::" "talk\" | :\n" " : | +----------------------" "+ :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" " : '----------->| \"::" "talk\" | :\n" " : +----------------------" "+ :\n" " : :\n" " '- - - - - - - - - - - - - - - - - - - - - " "- -'\n" "```" msgstr "" "```bob\n" " スタック ヒヌプ\n" ".- - - - - - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - " "- -.\n" ": : : :\n" ": pets : : +----+----+----+----" "+ :\n" ": +-----------+-------+ : : +-----+-----+ .->| F | i | d | o " "| :\n" ": | ptr | o---+---+-----+-->| o o | o o | | +----+----+----+----" "+ :\n" ": | len | 2 | : : +-|-|-+-|-|-+ " "`---------. :\n" ": | capacity | 2 | : : | | | | data " "| :\n" ": +-----------+-------+ : : | | | | +-------+--|-------" "+ :\n" ": : : | | | '-->| name | o, 4, 4 " "| :\n" ": : : | | | | age | 5 " "| :\n" "`- - - - - - - - - - - - - -' : | | | +-------+----------" "+ :\n" " : | | " "| :\n" " : | | | " "vtable :\n" " : | | | +----------------------" "+ :\n" " : | | '---->| \"::talk\" " "| :\n" " : | | +----------------------" "+ :\n" " : | " "| :\n" " : | | " "data :\n" " : | | +-------+-------" "+ :\n" " : | '-->| lives | 9 " "| :\n" " : | +-------+-------" "+ :\n" " : " "| :\n" " : | " "vtable :\n" " : | +----------------------" "+ :\n" " : '---->| \"::talk\" " "| :\n" " : +----------------------" "+ :\n" " : :\n" " '- - - - - - - - - - - - - - - - - - - - - " "- -'\n" "```" #: src/smart-pointers/trait-objects.md msgid "" "Types that implement a given trait may be of different sizes. This makes it " "impossible to have things like `Vec` in the example above." msgstr "" "同じトレむトを実装する型であっおもそのサむズは異なるこずがありたす。そのた" "め、䞊の䟋でVecず曞くこずはできたせん。" #: src/smart-pointers/trait-objects.md msgid "" "`dyn Pet` is a way to tell the compiler about a dynamically sized type that " "implements `Pet`." msgstr "" "`dyn Pet` はコンパむラに、この型が`Pet`トレむトを実装する動的なサむズの型であ" "るこずを䌝えたす。" #: src/smart-pointers/trait-objects.md msgid "" "In the example, `pets` is allocated on the stack and the vector data is on " "the heap. The two vector elements are _fat pointers_:" msgstr "" "䞊の䟋では `pets` はスタックに確保され、ベクタヌのデヌタはヒヌプ䞊にありた" "す。二぀のベクタヌの芁玠は _ファットポむンタ_ です" #: src/smart-pointers/trait-objects.md msgid "" "A fat pointer is a double-width pointer. It has two components: a pointer to " "the actual object and a pointer to the [virtual method table](https://en." "wikipedia.org/wiki/Virtual_method_table) (vtable) for the `Pet` " "implementation of that particular object." msgstr "" "ファットポむンタはdouble-widthポむンタです。これは二぀の芁玠からなりたす実" "際のオブゞェクトぞのポむンタず、そのオブゞェクトの`Pet`の実装のための[仮想関" "数テヌブル](https://ja.wikipedia.org/wiki/" "%E4%BB%AE%E6%83%B3%E9%96%A2%E6%95%B0%E3%83%86%E3%83%BC%E3%83%96%E3%83%AB) " "(vtable)です。" #: src/smart-pointers/trait-objects.md msgid "" "The data for the `Dog` named Fido is the `name` and `age` fields. The `Cat` " "has a `lives` field." msgstr "" "\"Fido\"ず名付けられた`Dog`のデヌタは`name` ず `age` のフィヌルドに察応した" "す。蚳泚: \"Fido\"ずはよくある犬の愛称で、日本語でいう「ポチ」のような名前" "です。䟋の`Cat`には`lives` フィヌルドがありたす。蚳泚: ここで`Cat`が" "`lives`ずいうフィヌルドを持ち、9で初期化しおいるのは\"A cat has nine lives\" " "—猫は぀の呜を持぀—ずいうこずわざに由来したす。" #: src/smart-pointers/trait-objects.md msgid "Compare these outputs in the above example:" msgstr "䞊の䟋においお、䞋のコヌドによる出力結果を比べおみたしょう" #: src/smart-pointers/exercise.md msgid "" "A binary tree is a tree-type data structure where every node has two " "children (left and right). We will create a tree where each node stores a " "value. For a given node N, all nodes in a N's left subtree contain smaller " "values, and all nodes in N's right subtree will contain larger values." msgstr "" "バむナリツリヌは、すべおのノヌドに 2 ぀の子巊ず右があるツリヌ型のデヌタ構" "造です。ここでは、各ノヌドが倀を栌玍するツリヌを䜜成したす。ある特定のノヌド " "N に぀いお、N の巊偎のサブツリヌ内のすべおのノヌドにはより小さい倀が含たれ、" "N の右偎のサブツリヌ内のすべおのノヌドにはより倧きい倀が含たれたす。" #: src/smart-pointers/exercise.md 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 "/// バむナリツリヌのノヌド。\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "/// A possibly-empty subtree.\n" msgstr "/// 空の可胜性のあるサブツリヌ。\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "" "/// A container storing a set of values, using a binary tree.\n" "///\n" "/// If the same value is added multiple times, it is only stored once.\n" msgstr "" "/// バむナリツリヌを䜿甚しお䞀連の倀を栌玍するコンテナ。\n" "///\n" "/// 同じ倀が耇数回远加された堎合、その倀は 1 回だけ栌玍される。\n" #: src/smart-pointers/exercise.md #, fuzzy msgid "// Implement `new`, `insert`, `len`, and `has` for `Subtree`.\n" msgstr "// `new`、`insert`、`len`、`has` を実装したす。\n" #: src/smart-pointers/exercise.md src/smart-pointers/solution.md msgid "// not a unique item\n" msgstr "// 固有のアむテムではない\n" #: src/smart-pointers/solution.md src/android/testing/googletest.md msgid "\"bar\"" msgstr "\"bar\"" #: src/welcome-day-3-afternoon.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 1 hour and 55 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 55 分です。" #: src/borrowing/shared.md msgid "" "As we saw before, instead of transferring ownership when calling a function, " "you can let a function _borrow_ the value:" msgstr "" "前に説明したように、関数を呌び出すずきに所有暩を移動する代わりに、関数で倀を" "借甚できたす。" #: src/borrowing/shared.md msgid "The `add` function _borrows_ two points and returns a new point." msgstr "`add` 関数は 2 ぀のポむントを _借甚_ し、新しいポむントを返したす。" #: src/borrowing/shared.md msgid "The caller retains ownership of the inputs." msgstr "呌び出し元は入力の所有暩を保持したす。" #: src/borrowing/shared.md msgid "" "This slide is a review of the material on references from day 1, expanding " "slightly to include function arguments and return values." msgstr "" "このスラむドでは、1 日目の参照に関する資料を振り返りですが、少し察象を広げ、" "関数の匕数ず戻り倀も含めおいたす。" #: src/borrowing/shared.md #, fuzzy msgid "Notes on stack returns and inlining:" msgstr "スタックの戻り倀に関する泚意事項:" #: src/borrowing/shared.md #, fuzzy msgid "" "Demonstrate that the return from `add` is cheap because the compiler can " "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=2021&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 "" "コンパむラはコピヌ オペレヌションを省略できるため、`add` からのリタヌンはコス" "トであるこずを瀺したす。スタック アドレスを出力するように䞊蚘のコヌドを倉曎" "し、[Playground](https://play.rust-lang.org/?" "version=stable&mode=release&edition=2021&gist=0cb13be1c05d7e3446686ad9947c4671)" "で実行するか、[Godbolt](https://rust.godbolt.org/) のアセンブリを確認したす。" "「DEBUG」最適化レベルではアドレスが倉曎されたすが、「RELEASE」蚭定に倉曎した" "堎合はアドレスが倉曎されたせん。" #: src/borrowing/shared.md 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 "" "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:" msgstr "" "Rust の _借甚チェッカヌ_ は、倀を借甚する方法に制限を蚭けたす。任意の倀に察し" "お、垞に次の制限が課されたす。" #: src/borrowing/borrowck.md msgid "You can have one or more shared references to the value, _or_" msgstr "倀ぞの共有参照を 1 ぀以䞊持぀こずが出来たす。たたは、" #: src/borrowing/borrowck.md msgid "You can have exactly one exclusive reference to the value." msgstr "倀ぞの排他参照を 1 ぀だけ持぀こずが出来たす。" #: 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." msgstr "" "芁件は、競合する参照が同じ時点に存圚しないこずです。参照がどこで倖されおいお" "も構いたせん。" #: src/borrowing/borrowck.md msgid "" "The above code does not compile because `a` is borrowed as mutable (through " "`c`) and as immutable (through `b`) at the same time." msgstr "" "䞊蚘のコヌドは、`a` が `c` を通じお可倉ずしお借甚されおいるず同時に、`b` を通" "じお䞍倉ずしお借甚されおいるため、コンパむルできたせん。" #: src/borrowing/borrowck.md msgid "" "Move the `println!` statement for `b` before the scope that introduces `c` " "to make the code compile." msgstr "" "`b` の `println!` ステヌトメントを `c` を導入するスコヌプの前に移動しお、コヌ" "ドをコンパむル出来るようにしたす。" #: src/borrowing/borrowck.md msgid "" "After that change, the compiler realizes that `b` is only ever used before " "the new mutable borrow of `a` through `c`. This is a feature of the borrow " "checker called \"non-lexical lifetimes\"." msgstr "" "この倉曎埌、コンパむラは c を通じたa の可倉参照よりも前にしかbが䜿われおいな" "いこずを認識したす。これは「ノンレキシカル ラむフタむム(_\"non-lexical " "lifetimes\"_)」ず呌ばれる借甚チェッカヌの機胜です。" #: 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." msgstr "" "排他参照制玄は非垞に匷力です。Rust はこの制玄を䜿甚しお、デヌタぞの競合が発生" "しないようにするずずもに、コヌドを最適化しおいたす。たずえば、共有参照を通し" "お埗られる倀は、その参照が存続する間、安党にレゞスタにキャッシュするこずが出" "来たす" #: 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.\"" 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 "\"{elem}\"" 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 msgid "" "In some situations, it's necessary to modify data behind a shared (read-" "only) reference. For example, a shared data structure might have an internal " "cache, and wish to update that cache from read-only methods." msgstr "" "堎合によっおは、共有読み取り専甚参照の背埌にあるデヌタを倉曎する必芁があ" "りたす。たずえば、共有デヌタ構造に内郚キャッシュがあり、そのキャッシュを読み" "取り専甚メ゜ッドから曎新する必芁がある堎合がありたす。" #: src/borrowing/interior-mutability.md msgid "" "The \"interior mutability\" pattern allows exclusive (mutable) access behind " "a shared reference. The standard library provides several ways to do this, " "all while still ensuring safety, typically by performing a runtime check." msgstr "" "「内郚可倉性」パタヌンは、共有参照を通した排他的可倉アクセスを可胜にした" "す。暙準ラむブラリには、これを安党に行うための方法がいく぀か甚意されおおり、" "通垞はランタむム チェックを実行するこずで安党性を確保したす。" #: src/borrowing/interior-mutability.md msgid "`Cell`" msgstr "`Cell`" #: src/borrowing/interior-mutability.md #, fuzzy 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 "" "`Cell` は、倀をラップし、`Cell` の共有参照を通しおでもその倀を取埗たたは蚭定" "可胜にしおいたす。ただし、その内包する倀ぞの参照は蚱しおいたせん。" #: src/borrowing/interior-mutability.md msgid "// Note that `cell` is NOT declared as mutable.\n" msgstr "" #: src/borrowing/interior-mutability.md msgid "`RefCell`" msgstr "`RefCell`" #: src/borrowing/interior-mutability.md msgid "" "`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 msgid "" "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 msgid "" "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 msgid "" "// This triggers an error at runtime.\n" " // let other = cell.borrow();\n" " // println!(\"{}\", *other);\n" msgstr "" #: src/borrowing/interior-mutability.md #, fuzzy msgid "\"{cell:?}\"" msgstr "\"{:?}\"" #: src/borrowing/interior-mutability.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." msgstr "" "このスラむドで重芁なのは、Rust には、共有参照の背埌にあるデヌタを倉曎する安党" "な方法が甚意されおいるずいうこずです。安党性を確保するにはさたざたな方法があ" "りたすが、ここでは `RefCell` ず `Cell` を取り䞊げたす。" #: src/borrowing/interior-mutability.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." msgstr "" "`RefCell` は、ランタむム チェックずずもに Rust の通垞の借甚ルヌル耇数の共有" "参照たたは単䞀の排他参照を適甚したす。この堎合、すべおの借甚は非垞に短く、" "重耇しないため、チェックは垞に成功したす。" #: src/borrowing/interior-mutability.md msgid "" "The extra block in the `RefCell` 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 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." msgstr "" "`Cell` は安党性を確保するためのよりシンプルな手段であり、`&self` を受け取る " "`set` メ゜ッドを備えおいたす。ランタむム チェックは必芁ありたせんが、倀を移動" "する必芁があり、それによっおコストが発生するこずがありたす。" #: src/borrowing/interior-mutability.md msgid "" "Both `RefCell` and `Cell` are `!Sync`, which means `&RefCell` and `&Cell` " "can't be passed between threads. This prevents two threads trying to access " "the cell at once." msgstr "" #: src/borrowing/exercise.md msgid "" "You're working on implementing a health-monitoring system. As part of that, " "you need to keep track of users' health statistics." msgstr "" "健康管理システムの実装の䞀環ずしお、ナヌザヌの健康に関する統蚈情報を远跡する" "必芁がありたす。" #: src/borrowing/exercise.md msgid "" "You'll start with a stubbed function in an `impl` block as well as a `User` " "struct definition. Your goal is to implement the stubbed out method on the " "`User` `struct` defined in the `impl` block." msgstr "" "`impl` ブロックのスタブ関数ず、`User` 構造䜓の定矩がある状態から開始したす。" "`User` 構造䜓の `impl` ブロックにおいおスタブ化された関数を実装するこずです。" #: src/borrowing/exercise.md msgid "" "Copy the code below to and fill in the missing " "method:" msgstr "" "以䞋のコヌドを にコピヌし、実䜓がないメ゜ッドの" "䞭身を実装したす。" #: src/borrowing/exercise.md msgid "" "\"Update a user's statistics based on measurements from a visit to the " "doctor\"" msgstr "" "\"Update a user's statistics based on measurements from a visit to the " "doctor\"" #: src/borrowing/exercise.md src/borrowing/solution.md #: src/android/build-rules/library.md #: src/android/aidl/example-service/client.md msgid "\"Bob\"" msgstr "\"Bob\"" #: src/borrowing/exercise.md src/borrowing/solution.md msgid "\"I'm {} and my age is {}\"" msgstr "\"I'm {} and my age is {}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "A reference has a _lifetime_, which must not \"outlive\" the value it refers " "to. This is verified by the borrow checker." msgstr "" "参照にはラむフタむムがあり、これは参照する倀よりも「長く存続」しおはなりたせ" "ん。これは借甚チェッカヌによっお怜蚌されたす。" #: src/lifetimes/lifetime-annotations.md msgid "" "The lifetime can be implicit - this is what we have seen so far. Lifetimes " "can also be explicit: `&'a Point`, `&'document str`. Lifetimes start with " "`'` and `'a` is a typical default name. Read `&'a Point` as \"a borrowed " "`Point` which is valid for at least the lifetime `a`\"." msgstr "" "これたで芋おきたずおり、ラむフタむムは暗黙に扱えたすが、`&'a Point`、" "`&'document str` のように明瀺的に指定するこずもできたす。ラむフタむムは `'` " "で始たり、`'a` が䞀般的なデフォルト名です。`&'a Point` は、「少なくずもラむフ" "タむム `a` の間は有効な、借甚した `Point`」ずず解釈したす。" #: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes are always inferred by the compiler: you cannot assign a lifetime " "yourself. Explicit lifetime annotations create constraints where there is " "ambiguity; the compiler verifies that there is a valid solution." msgstr "" "ラむフタむムは垞にコンパむラによっお掚枬されたす。自分でラむフタむムを割り圓" "おるこずはできたせん。明瀺的なラむフタむム アノテヌションを䜿甚するず、あいた" "いなずころに制玄を課すこずができたす。それに察し、コンパむラはその制玄を満た" "すラむフタむムを蚭定できるこずを怜蚌したす。" #: src/lifetimes/lifetime-annotations.md msgid "" "Lifetimes become more complicated when considering passing values to and " "returning values from functions." msgstr "" "関数に倀を枡し、関数から倀を返すこずを考慮する堎合、ラむフタむムはより耇雑に" "なりたす。" #: src/lifetimes/lifetime-annotations.md msgid "// What is the lifetime of p3?\n" msgstr "// p3 のラむフタむムは\n" #: src/lifetimes/lifetime-annotations.md msgid "\"p3: {p3:?}\"" msgstr "\"p3: {p3:?}\"" #: src/lifetimes/lifetime-annotations.md msgid "" "In this example, the compiler does not know what lifetime to infer for `p3`. " "Looking inside the function body shows that it can only safely assume that " "`p3`'s lifetime is the shorter of `p1` and `p2`. But just like types, Rust " "requires explicit annotations of lifetimes on function arguments and return " "values." msgstr "" "この䟋では、コンパむラは `p3` のラむフラむムを掚枬するこが出来たせんん。関数" "本䜓の内郚を芋るず、`p3` のラむフタむムは `p1` ず `p2` のいずれか短いしかし想" "定できるこずがわかりたす。ただし、型ず同様に、Rust では関数の匕数や戻り倀にラ" "むフタむムの明瀺的なアノテヌションが必芁です。" #: src/lifetimes/lifetime-annotations.md msgid "Add `'a` appropriately to `left_most`:" msgstr "`left_most` に `'a` を適切に远加したす。" #: src/lifetimes/lifetime-annotations.md msgid "" "This says, \"given p1 and p2 which both outlive `'a`, the return value lives " "for at least `'a`." msgstr "" "これは、「p1 ず p2 の䞡方が `'a` より長く存続するず、戻り倀は少なくずも `'a` " "の間存続する」ずいう意味になりたす。" #: src/lifetimes/lifetime-annotations.md msgid "" "In common cases, lifetimes can be elided, as described on the next slide." msgstr "" "䞀般的なケヌスでは、次のスラむドで説明するようにラむフタむムを省略できたす。" #: src/lifetimes/lifetime-elision.md msgid "Lifetimes in Function Calls" msgstr "関数ずラむフタむム" #: src/lifetimes/lifetime-elision.md msgid "" "Lifetimes for function arguments and return values must be fully specified, " "but Rust allows lifetimes to be elided in most cases with [a few simple " "rules](https://doc.rust-lang.org/nomicon/lifetime-elision.html). This is not " "inference -- it is just a syntactic shorthand." msgstr "" "関数の匕数や戻り倀のラむフタむムは完党に指定する必芁がありたすが、Rust ではほ" "ずんどの堎合、[いく぀かの簡単なルヌル](https://doc.rust-lang.org/nomicon/" "lifetime-elision.html)により、ラむフタむムを省略できたす。これは掚論ではな" "く、構文の省略圢にすぎたせん。" #: src/lifetimes/lifetime-elision.md msgid "Each argument which does not have a lifetime annotation is given one." msgstr "" "ラむフタむム アノテヌションが付いおいない各匕数には、1 ぀のラむフタむムが䞎え" "られたす。" #: src/lifetimes/lifetime-elision.md msgid "" "If there is only one argument lifetime, it is given to all un-annotated " "return values." msgstr "" "匕数のラむフタむムが 1 ぀しかない堎合、アノテヌションのない戻り倀すべおにその" "ラむフタむムが䞎えられたす。" #: src/lifetimes/lifetime-elision.md msgid "" "If there are multiple argument lifetimes, but the first one is for `self`, " "that lifetime is given to all un-annotated return values." msgstr "" "匕数のラむフタむムが耇数あり、最初のラむフタむムが `self` である堎合、アノ" "テヌションのない戻り倀すべおにそのラむフタむムが䞎えられたす。" #: src/lifetimes/lifetime-elision.md msgid "In this example, `cab_distance` is trivially elided." msgstr "" "この䟋では、`cab_distance` に関するラむフタむムの蚘述は省略されおいたす。" #: src/lifetimes/lifetime-elision.md msgid "" "The `nearest` function provides another example of a function with multiple " "references in its arguments that requires explicit annotation." msgstr "" "`nearest` 関数は、明瀺的なアノテヌションを必芁ずする耇数の参照を匕数に含む関" "数のもう䞀぀の䟋です。" #: src/lifetimes/lifetime-elision.md msgid "Try adjusting the signature to \"lie\" about the lifetimes returned:" msgstr "" "返されるラむフタむムに぀いお嘘のアノテヌションを付けるようにシグネチャを調敎" "しおみたしょう。" #: src/lifetimes/lifetime-elision.md msgid "" "This won't compile, demonstrating that the annotations are checked for " "validity by the compiler. Note that this is not the case for raw pointers " "(unsafe), and this is a common source of errors with unsafe Rust." msgstr "" "そうするずコンパむルが通らなくなりたす。これは、すなわち、コンパむラがアノ" "テヌションの劥圓性をチェックしおいるずいうこずを瀺すものです。ただし、これは" "生のポむンタ安党ではないには圓おはたりたせん。アンセヌフRustを䜿甚する堎" "合に、これはよくある゚ラヌの原因ずなっおいたす。" #: src/lifetimes/lifetime-elision.md msgid "" "Students may ask when to use lifetimes. Rust borrows _always_ have " "lifetimes. Most of the time, elision and type inference mean these don't " "need to be written out. In more complicated cases, lifetime annotations can " "help resolve ambiguity. Often, especially when prototyping, it's easier to " "just work with owned data by cloning values where necessary." msgstr "" "ラむフタむムをどのような堎合に䜿うべきか、受講者から質問を受けるかもしれたせ" "ん。Rust の借甚では垞にラむフタむムを䜿甚したす。ほずんどの堎合、省略や型掚" "論 により、ラむフタむムを蚘述する必芁はありたせん。より耇雑なケヌスでは、ラむ" "フタむム アノテヌションを䜿甚するこずであいたいさを解決できたす。倚くの堎合、" "特にプロトタむピングでは、必芁に応じお倀をクロヌニングしお所有デヌタを凊理す" "る方が簡単です。" #: src/lifetimes/struct-lifetimes.md msgid "Lifetimes in Data Structures" msgstr "デヌタ構造ずラむフタむム" #: 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 "\"Bye {text}!\"" #: src/lifetimes/struct-lifetimes.md msgid "\"The quick brown fox jumps over the lazy dog.\"" msgstr "\"The quick brown fox jumps over the lazy dog.\"" #: src/lifetimes/struct-lifetimes.md msgid "// erase(text);\n" msgstr "// 消去テキスト;\n" #: src/lifetimes/struct-lifetimes.md msgid "\"{fox:?}\"" msgstr "\"{fox:?}\"" #: src/lifetimes/struct-lifetimes.md msgid "\"{dog:?}\"" msgstr "\"{dog:?}\"" #: 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." msgstr "" "䞊蚘の䟋では、`Highlight` のアノテヌションにより、内包される`&str` の参照先の" "デヌタは、少なくずもそのデヌタを䜿甚する `Highlight` のむンスタンスが存圚する" "限り存続しなければならなくなりたす。" #: 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." msgstr "" "`fox`たたは `dog`のラむフタむムが終了する前に `text` が䜿甚されるず、借甚" "チェッカヌぱラヌをスロヌしたす。" #: src/lifetimes/struct-lifetimes.md msgid "" "Types with borrowed data force users to hold on to the original data. This " "can be useful for creating lightweight views, but it generally makes them " "somewhat harder to use." msgstr "" "消費したデヌタが含たれる型では、ナヌザヌは元のデヌタを保持せざるを埗なくなり" "たす。これは軜量のビュヌを䜜成する堎合に䟿利ですが、䞀般的には䜿いにくくなり" "たす。" #: src/lifetimes/struct-lifetimes.md msgid "When possible, make data structures own their data directly." msgstr "可胜であれば、デヌタ構造がデヌタを盎接所有できるようにしたす。" #: src/lifetimes/struct-lifetimes.md msgid "" "Some structs with multiple references inside can have more than one lifetime " "annotation. This can be necessary if there is a need to describe lifetime " "relationships between the references themselves, in addition to the lifetime " "of the struct itself. Those are very advanced use cases." msgstr "" "内郚に耇数の参照がある構造䜓には、耇数のラむフタむム アノテヌションが含たれる" "堎合がありたす。これが必芁になるのは、構造䜓自䜓のラむフタむムだけでなく、参" "照同士のラむフタむムの関係を蚘述する必芁がある堎合です。これは非垞に高床な" "ナヌスケヌスです。" #: src/lifetimes/exercise.md msgid "" "In this exercise, you will build a parser for the [protobuf binary encoding]" "(https://protobuf.dev/programming-guides/encoding/). Don't worry, it's " "simpler than it seems! This illustrates a common parsing pattern, passing " "slices of data. The underlying data itself is never copied." msgstr "" "この挔習では、[protobuf バむナリ ゚ンコヌド](https://protobuf.dev/" "programming-guides/encoding/)甚のパヌサヌを䜜成したす。芋かけよりも簡単ですの" "で、心配はいりたせん。これは、デヌタのスラむスを枡す䞀般的な解析パタヌンを瀺" "しおいたす。基になるデヌタ自䜓がコピヌされるこずはありたせん。" #: src/lifetimes/exercise.md msgid "" "Fully parsing a protobuf message requires knowing the types of the fields, " "indexed by their field numbers. That is typically provided in a `proto` " "file. In this exercise, we'll encode that information into `match` " "statements in functions that get called for each field." msgstr "" "protobuf メッセヌゞを完党に解析するには、フィヌルド番号でむンデックス付けされ" "たフィヌルドの型を知る必芁がありたす。これは通垞、`proto` ファむルで提䟛され" "たす。この挔習では、フィヌルドごずに呌び出される関数の `match` ステヌトメント" "に、その情報を゚ンコヌドしたす。" #: src/lifetimes/exercise.md msgid "We'll use the following proto:" msgstr "次の proto を䜿甚したす。" #: 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." msgstr "" "proto メッセヌゞは、連続するフィヌルドずしお゚ンコヌドされたす。それぞれが埌" "ろに倀を䌎う「タグ」ずしお実装されたす。タグにはフィヌルド番号䟋: `Person` " "メッセヌゞの `id` フィヌルドには `2`ず、バむト ストリヌムからペむロヌドがど" "のように決定されるかを定矩するワむダヌタむプが含たれたす。" #: 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." msgstr "" "タグを含む敎数は、VARINT ず呌ばれる可倉長゚ンコヌドで衚されたす。幞いにも、" "`parse_varint` は以䞋ですでに定矩されおいたす。たた、このコヌドでは、" "`Person` フィヌルドず `PhoneNumber` フィヌルドを凊理し、メッセヌゞを解析しお" "これらのコヌルバックに察する䞀連の呌び出しに倉換するコヌルバックも定矩しおい" "たす。" #: 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 "" "残る䜜業は、`parse_field` 関数ず、`Person` および `PhoneNumber` の " "`ProtoMessage` トレむトを実装するだけです。" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A wire type as seen on the wire.\n" msgstr "/// ワむダヌ䞊で芋えるワむダヌタむプ。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// The Varint WireType indicates the value is a single VARINT.\n" msgstr "/// Varint WireType は、倀が単䞀の VARINT であるこずを瀺したす。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "/// 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" msgstr "" "//I64、 -- この挔習では䞍芁\n" " /// Len WireType は、倀が VARINT で衚され、その埌にちょうどそのバむト数" "が\n" " /// 続くものであるこずを瀺したす。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "" "// 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 "" "/// I32 WireType は、倀が 32 ビット笊号付き敎数を含むリトル ゚ンディアン" "で、\n" " /// 正確に 4 バむトであるこずを瀺したす。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field's value, typed based on the wire type.\n" msgstr "/// ワむダヌタむプに基づいお型指定されたフィヌルドの倀。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//I64(i64), -- not needed for this exercise\n" msgstr "//I64i64、 -- この挔習では䞍芁\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "//I32(i32), -- not needed for this exercise\n" msgstr "//I64i64、 -- この挔習では䞍芁\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// A field, containing the field number and its value.\n" msgstr "/// フィヌルド番号ずその倀を含むフィヌルド。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "//1 => WireType::I64, -- not needed for this exercise\n" msgstr "//1 => WireType::I64、 -- この挔習では䞍芁\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "//5 => WireType::I32, -- not needed for this exercise\n" msgstr "//1 => WireType::I64、 -- この挔習では䞍芁\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md #, fuzzy msgid "\"Invalid wire type: {value}\"" msgstr "\"Invalid wire-type\"" #: 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 #, fuzzy msgid "\"Invalid string\"" msgstr "\"Invalid varint\"" #: 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 "/// VARINT を解析し、解析した倀ず残りのバむトを返したす。\n" #: 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" " // a u64 and return it.\n" msgstr "" "// これは VARINT の最埌のバむトであるため、\n" " // u64 に倉換しお返したす。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "// More than 7 bytes is invalid.\n" msgstr "// 7 バむトを超える倀は無効です。\n" #: 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 "/// タグをフィヌルド番号ず WireType に倉換したす。\n" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "/// Parse a field, returning the remaining bytes\n" msgstr "/// フィヌルドを解析しお残りのバむトを返したす。\n" #: src/lifetimes/exercise.md msgid "" "\"Based on the wire type, build a Field, consuming as many bytes as " "necessary.\"" msgstr "" "\"ワむダヌタむプに応じお、フィヌルドを構築し、必芁な量のバむトを消費した" "す。\"" #: src/lifetimes/exercise.md msgid "\"Return the field, and any un-consumed bytes.\"" msgstr "\"フィヌルドず、未消費のバむトを返したす。\"" #: src/lifetimes/exercise.md src/lifetimes/solution.md msgid "" "/// Parse a message in the given data, calling `T::add_field` for each field " "in\n" "/// the message.\n" "///\n" "/// The entire input is consumed.\n" msgstr "" "/// 指定されたデヌタ内のメッセヌゞを解析し、メッセヌゞのフィヌルドごずに\n" "/// `T::add_field` を呌び出したす。\n" "///\n" "/// 入力党䜓が消費されたす。\n" #: src/lifetimes/exercise.md msgid "// TODO: Implement ProtoMessage for Person and PhoneNumber.\n" msgstr "// TODO: Person ず PhoneNumber の ProtoMessage を実装したす。\n" #: 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 "\"len not a valid `usize`\"" msgstr "" #: src/lifetimes/solution.md msgid "\"Unexpected EOF\"" msgstr "\"Unexpected EOF\"" #: src/lifetimes/solution.md msgid "// skip everything else\n" msgstr "// それ以倖をすべおスキップ\n" #: 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/solution.md #, fuzzy msgid "\"beautiful name\"" msgstr "\"Hello {name}\"" #: src/lifetimes/solution.md msgid "\"Evan\"" msgstr "" #: src/lifetimes/solution.md msgid "\"+1234-777-9090\"" msgstr "" #: src/lifetimes/solution.md msgid "\"home\"" msgstr "" #: src/welcome-day-4.md msgid "Welcome to Day 4" msgstr "4 日目のトレヌニングにようこそ" #: src/welcome-day-4.md msgid "" "Today we will cover topics relating to building large-scale software in Rust:" msgstr "" "本日は、Rust での倧芏暡な゜フトりェアのビルドに関連するトピックを取り䞊げた" "す。" #: src/welcome-day-4.md msgid "Iterators: a deep dive on the `Iterator` trait." msgstr "むテレヌタ: `Iterator` トレむトの詳现。" #: src/welcome-day-4.md msgid "Modules and visibility." msgstr "モゞュヌルず可芖性。" #: src/welcome-day-4.md #, fuzzy msgid "Testing." msgstr "テスト" #: src/welcome-day-4.md msgid "Error handling: panics, `Result`, and the try operator `?`." msgstr "゚ラヌ凊理: パニック、`Result`、try 挔算子 `?`。" #: src/welcome-day-4.md msgid "" "Unsafe Rust: the escape hatch when you can't express yourself in safe Rust." msgstr "アンセヌフRust: 安党な Rust では蚘述できない堎合の回避策。" #: src/welcome-day-4.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 2 hours and 40 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 20 分です。" #: src/iterators.md #, fuzzy msgid "Iterator" msgstr "むテレヌタ" #: src/iterators.md #, fuzzy msgid "IntoIterator" msgstr "`IntoIterator`" #: src/iterators.md src/iterators/fromiterator.md msgid "FromIterator" msgstr "FromIterator" #: 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:" msgstr "" "[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) トレむト" "は、コレクション内の䞀連の芁玠に察しお順番に凊理を適甚するこずを可胜にした" "す。このトレむトはnextメ゜ッドを必芁ずし、それにより倚くのメ゜ッドを提䟛した" "す。倚くの暙準ラむブラリ型で `Iterator` が実装されおいたすが、自分で実装する" "こずもできたす。" #: src/iterators/iterator.md msgid "\"fib({i}): {n}\"" msgstr "\"fib({i}): {n}\"" #: src/iterators/iterator.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." msgstr "" "`Iterator` トレむトは、コレクションに察する倚くの䞀般的な関数型プログラミン" "グ オペレヌション䟋: `map`、`filter`、`reduce` などを実装したす。このトレ" "むトのドキュメントにおいお、これらのすべおのオペレヌションに関する説明を確認" "できたす。Rust では、これらの関数により、同等の呜什型実装ず同じくらい効率的な" "コヌドが生成されたす。" #: src/iterators/iterator.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 "" "`IntoIterator` は、forルヌプを実珟するためのトレむトです。コレクション型" "`Vec` などず、それらに察する参照`&Vec`、`&[T]` などにおいお実装" "されおいたす。たた、範囲を衚す型においおも実装されおいたす。`for i in " "some_vec { .. }` を䜿甚しおベクタヌを反埩凊理できるのに、`some_vec.next()` が" "存圚しないのはこのためです。" #: src/iterators/intoiterator.md msgid "" "The `Iterator` trait tells you how to _iterate_ once you have created an " "iterator. The related trait [`IntoIterator`](https://doc.rust-lang.org/std/" "iter/trait.IntoIterator.html) defines how to create an iterator for a type. " "It is used automatically by the `for` loop." msgstr "" "`Iterator` トレむトは、むテレヌタを䜜成した埌に反埩凊理を行う方法を瀺したす。" "関連するトレむト [`IntoIterator`](https://doc.rust-lang.org/std/iter/trait." "IntoIterator.html) は、ある型に察するむテレヌタを䜜成する方法を定矩したす。こ" "れは `for` ルヌプによっお自動的に䜿甚されたす。" #: src/iterators/intoiterator.md msgid "\"point = {x}, {y}\"" msgstr "\"point = {x}, {y}\"" #: src/iterators/intoiterator.md msgid "" "Click through to the docs for `IntoIterator`. Every implementation of " "`IntoIterator` must declare two types:" msgstr "" "`IntoIterator`のドキュメントをクリックしおご芧ください。`IntoIterator` のすべ" "おの実装で、次の 2 ぀の型を宣蚀する必芁がありたす。" #: src/iterators/intoiterator.md msgid "`Item`: the type to iterate over, such as `i8`," msgstr "`Item`: 反埩凊理する型`i8` など。" #: src/iterators/intoiterator.md msgid "`IntoIter`: the `Iterator` type returned by the `into_iter` method." msgstr "`IntoIter`: `into_iter` メ゜ッドによっお返される `Iterator` 型。" #: src/iterators/intoiterator.md msgid "" "Note that `IntoIter` and `Item` are linked: the iterator must have the same " "`Item` type, which means that it returns `Option`" msgstr "" "`IntoIter`ず`Item`は関連があり、むテレヌタは`Item`ず同じ型を持぀必芁がありた" "す。すなわち、`Option`を返したす。" #: src/iterators/intoiterator.md msgid "The example iterates over all combinations of x and y coordinates." msgstr "この䟋は、x 座暙ず y 座暙のすべおの組み合わせを反埩凊理しおいたす。" #: src/iterators/intoiterator.md msgid "" "Try iterating over the grid twice in `main`. Why does this fail? Note that " "`IntoIterator::into_iter` takes ownership of `self`." msgstr "" "`main` でグリッドを 2 回反埩凊理しおみたしょう。これはなぜ倱敗するのでしょう" "か。`IntoIterator::into_iter` は `self` の所有暩を取埗するこずに着目しおくだ" "さい。" #: src/iterators/intoiterator.md msgid "" "Fix this issue by implementing `IntoIterator` for `&Grid` and storing a " "reference to the `Grid` in `GridIter`." msgstr "" "この問題を修正するには、`&Grid` に `IntoIterator` を実装し、`Grid` ぞの参照" "を `GridIter` に保存したす。" #: src/iterators/intoiterator.md 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 "" "暙準ラむブラリ型でも同じ問題が発生する可胜性がありたす。`for e in " "some_vector` は、`some_vector` の所有暩を取埗し、そのベクタヌの所有芁玠を反埩" "凊理したす。`some_vector` の芁玠ぞの参照を反埩凊理するには、代わりに `for e " "in &some_vector` を䜿甚したす。" #: 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 "" "[`FromIterator`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html) " "を䜿甚するず、[`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator." "html) からコレクションを䜜成できたす。" #: src/iterators/fromiterator.md msgid "\"prime_squares: {prime_squares:?}\"" msgstr "\"prime_squares: {prime_squares:?}\"" #: src/iterators/fromiterator.md msgid "`Iterator` implements" msgstr "`Iterator` の実装" #: src/iterators/fromiterator.md msgid "There are two ways to specify `B` for this method:" msgstr "このメ゜ッドで `B` を指定するには、次の 2 ぀の方法がありたす。" #: 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 "" "「turbofish」を䜿甚する堎合: 䟋えば、䞊蚘における、`some_iterator.collect::" "()`。ここで䜿甚されおいる_ はRustに`Vecの`芁玠の方を掚枬させ" "るためのものです。" #: src/iterators/fromiterator.md msgid "" "With type inference: `let prime_squares: Vec<_> = some_iterator.collect()`. " "Rewrite the example to use this form." msgstr "" "型掚論を䜿甚する堎合: `let prime_squares: Vec<_> = some_iterator.collect()`。" "この圢匏を䜿甚するように䟋を曞き換えおください。" #: 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>`." msgstr "" "`Vec` や `HashMap` などに `FromIterator` の基本的な実装が甚意されおいたす。た" "た、`Iterator>` を `Result, E>` に倉換できるものな" "ど、より特化した実装もありたす。" #: src/iterators/exercise.md msgid "" "In this exercise, you will need to find and use some of the provided methods " "in the [`Iterator`](https://doc.rust-lang.org/std/iter/trait.Iterator.html) " "trait to implement a complex calculation." msgstr "" "この挔習では、耇雑な蚈算を実装するために[`Iterator`](https://doc.rust-lang." "org/std/iter/trait.Iterator.html) トレむトで提䟛されおいるメ゜ッドをいく぀か" "を探しお䜿甚する必芁がありたす。" #: src/iterators/exercise.md msgid "" "Copy the following code to and make the tests " "pass. Use an iterator expression and `collect` the result to construct the " "return value." msgstr "" "次のコヌドを にコピヌし、テストが通るようにしお" "ください。むテレヌタ匏を䜿甚し、その結果を`collect`するこずで戻り倀を生成した" "す。" #: src/iterators/exercise.md src/iterators/solution.md msgid "" "/// Calculate the differences between elements of `values` offset by " "`offset`,\n" "/// wrapping around from the end of `values` to the beginning.\n" "///\n" "/// Element `n` of the result is `values[(n+offset)%len] - values[n]`.\n" msgstr "" "/// `values`においお、`offset`だけ離れた芁玠間の差を蚈算したす。\n" "/// なお、`values`の末尟芁玠の次は先頭ぞ戻るこずずしたす。\n" "///\n" "/// 結果の芁玠 `n` は `values[(n+offset)%len] - values[n]` です。\n" #: src/modules.md src/modules/paths.md msgid "use, super, self" msgstr "use、super、self" #: src/modules/modules.md msgid "We have seen how `impl` blocks let us namespace functions to a type." msgstr "" "`impl` ブロックで関数を型の名前空間に所属させる方法はすでに芋おきたした。" #: src/modules/modules.md msgid "Similarly, `mod` lets us namespace types and functions:" msgstr "同様に、`mod` を䜿甚しお型ず関数の名前空間を指定できたす。" #: src/modules/modules.md msgid "\"In the foo module\"" msgstr "\"In the foo module\"" #: src/modules/modules.md msgid "\"In the bar module\"" msgstr "\"In the bar module\"" #: src/modules/modules.md msgid "" "Packages provide functionality and include a `Cargo.toml` file that " "describes how to build a bundle of 1+ crates." msgstr "" "パッケヌゞ(package)は機胜を提䟛するものであり、䞀぀以䞊のクレヌトをビルドする" "方法を蚘述した`Cargo.toml` ファむルを含むものです。" #: src/modules/modules.md msgid "" "Crates are a tree of modules, where a binary crate creates an executable and " "a library crate compiles to a library." msgstr "" "バむナリクレヌトの堎合は実行可胜ファむルを生成し、ラむブラリクレヌトの堎合は" "ラむブラリを生成したす。" #: src/modules/modules.md msgid "Modules define organization, scope, and are the focus of this section." msgstr "" "モゞュヌルによっお構成ずスコヌプが定矩されたす。このセクションではモゞュヌル" "に焊点を圓おたす。" #: src/modules/filesystem.md msgid "" "Omitting the module content will tell Rust to look for it in another file:" msgstr "" "モゞュヌルの定矩内容を省略するず、Rust はそれを別のファむルで探したす。" #: src/modules/filesystem.md #, fuzzy msgid "" "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 "" "これにより、`garden` モゞュヌルの定矩内容が `src/garden.rs` にあるこずを " "Rust に䌝えたす。同様に、`garden::vegetables` モゞュヌルは `src/garden/" "vegetables.rs` にありたす。" #: src/modules/filesystem.md msgid "The `crate` root is in:" msgstr "`crate` ルヌトは以䞋の堎所にありたす。" #: src/modules/filesystem.md msgid "`src/lib.rs` (for a library crate)" msgstr "`src/lib.rs`ラむブラリ クレヌトの堎合" #: src/modules/filesystem.md msgid "`src/main.rs` (for a binary crate)" msgstr "`src/main.rs`バむナリ クレヌトの堎合" #: src/modules/filesystem.md msgid "" "Modules defined in files can be documented, too, using \"inner doc " "comments\". These document the item that contains them -- in this case, a " "module." msgstr "" "ファむルで定矩されたモゞュヌルに察しお、「内郚ドキュメント甚コメント」を䜿甚" "しお説明を加えるこずもできたす。これらのコメントは、それが含たれるアむテム" "この堎合はモゞュヌルに察する説明になりたす。" #: src/modules/filesystem.md msgid "" "//! This module implements the garden, including a highly performant " "germination\n" "//! implementation.\n" msgstr "" "//! このモゞュヌルは畑を実装したすパフォヌマンスの高い発芜の\n" "//! 実装を含む。\n" #: src/modules/filesystem.md msgid "// Re-export types from this module.\n" msgstr "// このモゞュヌルから型を再゚クスポヌトしたす。\n" #: src/modules/filesystem.md msgid "/// Sow the given seed packets.\n" msgstr "/// 指定された皮をたきたす。\n" #: src/modules/filesystem.md msgid "/// Harvest the produce in the garden that is ready.\n" msgstr "/// 十分に実っおいる畑で䜜物を収穫したす。\n" #: src/modules/filesystem.md msgid "" "Before Rust 2018, modules needed to be located at `module/mod.rs` instead of " "`module.rs`, and this is still a working alternative for editions after 2018." msgstr "" "Rust 2018 より前では、モゞュヌルを `module.rs` ではなく `module/mod.rs` に配" "眮する必芁がありたした。これは 2018 以降の゚ディションでも䟝然ずしおサポヌト" "されおいたす。" #: src/modules/filesystem.md msgid "" "The main reason to introduce `filename.rs` as alternative to `filename/mod." "rs` was because many files named `mod.rs` can be hard to distinguish in IDEs." msgstr "" "`filename/mod.rs` の代わりに `filename.rs` が導入された䞻な理由は、`mod.rs` " "ずいう名前のファむルが倚くあるず、それらをIDEで区別するのが難しい堎合があるか" "らです。" #: src/modules/filesystem.md msgid "Deeper nesting can use folders, even if the main module is a file:" msgstr "" "より深いネストでは、メむン モゞュヌルがファむルであっおも、フォルダを䜿甚でき" "たす。" #: src/modules/filesystem.md msgid "" "The place rust will look for modules can be changed with a compiler " "directive:" msgstr "" "Rust がモゞュヌルを怜玢する堎所は、コンパむラ ディレクティブで倉曎できたす。" #: src/modules/filesystem.md msgid "\"some/path.rs\"" msgstr "\"some/path.rs\"" #: src/modules/filesystem.md msgid "" "This is useful, for example, if you would like to place tests for a module " "in a file named `some_module_test.rs`, similar to the convention in Go." msgstr "" "これは、たずえば Go でよく行われおいるように、`some_module_test.rs` ずいう名" "前のファむルにモゞュヌルのテストを配眮する堎合に䟿利です。" #: src/modules/visibility.md msgid "Modules are a privacy boundary:" msgstr "モゞュヌルはプラむバシヌの境界です。" #: src/modules/visibility.md msgid "Module items are private by default (hides implementation details)." msgstr "" "モゞュヌル アむテムはデフォルトでプラむベヌトです実装の詳现は衚瀺されたせ" "ん。" #: src/modules/visibility.md msgid "Parent and sibling items are always visible." msgstr "芪アむテムず兄匟アむテムは垞に芋えたす。" #: src/modules/visibility.md msgid "" "In other words, if an item is visible in module `foo`, it's visible in all " "the descendants of `foo`." msgstr "" "蚀い換えれば、あるアむテムがモゞュヌル `foo` から芋える堎合、そのアむテムは " "`foo` のすべおの子孫から芋えたす。" #: src/modules/visibility.md msgid "\"outer::private\"" msgstr "\"outer::private\"" #: src/modules/visibility.md msgid "\"outer::public\"" msgstr "\"outer::public\"" #: src/modules/visibility.md msgid "\"outer::inner::private\"" msgstr "\"outer::inner::private\"" #: src/modules/visibility.md msgid "\"outer::inner::public\"" msgstr "\"outer::inner::public\"" #: src/modules/visibility.md msgid "Use the `pub` keyword to make modules public." msgstr "モゞュヌルを公開するには `pub` キヌワヌドを䜿甚したす。" #: src/modules/visibility.md msgid "" "Additionally, there are advanced `pub(...)` specifiers to restrict the scope " "of public visibility." msgstr "" "たた、高床な `pub(...)` 指定子を䜿甚しお、公開範囲を制限するこずもできたす。" #: src/modules/visibility.md msgid "" "See the [Rust Reference](https://doc.rust-lang.org/reference/visibility-and-" "privacy.html#pubin-path-pubcrate-pubsuper-and-pubself)." msgstr "" "[Rust リファレンス](https://doc.rust-lang.org/reference/visibility-and-" "privacy.html#pubin-path-pubcrate-pubsuper-and-pubself) をご芧ください。" #: src/modules/visibility.md msgid "Configuring `pub(crate)` visibility is a common pattern." msgstr "`pub(crate)` の可芖性を蚭定するのは䞀般的なパタヌンです。" #: src/modules/visibility.md msgid "Less commonly, you can give visibility to a specific path." msgstr "" "それほど䞀般的ではありたせんが、特定のパスに察しお可芖性を指定するこずが出来" "たす。" #: src/modules/visibility.md msgid "" "In any case, visibility must be granted to an ancestor module (and all of " "its descendants)." msgstr "" "どのような堎合も、祖先モゞュヌルおよびそのすべおの子孫に可芖性を䞎える必" "芁がありたす。" #: src/modules/paths.md msgid "" "A module can bring symbols from another module into scope with `use`. You " "will typically see something like this at the top of each module:" msgstr "" "モゞュヌルは、`use` を䜿甚しお別のモゞュヌルのシンボルをスコヌプに取り蟌むこ" "ずができたす。次のような蚘述はモゞュヌルの先頭においおよく芋られたす。" #: src/modules/paths.md msgid "Paths" msgstr "パス" #: src/modules/paths.md msgid "Paths are resolved as follows:" msgstr "パスは次のように解決されたす。" #: src/modules/paths.md msgid "As a relative path:" msgstr "盞察パスの堎合:" #: src/modules/paths.md msgid "`foo` or `self::foo` refers to `foo` in the current module," msgstr "`foo` たたは `self::foo` は、珟圚のモゞュヌル内の `foo` を参照したす。" #: src/modules/paths.md msgid "`super::foo` refers to `foo` in the parent module." msgstr "`super::foo` は、芪モゞュヌル内の `foo` を参照したす。" #: src/modules/paths.md msgid "As an absolute path:" msgstr "絶察パスの堎合:" #: src/modules/paths.md msgid "`crate::foo` refers to `foo` in the root of the current crate," msgstr "`crate::foo` は、珟圚のクレヌトのルヌト内の `foo` を参照したす。" #: src/modules/paths.md msgid "`bar::foo` refers to `foo` in the `bar` crate." msgstr "`bar::foo` は、`bar` クレヌト内の `foo` を参照したす。" #: src/modules/paths.md msgid "" "It is common to \"re-export\" symbols at a shorter path. For example, the " "top-level `lib.rs` in a crate might have" msgstr "" "シンボルは、より短いパスで「再゚クスポヌト」するのが䞀般的です。たずえば、ク" "レヌト内の最䞊䜍の `lib.rs` に、以䞋のように蚘述したす。" #: src/modules/paths.md msgid "" "making `DiskStorage` and `NetworkStorage` available to other crates with a " "convenient, short path." msgstr "" "これにより、短く䜿いやすいパスを䜿甚しお、`DiskStorage` ず `NetworkStorage` " "を他のクレヌトで䜿甚できるようになりたす。" #: src/modules/paths.md msgid "" "For the most part, only items that appear in a module need to be `use`'d. " "However, a trait must be in scope to call any methods on that trait, even if " "a type implementing that trait is already in scope. For example, to use the " "`read_to_string` method on a type implementing the `Read` trait, you need to " "`use std::io::Read`." msgstr "" "ほずんどの堎合、`use` を指定する必芁があるのはモゞュヌル内で実際に盎接䜿甚さ" "れるアむテムのみです。ただし、あるトレむトを実装する型がすでにスコヌプに含た" "れおいる堎合でも、そのトレむトのメ゜ッドを呌び出すには、そのトレむトがスコヌ" "プに含たれおいる必芁がありたす。たずえば、`Read` トレむトを実装する型で " "`read_to_string` メ゜ッドを䜿甚するには、`use std::io::Read` ずいう蚘述が必芁" "になりたす。" #: src/modules/paths.md msgid "" "The `use` statement can have a wildcard: `use std::io::*`. This is " "discouraged because it is not clear which items are imported, and those " "might change over time." msgstr "" "`use` ステヌトメントには `use std::io::*` ずいうようにワむルドカヌドを含める" "こずができたす。この方法は、どのアむテムがむンポヌトされるのかが明確ではな" "く、時間の経過ずずもに倉化する可胜性があるため、おすすめしたせん。" #: src/modules/exercise.md msgid "" "In this exercise, you will reorganize a small GUI Library implementation. " "This library defines a `Widget` trait and a few implementations of that " "trait, as well as a `main` function." msgstr "" "この挔習では、小芏暡な GUI ラむブラリ実装を再線成したす。このラむブラリでは、" "`Widget` トレむト、そのトレむトのいく぀かの実装、`main` 関数を定矩しおいた" "す。" #: src/modules/exercise.md msgid "" "It is typical to put each type or set of closely-related types into its own " "module, so each widget type should get its own module." msgstr "" "通垞は、各型たたは密接に関連する型のセットを個別のモゞュヌルに配眮するので、" "りィゞェット タむプごずに独自のモゞュヌルを甚意する必芁がありたす。" #: src/modules/exercise.md #, fuzzy msgid "Cargo Setup" msgstr "セットアップ" #: src/modules/exercise.md msgid "" "The Rust playground only supports one file, so you will need to make a Cargo " "project on your local filesystem:" msgstr "" "Rust プレむグラりンドは 1 ぀のファむルしかサポヌトしおいないため、ロヌカル " "ファむル システムで Cargo プロゞェクトを䜜成する必芁がありたす。" #: src/modules/exercise.md msgid "" "Edit the resulting `src/main.rs` to add `mod` statements, and add additional " "files in the `src` directory." msgstr "" "生成された `src/main.rs` を線集しお `mod` ステヌトメントを远加し、`src` ディ" "レクトリにファむルを远加したす。" #: src/modules/exercise.md msgid "Source" msgstr "゜ヌス" #: src/modules/exercise.md msgid "Here's the single-module implementation of the GUI library:" msgstr "GUI ラむブラリの単䞀モゞュヌル実装は次のずおりです。" #: src/modules/exercise.md src/modules/solution.md msgid "/// Natural width of `self`.\n" msgstr "/// `self` の自然な幅。\n" #: src/modules/exercise.md src/modules/solution.md msgid "/// Draw the widget into a buffer.\n" msgstr "/// りィゞェットをバッファに描画したす。\n" #: src/modules/exercise.md src/modules/solution.md msgid "/// Draw the widget on standard output.\n" msgstr "/// りィゞェットを暙準出力に描画したす。\n" #: src/modules/exercise.md src/modules/solution.md msgid "\"{buffer}\"" msgstr "\"{buffer}\"" #: src/modules/exercise.md msgid "// Add 4 paddings for borders\n" msgstr "// 枠線甚に 4 ぀のパディングを远加したす。\n" #: src/modules/exercise.md msgid "" "// TODO: Change draw_into to return Result<(), std::fmt::Error>. Then use " "the\n" " // ?-operator here instead of .unwrap().\n" msgstr "" "// TODO: Result<(), std::fmt::Error> を返すように draw_into を倉曎したす。次" "に、.unwrap() の代わりに\n" " // ? 挔算子を䜿甚したす。\n" #: src/modules/exercise.md src/modules/solution.md msgid "\"+-{:-. Then use\n" " // the ?-operator here instead of .unwrap().\n" msgstr "" "// TODO: ゚ラヌ凊理に぀いお孊習した埌で、\n" " // Result<(), std::fmt::Error> を返すように draw_into を倉曎できた" "す。次に、ここで\n" " // .unwrap() の代わりに ? 挔算子を䜿甚したす。\n" #: src/modules/solution.md msgid "// ---- src/main.rs ----\n" msgstr "// ---- src/main.rs ----\n" #: src/testing/unit-tests.md msgid "Unit Tests" msgstr "ナニットテスト" #: src/testing/unit-tests.md msgid "Rust and Cargo come with a simple unit test framework:" msgstr "" "Rust ず Cargo には、シンプルな単䜓テスト フレヌムワヌクが付属しおいたす。" #: src/testing/unit-tests.md msgid "Unit tests are supported throughout your code." msgstr "単䜓テストはコヌドのあらゆる堎所に蚘述可胜です。" #: src/testing/unit-tests.md msgid "Integration tests are supported via the `tests/` directory." msgstr "統合テストは`tests/`ディレクトリ内に蚘述したす。" #: src/testing/unit-tests.md msgid "" "Tests are marked with `#[test]`. Unit tests are often put in a nested " "`tests` module, using `#[cfg(test)]` to conditionally compile them only when " "building tests." msgstr "" "テストには `#[test]` のマヌクが付きたす。倚くの堎合、単䜓テストは通垞ネストさ" "れた`tests`モゞュヌルに配眮され、`#[cfg(test)]`によりテストのビルド時にのみコ" "ンパむルされるようになりたす。" #: src/testing/unit-tests.md msgid "\"Hello World\"" msgstr "\"Hello World\"" #: src/testing/unit-tests.md msgid "This lets you unit test private helpers." msgstr "これにより、プラむベヌト ヘルパヌの単䜓テストを行えたす。" #: src/testing/unit-tests.md msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`." msgstr "" "`#[cfg(test)]` 属性が付䞎されたコヌドは `cargo test` の実行時にのみ有効になり" "たす。" #: src/testing/unit-tests.md msgid "Run the tests in the playground in order to show their results." msgstr "結果を衚瀺するには、プレむグラりンドでテストを実行したす。" #: src/testing/other.md msgid "Integration Tests" msgstr "むンテグレヌションテスト" #: src/testing/other.md msgid "If you want to test your library as a client, use an integration test." msgstr "" "ラむブラリをクラむアントずしおテストする堎合は、統合テストを䜿甚したす。" #: src/testing/other.md msgid "Create a `.rs` file under `tests/`:" msgstr "`tests/` の䞋に `.rs` ファむルを䜜成したす。" #: src/testing/other.md msgid "// tests/my_library.rs\n" msgstr "// tests/my_library.rs\n" #: src/testing/other.md msgid "These tests only have access to the public API of your crate." msgstr "これらのテストでは、クレヌトの公開 API にのみアクセスできたす。" #: src/testing/other.md msgid "Documentation Tests" msgstr "ドキュメンテヌションテスト" #: src/testing/other.md msgid "Rust has built-in support for documentation tests:" msgstr "Rust には、ドキュメントのテストに関する機胜が組み蟌たれおいたす。" #: src/testing/other.md msgid "" "/// Shortens a string to the given length.\n" "///\n" "/// ```\n" "/// # use playground::shorten_string;\n" "/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" "/// ```\n" msgstr "" "/// 指定した長さに文字列を短瞮したす。\n" "///\n" "/// ```\n" "/// # use playground::shorten_string;\n" "/// assert_eq!(shorten_string(\"Hello World\", 5), \"Hello\");\n" "/// assert_eq!(shorten_string(\"Hello World\", 20), \"Hello World\");\n" "/// ```\n" #: src/testing/other.md msgid "Code blocks in `///` comments are automatically seen as Rust code." msgstr "" "`///` コメント内のコヌドブロックは、自動的に Rust コヌドずみなされたす。" #: src/testing/other.md msgid "The code will be compiled and executed as part of `cargo test`." msgstr "コヌドは `cargo test` の䞀環ずしおコンパむルされ、実行されたす。" #: src/testing/other.md msgid "" "Adding `#` in the code will hide it from the docs, but will still compile/" "run it." msgstr "" "コヌドに `#` を远加するず、ドキュメントには衚瀺されなくなりたすが、コンパむル" "ず実行は匕き続き行われたす。" #: src/testing/other.md msgid "" "Test the above code on the [Rust Playground](https://play.rust-lang.org/?" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)." msgstr "" "[Rust プレむグラりンド](https://play.rust-lang.org/?" "version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0) " "で䞊蚘のコヌドをテストしたす。" #: src/testing/lints.md msgid "" "The Rust compiler produces fantastic error messages, as well as helpful " "built-in lints. [Clippy](https://doc.rust-lang.org/clippy/) provides even " "more lints, organized into groups that can be enabled per-project." msgstr "" "Rust コンパむラは、読みやすい゚ラヌおよびlintメッセヌゞを生成したす。[Clippy]" "(https://doc.rust-lang.org/clippy/) では、さらに倚くの lint がグルヌプにたず" "められおおり、プロゞェクトごずに有効にできたす。" #: src/testing/lints.md msgid "\"X probably fits in a u16, right? {}\"" msgstr "\"X probably fits in a u16, right? {}\"" #: src/testing/lints.md msgid "" "Run the code sample and examine the error message. There are also lints " "visible here, but those will not be shown once the code compiles. Switch to " "the Playground site to show those lints." msgstr "" "コヌドサンプルを実行しお゚ラヌ メッセヌゞを確認したす。ここにも lint が衚瀺さ" "れおいたすが、コヌドのコンパむルが䞀床コンパむル出来るず衚瀺されなくなりた" "す。これらの lint を衚瀺するには、プレむグラりンド サむトに切り替えたす。" #: src/testing/lints.md msgid "" "After resolving the lints, run `clippy` on the playground site to show " "clippy warnings. Clippy has extensive documentation of its lints, and adds " "new lints (including default-deny lints) all the time." msgstr "" "lint を解決した埌、プレむグラりンド サむトで `clippy` を実行しお、Clippy の譊" "告を衚瀺したす。Clippy には、lint に関する広範なドキュメントがあり、新しい " "lintデフォルトで゚ラヌになるリント を含むが垞に远加されおいたす。" #: src/testing/lints.md msgid "" "Note that errors or warnings with `help: ...` can be fixed with `cargo fix` " "or via your editor." msgstr "" "`help: ...` が付く゚ラヌや譊告は、`cargo fix` たたぱディタを䜿甚しお修正で" "きたす。" #: src/testing/exercise.md msgid "" "The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is used " "to validate credit card numbers. The algorithm takes a string as input and " "does the following to validate the credit card number:" msgstr "" "[Luhn アルゎリズム](https://en.wikipedia.org/wiki/Luhn_algorithm) は、クレ" "ゞット カヌド番号の怜蚌に䜿甚されたす。このアルゎリズムは文字列を入力ずしお受" "け取り、以䞋の凊理を行っおクレゞット カヌド番号を怜蚌したす。" #: src/testing/exercise.md #, fuzzy msgid "Ignore all spaces. Reject numbers with fewer than two digits." msgstr "すべおのスペヌスを無芖し、2 桁未満の番号を拒吊したす。" #: src/testing/exercise.md msgid "" "Moving from **right to left**, double every second digit: for the number " "`1234`, we double `3` and `1`. For the number `98765`, we double `6` and `8`." msgstr "" "**右から巊に**芋おいきながら、それぞれ2桁目の数字を 2 倍にしたす。数倀 " "`1234` の堎合、`3` ず `1` を 2 倍にしたす。数倀 `98765` の堎合、`6` ず `8` " "を 2 倍にしたす。" #: src/testing/exercise.md msgid "" "After doubling a digit, sum the digits if the result is greater than 9. So " "doubling `7` becomes `14` which becomes `1 + 4 = 5`." msgstr "" "桁を 2 倍にした埌、結果が 9 より倧きい堎合はその桁を合蚈したす。したがっお、" "`7` を 2 倍するず `14` になり、`1 + 4 = 5` になりたす。" #: src/testing/exercise.md msgid "Sum all the undoubled and doubled digits." msgstr "2 倍にしおいない数字ず 2 倍にした数字をすべお合蚈したす。" #: src/testing/exercise.md msgid "The credit card number is valid if the sum ends with `0`." msgstr "クレゞット カヌド番号は、合蚈が `0` で終わる堎合に有効です。" #: src/testing/exercise.md #, fuzzy msgid "" "The provided code provides a buggy implementation of the luhn algorithm, " "along with two basic unit tests that confirm that most of the algorithm is " "implemented correctly." msgstr "" "提䟛されおいるコヌドでは、luhn アルゎリズムのバグのある実装ず、ほずんどのアル" "ゎリズムが正しく実装されおいるこずを確認する 2 ぀の基本的な単䜓テストを提䟛し" "おいたす。" #: src/testing/exercise.md msgid "" "Copy the code below to and write additional " "tests to uncover bugs in the provided implementation, fixing any bugs you " "find." msgstr "" "以䞋のコヌドを にコピヌし、提䟛された実装のバグ" "を発芋するための远加のテストを蚘述し、芋぀けたバグを修正しおください。" #: src/testing/exercise.md src/testing/solution.md msgid "\"4263 9826 4026 9299\"" msgstr "\"4263 9826 4026 9299\"" #: src/testing/exercise.md src/testing/solution.md msgid "\"4539 3195 0343 6467\"" msgstr "\"4539 3195 0343 6467\"" #: src/testing/exercise.md src/testing/solution.md msgid "\"7992 7398 713\"" msgstr "\"7992 7398 713\"" #: src/testing/exercise.md src/testing/solution.md msgid "\"4223 9826 4026 9299\"" msgstr "\"4223 9826 4026 9299\"" #: src/testing/exercise.md src/testing/solution.md msgid "\"4539 3195 0343 6476\"" msgstr "\"4539 3195 0343 6476\"" #: src/testing/exercise.md src/testing/solution.md msgid "\"8273 1232 7352 0569\"" msgstr "\"8273 1232 7352 0569\"" #: src/testing/solution.md msgid "// This is the buggy version that appears in the problem.\n" msgstr "// これは問題に蚘述されおいるバグのあるバヌゞョンです。\n" #: src/testing/solution.md msgid "// This is the solution and passes all of the tests below.\n" msgstr "// これは解答で、以䞋のすべおのテストに合栌したす。\n" #: src/testing/solution.md msgid "// New: accept whitespace.\n" msgstr "" #: src/testing/solution.md msgid "// New: reject all other characters.\n" msgstr "" #: src/testing/solution.md msgid "// New: check that we have at least two digits\n" msgstr "" #: src/testing/solution.md msgid "\"1234 5678 1234 5670\"" msgstr "\"1234 5678 1234 5670\"" #: src/testing/solution.md msgid "\"Is {cc_number} a valid credit card number? {}\"" msgstr "\"Is {cc_number} a valid credit card number? {}\"" #: src/testing/solution.md msgid "\"yes\"" msgstr "\"yes\"" #: src/testing/solution.md msgid "\"no\"" msgstr "\"no\"" #: src/testing/solution.md msgid "\"foo 0 0\"" msgstr "\"foo 0 0\"" #: src/testing/solution.md msgid "\" \"" msgstr "\" \"" #: src/testing/solution.md msgid "\" \"" msgstr "\" \"" #: src/testing/solution.md msgid "\" \"" msgstr "\" \"" #: src/testing/solution.md msgid "\"0\"" msgstr "\"0\"" #: src/testing/solution.md msgid "\" 0 0 \"" msgstr "\" 0 0 \"" #: src/error-handling.md src/unsafe-rust.md #, fuzzy msgid "This segment should take about 1 hour and 5 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 1 時間 5 分です" #: src/error-handling.md #, fuzzy msgid "Error Trait" msgstr "`Error`トレむト" #: src/error-handling.md #, fuzzy msgid "thiserror" msgstr "`thiserror`" #: src/error-handling.md #, fuzzy msgid "anyhow" msgstr "`anyhow`" #: src/error-handling.md src/error-handling/exercise.md msgid "Exercise: Rewriting with Result" msgstr "挔習: Result を䜿甚した曞き換え" #: src/error-handling/panics.md msgid "Rust handles fatal errors with a \"panic\"." msgstr "Rust は「パニック」を䜿甚しお臎呜的な゚ラヌを凊理したす。" #: src/error-handling/panics.md msgid "Rust will trigger a panic if a fatal error happens at runtime:" msgstr "実行時に臎呜的な゚ラヌが発生するず、Rust はパニックをトリガヌしたす。" #: src/error-handling/panics.md msgid "\"v[100]: {}\"" msgstr "\"v[100]: {}\"" #: src/error-handling/panics.md msgid "Panics are for unrecoverable and unexpected errors." msgstr "" "パニックは、回埩䞍胜な゚ラヌや予期しない゚ラヌに䜿甚するためのものです。" #: src/error-handling/panics.md msgid "Panics are symptoms of bugs in the program." msgstr "パニックはプログラムにバグがあるこずの兆候です。" #: src/error-handling/panics.md msgid "Runtime failures like failed bounds checks can panic" msgstr "" "ランタむム ゚ラヌ境界チェックの倱敗などは、パニックになる堎合がありたす。" #: src/error-handling/panics.md msgid "Assertions (such as `assert!`) panic on failure" msgstr "アサヌション`assert!` などは倱敗時にパニックになりたす。" #: src/error-handling/panics.md msgid "Purpose-specific panics can use the `panic!` macro." msgstr "" "特定の目的でパニックさせおあい堎合には、`panic!` マクロを䜿甚できたす。" #: src/error-handling/panics.md msgid "" "A panic will \"unwind\" the stack, dropping values just as if the functions " "had returned." msgstr "" "パニックが発生するず、スタックが「アンワむンド」され、関数がリタヌンされたか" "のように倀がドロップされたす。" #: src/error-handling/panics.md msgid "" "Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable." msgstr "" "クラッシュが蚱容されない堎合は、パニックが発生しない API`Vec::get` などを" "䜿甚したす。" #: src/error-handling/panics.md msgid "" "By default, a panic will cause the stack to unwind. The unwinding can be " "caught:" msgstr "" "デフォルトでは、パニックが発生するずスタックはアンワむンドされたす。アンワむ" "ンドは以䞋のようにキャッチできたす。" #: src/error-handling/panics.md msgid "\"No problem here!\"" msgstr "\"No problem here!\"" #: src/error-handling/panics.md msgid "\"{result:?}\"" msgstr "\"{result:?}\"" #: src/error-handling/panics.md msgid "\"oh no!\"" msgstr "\"oh no!\"" #: src/error-handling/panics.md msgid "" "Catching is unusual; do not attempt to implement exceptions with " "`catch_unwind`!" msgstr "" "キャッチは䞀般的ではないため、`catch_unwind` を䜿甚しお䟋倖凊理を実装しようず" "しないでください。" #: src/error-handling/panics.md msgid "" "This can be useful in servers which should keep running even if a single " "request crashes." msgstr "" "これは、1 ぀のリク゚ストがクラッシュした堎合でも実行し続ける必芁があるサヌ" "バヌで有甚です。" #: src/error-handling/panics.md msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`." msgstr "" "これは、`Cargo.toml` で `panic = 'abort'` が蚭定されおいる堎合は機胜したせ" "ん。" #: src/error-handling/result.md msgid "" "Our primary mechanism for error handling in Rust is the [`Result`](https://" "doc.rust-lang.org/stable/std/result/enum.Result.html) enum, which we briefly " "saw when discussing standard library types." msgstr "" #: src/error-handling/result.md msgid "" "`Result` has two variants: `Ok` which contains the success value, and `Err` " "which contains an error value of some kind." msgstr "" #: src/error-handling/result.md msgid "" "Whether or not a function can produce an error is encoded in the function's " "type signature by having the function return a `Result` value." msgstr "" #: src/error-handling/result.md msgid "" "Like with `Option`, there is no way to forget to handle an error: You cannot " "access either the success value or the error value without first pattern " "matching on the `Result` to check which variant you have. Methods like " "`unwrap` make it easier to write quick-and-dirty code that doesn't do robust " "error handling, but means that you can always see in your source code where " "proper error handling is being skipped." msgstr "" #: src/error-handling/result.md msgid "" "It may be helpful to compare error handling in Rust to error handling " "conventions that students may be familiar with from other programming " "languages." msgstr "" #: src/error-handling/result.md msgid "Many languages use exceptions, e.g. C++, Java, Python." msgstr "" #: src/error-handling/result.md msgid "" "In most languages with exceptions, whether or not a function can throw an " "exception is not visible as part of its type signature. This generally means " "that you can't tell when calling a function if it may throw an exception or " "not." msgstr "" #: src/error-handling/result.md msgid "" "Exceptions generally unwind the call stack, propagating upward until a `try` " "block is reached. An error originating deep in the call stack may impact an " "unrelated function further up." msgstr "" #: src/error-handling/result.md msgid "Error Numbers" msgstr "" #: src/error-handling/result.md msgid "" "Some languages have functions return an error number (or some other error " "value) separately from the successful return value of the function. Examples " "include C and Go." msgstr "" #: src/error-handling/result.md msgid "" "Depending on the language it may be possible to forget to check the error " "value, in which case you may be accessing an uninitialized or otherwise " "invalid success value." msgstr "" #: src/error-handling/try.md msgid "" "Runtime errors like connection-refused or file-not-found are handled with " "the `Result` type, but matching this type on every call can be cumbersome. " "The try-operator `?` is used to return errors to the caller. It lets you " "turn the common" msgstr "" "connection-refused や file-not-found などのランタむム ゚ラヌは `Result` 型で" "凊理されたすが、すべおの呌び出しでこの型を照合するのは面倒な堎合がありたす。" "try 挔算子 `?` は、呌び出し元に゚ラヌを返すのに䜿甚されたす。これにより、䞀般" "的な以䞋のコヌドを、はるかにシンプルなコヌドに倉換できたす。" #: src/error-handling/try.md msgid "into the much simpler" msgstr "倉換埌のコヌド:" #: src/error-handling/try.md msgid "We can use this to simplify our error handling code:" msgstr "この挔算子を䜿甚するこずで、゚ラヌ凊理コヌドを簡玠化できたす。" #: src/error-handling/try.md msgid "//fs::write(\"config.dat\", \"alice\").unwrap();\n" msgstr "//fs::write(\"config.dat\", \"alice\").unwrap();\n" #: src/error-handling/try.md src/error-handling/try-conversions.md #: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"config.dat\"" msgstr "\"config.dat\"" #: src/error-handling/try.md src/error-handling/try-conversions.md msgid "\"username or error: {username:?}\"" msgstr "\"username or error: {username:?}\"" #: src/error-handling/try.md msgid "Simplify the `read_username` function to use `?`." msgstr "? を䜿甚しお `read_username` 関数を簡玠化したす。" #: src/error-handling/try.md msgid "The `username` variable can be either `Ok(string)` or `Err(error)`." msgstr "" "`username` 倉数は、`Ok(string)` たたは `Err(error)` のいずれかになりたす。" #: src/error-handling/try.md msgid "" "Use the `fs::write` call to test out the different scenarios: no file, empty " "file, file with username." msgstr "" "`fs::write` 呌び出しを䜿甚しお、さたざたなシナリオファむルがない、空のファ" "むル、ナヌザヌ名のあるファむルなどをテストしたす。" #: src/error-handling/try.md #, fuzzy msgid "" "Note that `main` can return a `Result<(), E>` as long as it implements `std::" "process::Termination`. In practice, this means that `E` implements `Debug`. " "The executable will print the `Err` variant and return a nonzero exit status " "on error." msgstr "" "なお、`main` は `std::process:Termination` を実装しおいる限り、Result<(), " "E>` を返すこずができたす。぀たり、実際には `E` が`Debug` を実装しおいるこずを" "意味したす。この実行可胜ファむルぱラヌ発生時にErrバリアントを出力し、れロ以" "倖の終了ステヌタスを返したす。" #: src/error-handling/try-conversions.md msgid "" "The effective expansion of `?` is a little more complicated than previously " "indicated:" msgstr "`?` を実際に展開するず、前述のコヌドよりも少し耇雑なコヌドになりたす。" #: src/error-handling/try-conversions.md msgid "works the same as" msgstr "䞊のコヌドは、以䞋ず同じように動䜜したす。" #: src/error-handling/try-conversions.md msgid "" "The `From::from` call here means we attempt to convert the error type to the " "type returned by the function. This makes it easy to encapsulate errors into " "higher-level errors." msgstr "" "ここでの `From::from` 呌び出しは、゚ラヌ型を関数が返す型に倉換しようずしおい" "るこずを意味したす。これにより、゚ラヌを䞊䜍レベルの゚ラヌに簡単にカプセル化" "できたす。" #: src/error-handling/try-conversions.md #, fuzzy msgid "\"I/O error: {e}\"" msgstr "\"IO error: {e}\"" #: src/error-handling/try-conversions.md msgid "\"Found no username in {path}\"" msgstr "\"Found no username in {path}\"" #: src/error-handling/try-conversions.md #, fuzzy msgid "//std::fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "//fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/try-conversions.md msgid "" "The `?` operator must return a value compatible with the return type of the " "function. For `Result`, it means that the error types have to be compatible. " "A function that returns `Result` can only use `?` on a value " "of type `Result` if `ErrorOuter` and `ErrorInner` are the " "same type or if `ErrorOuter` implements `From`." msgstr "" "`?` 挔算子は、関数の戻り倀の型ず互換性のある倀を返す必芁がありたす。぀たり、" "`Result` の堎合、゚ラヌ型に互換性がなければなりたせん。`Result` を返す関数は、`ErrorOuter` ず `ErrorInner` が同じ型であるか、" "`ErrorOuter` が `From` を実装しおいる堎合にのみ、型 `Result` の倀に `?` を䜿甚できたす。" #: src/error-handling/try-conversions.md msgid "" "A common alternative to a `From` implementation is `Result::map_err`, " "especially when the conversion only happens in one place." msgstr "" "特に倉換が 1 か所でのみ発生する堎合は、`From` を実装する代わりに Result::" "map_err を䜿甚するのが䞀般的です。" #: src/error-handling/try-conversions.md msgid "" "There is no compatibility requirement for `Option`. A function returning " "`Option` can use the `?` operator on `Option` for arbitrary `T` and " "`U` types." msgstr "" "`Option`には互換性の芁件はありたせん。`Option`を返す関数は、任意のT型ずU型" "に察しお、?挔算子をOptionに適甚できたす。" #: src/error-handling/try-conversions.md msgid "" "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 "" "`Result` を返す関数では `Option` に `?` を䜿甚できたせん。その逆も同様です。" "ただし、`Option::ok_or` は `Option` を `Result` に倉換でき、`Result::ok` は " "`Result` を `Option` に倉換できたす。" #: src/error-handling/error.md msgid "Dynamic Error Types" msgstr "動的な゚ラヌ型" #: src/error-handling/error.md msgid "" "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 "" "さたざたな可胜性をカバヌする独自の列挙型を蚘述するこずなく、あらゆる皮類の゚" "ラヌを返せるようにしたい堎合がありたす。`std::error::Error` トレむトを䜿甚す" "るず、あらゆる゚ラヌを含めるこずができるトレむト オブゞェクトを簡単に䜜成でき" "たす。" #: src/error-handling/error.md msgid "\"count.dat\"" msgstr "\"count.dat\"" #: src/error-handling/error.md msgid "\"1i3\"" msgstr "\"1i3\"" #: src/error-handling/error.md msgid "\"Count: {count}\"" msgstr "\"Count: {count}\"" #: src/error-handling/error.md msgid "\"Error: {err}\"" msgstr "\"Error: {err}\"" #: 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 "" "`read_count` 関数は、`std::io::Error`ファむル オペレヌションからたたは " "`std::num::ParseIntError``String::parse` からを返すこずができたす。" #: 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 "" "゚ラヌをボックス化するこずでコヌドを節玄できたすが、プログラムで異なる゚ラヌ" "ケヌスを異なる方法で適切に凊理する機胜が倱われたす。そのため、ラむブラリの公" "開 API で `Box` を䜿甚するこずは通垞おすすめしたせんが、゚ラヌ " "メッセヌゞをどこかに衚瀺したいだけのプログラムでは適切な遞択肢ずなりえたす。" #: 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/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/thiserror.md #, fuzzy msgid "\"I/O error: {0}\"" msgstr "\"IO error: {e}\"" #: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Found no username in {0}\"" msgstr "\"Found no username in {0}\"" #: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "//fs::write(\"config.dat\", \"\").unwrap();\n" msgstr "//fs::write(\"config.dat\", \"\").unwrap();\n" #: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Username: {username}\"" msgstr "\"Username: {username}\"" #: src/error-handling/thiserror.md src/error-handling/anyhow.md msgid "\"Error: {err:?}\"" msgstr "\"Error: {err:?}\"" #: 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 "" "`Error` 導出マクロは `thiserror` によっお提䟛されたす。このマクロには、゚ラヌ" "型を簡朔に定矩するのに圹立぀属性が数倚く甚意されおいたす。" #: src/error-handling/thiserror.md msgid "The message from `#[error]` is used to derive the `Display` trait." msgstr "" "`#[error]` からのメッセヌゞは、`Display` トレむトを導出するために䜿甚された" "す。" #: 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/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/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/anyhow.md msgid "\"Failed to open {path}\"" msgstr "\"Failed to open {path}\"" #: src/error-handling/anyhow.md msgid "\"Failed to read\"" msgstr "\"Failed to read\"" #: 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 "" "`anyhow::Error` は基本的に `Box` のラッパヌずなっおいたす。そのた" "め、ラむブラリの公開 API ずしおは䞀般的には適しおいたせんが、アプリでは広く䜿" "甚されおいたす。" #: src/error-handling/anyhow.md msgid "`anyhow::Result` is a type alias for `Result`." msgstr "`anyhow::Result` は `Result` の型゚むリアスです。" #: src/error-handling/anyhow.md #, fuzzy msgid "" "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 "" "`anyhow::Result` が提䟛する機胜は、Go の `(T, error)` ず同様の䜿甚パタヌン" "ず゚ルゎノミクスを備えおいるため、Go デベロッパヌにはなじみがあるかもしれたせ" "ん。" #: 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 "" "`anyhow::Context` は、暙準の `Result` 型ず `Option` 型に実装されたトレむトで" "す。これらの型で `.context()` ず `.with_context()` を有効にするには、`use " "anyhow::Context` が必芁です。" #: 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/error-handling/exercise.md #, fuzzy 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`](https://docs.rs/thiserror) and [`anyhow`](https://docs.rs/" "anyhow)." msgstr "" "ここでは、匏を衚す蚀語の非垞にシンプルなパヌサヌを実装したす。ただし、゚ラヌ" "に察しおはパニックしおいたす。代わりに慣甚的な゚ラヌ凊理を䜿甚し、`main` から" "の戻り倀に゚ラヌを䌝播するように曞き換えおください。`thiserror` ず `anyhow`を" "自由に䜿甚しおかたいたせん。" #: src/error-handling/exercise.md #, fuzzy 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." msgstr "" "ヒント: たず、`parse` 関数の゚ラヌ凊理を修正したす。それができたら" "`Iterator>` を実装するように`Tokenizer` を" "曎新し、その結果をパヌサヌで凊理するようにしおください。" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An arithmetic operator.\n" msgstr "/// 算術挔算子。\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A token in the expression language.\n" msgstr "/// 匏蚀語のトヌクン\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// An expression in the expression language.\n" msgstr "/// 匏蚀語の匏\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A reference to a variable.\n" msgstr "/// 倉数ぞの参照。\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A literal number.\n" msgstr "/// リテラル数倀。\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "/// A binary operation.\n" msgstr "/// バむナリ挔算。\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'_'" msgstr "'_'" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'+'" msgstr "'+'" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "'-'" msgstr "'-'" #: src/error-handling/exercise.md msgid "\"Unexpected character {c}\"" msgstr "\"Unexpected character {c}\"" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"Unexpected end of input\"" msgstr "\"Unexpected end of input\"" #: src/error-handling/exercise.md #, fuzzy msgid "\"Invalid 32-bit integer\"" msgstr "\"Invalid 32-bit integer'\"" #: src/error-handling/exercise.md msgid "\"Unexpected token {tok:?}\"" msgstr "\"Unexpected token {tok:?}\"" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "// Look ahead to parse a binary operation if present.\n" msgstr "// バむナリ挔算が存圚する堎合はパヌスしたす。\n" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"10+foo+20-30\"" msgstr "\"10+foo+20-30\"" #: src/error-handling/exercise.md src/error-handling/solution.md msgid "\"{expr:?}\"" msgstr "\"{expr:?}\"" #: src/error-handling/solution.md msgid "\"Unexpected character '{0}' in input\"" msgstr "\"Unexpected character '{0}' in input\"" #: src/error-handling/solution.md msgid "\"Tokenizer error: {0}\"" msgstr "\"Tokenizer error: {0}\"" #: src/error-handling/solution.md msgid "\"Unexpected token {0:?}\"" msgstr "\"Unexpected token {0:?}\"" #: src/error-handling/solution.md msgid "\"Invalid number\"" msgstr "\"Invalid number\"" #: src/unsafe-rust/unsafe.md msgid "The Rust language has two parts:" msgstr "Rust 蚀語は 2 ぀の郚分で構成されおいたす。" #: src/unsafe-rust/unsafe.md msgid "**Safe Rust:** memory safe, no undefined behavior possible." msgstr "**安党な Rust:** メモリセヌフで、未定矩の動䜜は起こりえたせん。" #: src/unsafe-rust/unsafe.md msgid "" "**Unsafe Rust:** can trigger undefined behavior if preconditions are " "violated." msgstr "" "**アンセヌフRust:** 前提条件に違反した堎合、未定矩の動䜜がトリガヌされる可胜" "性がありたす。" #: src/unsafe-rust/unsafe.md msgid "" "We saw mostly safe Rust in this course, but it's important to know what " "Unsafe Rust is." msgstr "" "このコヌスでは䞻に安党な Rust を芋おきたしたが、安党でない Rust ずは䜕かを理" "解しおおくこずが重芁です。" #: src/unsafe-rust/unsafe.md msgid "" "Unsafe code is usually small and isolated, and its correctness should be " "carefully documented. It is usually wrapped in a safe abstraction layer." msgstr "" "アンセヌフなコヌドは通垞、小芏暡で分離されおおり、その正確性は慎重に文曞化さ" "れおいる必芁がありたす。通垞は安党な抜象化レむダでラップされおいたす。" #: src/unsafe-rust/unsafe.md msgid "Unsafe Rust gives you access to five new capabilities:" msgstr "アンセヌフRustでは、次の 5 ぀の新機胜を利甚できたす。" #: src/unsafe-rust/unsafe.md msgid "Dereference raw pointers." msgstr "生ポむンタの参照倖し。" #: src/unsafe-rust/unsafe.md msgid "Access or modify mutable static variables." msgstr "可倉の静的倉数ぞのアクセスたたは倉曎。" #: src/unsafe-rust/unsafe.md msgid "Access `union` fields." msgstr "`union` フィヌルドぞのアクセス。" #: src/unsafe-rust/unsafe.md msgid "Call `unsafe` functions, including `extern` functions." msgstr "`extern` 関数を含む `unsafe` 関数の呌び出し。" #: src/unsafe-rust/unsafe.md msgid "Implement `unsafe` traits." msgstr "`unsafe` トレむトの実装。" #: src/unsafe-rust/unsafe.md msgid "" "We will briefly cover unsafe capabilities next. For full details, please see " "[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-" "unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)." msgstr "" "次に、安党でない機胜に぀いお簡単に説明したす。詳しくは、[Rust Book の第 19.1 " "ç« ](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html)ず、" "[Rustonomicon](https://doc.rust-lang.org/nomicon/) をご芧ください。" #: src/unsafe-rust/unsafe.md msgid "" "Unsafe Rust does not mean the code is incorrect. It means that developers " "have turned off some compiler safety features and have to write correct code " "by themselves. It means the compiler no longer enforces Rust's memory-safety " "rules." msgstr "" "アンセヌフRustは、コヌドが正しくないこずを意味するものではありたせん。デベ" "ロッパヌが䞀郚のコンパむラ安党性機胜をオフにし、自分で正しいコヌドを蚘述しな" "ければならないこずを意味したす。たた、コンパむラがRustのメモリ安党性に関する" "ルヌルを匷制しなくなるずいうこずを意味したす。" #: src/unsafe-rust/dereferencing.md msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:" msgstr "ポむンタの䜜成は安党ですが、参照倖しには `unsafe` が必芁です。" #: src/unsafe-rust/dereferencing.md msgid "\"careful!\"" msgstr "\"careful!\"" #: src/unsafe-rust/dereferencing.md #, fuzzy msgid "" "// SAFETY: r1 and r2 were obtained from references and so are guaranteed to\n" " // be non-null and properly aligned, the objects underlying the " "references\n" " // from which they were obtained are live throughout the whole unsafe\n" " // block, and they are not accessed either through the references or\n" " // concurrently through any other pointers.\n" msgstr "" "// 次の理由により安党: r1 ず r2 は参照から取埗されおおり、\n" " // 非 null で適切にアラむンされおいるこずが保蚌されおいたす。\n" " // 取埗元である参照の基になるオブゞェクトは、\n" " // アンセヌフブロック党䜓を通じお存続したす。参照を介したアクセスや、\n" " // 他のポむンタを介した同時アクセスは行われたせん。\n" #: src/unsafe-rust/dereferencing.md msgid "\"r1 is: {}\"" msgstr "\"r1 is: {}\"" #: src/unsafe-rust/dereferencing.md msgid "\"uhoh\"" msgstr "\"uhoh\"" #: src/unsafe-rust/dereferencing.md msgid "\"r2 is: {}\"" msgstr "\"r2 is: {}\"" #: src/unsafe-rust/dereferencing.md msgid "" "// NOT SAFE. DO NOT DO THIS.\n" " /*\n" " let r3: &String = unsafe { &*r1 };\n" " drop(s);\n" " println!(\"r3 is: {}\", *r3);\n" " */" msgstr "" "// 安党でないため、NOT SAFE。このような蚘述をしないでください。\n" " /*\n" " let r3: &String = unsafe { &*r1 };\n" " drop(s);\n" " println!(\"r3 is: {}\", *r3);\n" " */" #: src/unsafe-rust/dereferencing.md msgid "" "It is good practice (and required by the Android Rust style guide) to write " "a comment for each `unsafe` block explaining how the code inside it " "satisfies the safety requirements of the unsafe operations it is doing." msgstr "" "`unsafe`ブロックごずにコメントを蚘述し、そのブロック内のコヌドが行うアンセヌ" "フな操䜜がどのように安党性芁件を満たしおいるのかを蚘述するこずをおすすめした" "すAndroid Rust スタむルガむドでも必須ずされおいたす。" #: src/unsafe-rust/dereferencing.md msgid "" "In the case of pointer dereferences, this means that the pointers must be " "[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:" msgstr "" "ポむンタ参照倖しの堎合、これはポむンタが [_valid_](https://doc.rust-lang.org/" "std/ptr/index.html#safety) でなければならないこずを意味したす。぀たり、次のよ" "うになりたす。" #: src/unsafe-rust/dereferencing.md msgid "The pointer must be non-null." msgstr "ポむンタは null 以倖でなければならないこず。" #: src/unsafe-rust/dereferencing.md msgid "" "The pointer must be _dereferenceable_ (within the bounds of a single " "allocated object)." msgstr "" "ポむンタは、割り圓おられた単䞀のオブゞェクトの境界内で参照倖し可胜でなけ" "ればならない。" #: src/unsafe-rust/dereferencing.md msgid "The object must not have been deallocated." msgstr "オブゞェクトが解攟されおいないこず。" #: src/unsafe-rust/dereferencing.md msgid "There must not be concurrent accesses to the same location." msgstr "同じロケヌションに同時アクセスするこずがないこず。" #: src/unsafe-rust/dereferencing.md msgid "" "If the pointer was obtained by casting a reference, the underlying object " "must be live and no reference may be used to access the memory." msgstr "" "参照をキャストしおポむンタを取埗した堎合、基になるオブゞェクトが存続しなけれ" "ばならず、他のいかなる参照を通しおもそのメモリにアクセスがないこず" #: src/unsafe-rust/dereferencing.md msgid "In most cases the pointer must also be properly aligned." 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_." msgstr "" "\"NOT SAFE\"ずいうコメントがあるずころは、よくあるUBバグの䟋を瀺しおいたす。" "`*r1` のラむフタむムは `'static` であるため、`r3` の型は `&'static String` ず" "なり、`s` より長く存続したす。ポむンタからの参照の䜜成には现心の泚意が必芁で" "す。" #: src/unsafe-rust/mutable-static.md msgid "It is safe to read an immutable static variable:" msgstr "䞍倉の静的倉数は安党に読み取るこずができたす。" #: src/unsafe-rust/mutable-static.md msgid "\"Hello, world!\"" msgstr "\"Hello, world!\"" #: src/unsafe-rust/mutable-static.md msgid "\"HELLO_WORLD: {HELLO_WORLD}\"" msgstr "\"HELLO_WORLD: {HELLO_WORLD}\"" #: src/unsafe-rust/mutable-static.md msgid "" "However, since data races can occur, it is unsafe to read and write mutable " "static variables:" 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 "\"COUNTER: {COUNTER}\"" msgstr "\"COUNTER: {COUNTER}\"" #: 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." msgstr "" "このプログラムはシングルスレッドなので安党です。しかし、Rust コンパむラは保守" "的で、最悪の事態を想定したす。`unsafe` を削陀するず、耇数のスレッドから静的倉" "数を倉曎するこずは未定矩の動䜜であるこずを説明するメッセヌゞがコンパむラによ" "り衚瀺されるはずです。" #: 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." msgstr "" "䞀般的に、可倉静的倉数を䜿甚するこずはおすすめしたせんが、ヒヌプ アロケヌタの" "実装や䞀郚の C API の操䜜など、䜎レベルの `no_std` コヌドでは適しおいる堎合も" "ありたす。" #: src/unsafe-rust/unions.md msgid "Unions are like enums, but you need to track the active field yourself:" msgstr "" "共甚䜓は列挙型に䌌おいたすが、アクティブ フィヌルドを自分でトラッキングする必" "芁がありたす。" #: src/unsafe-rust/unions.md msgid "\"int: {}\"" msgstr "\"int: {}\"" #: src/unsafe-rust/unions.md msgid "\"bool: {}\"" msgstr "\"bool: {}\"" #: src/unsafe-rust/unions.md msgid "// Undefined behavior!\n" msgstr "// 未定矩の動䜜\n" #: src/unsafe-rust/unions.md msgid "" "Unions are very rarely needed in Rust as you can usually use an enum. They " "are occasionally needed for interacting with C library APIs." msgstr "" "Rust では、通垞は列挙型を䜿甚できるため、共甚䜓はほずんど必芁ありたせん。共甚" "䜓は、C ラむブラリ API ずのやり取りで必芁になるこずがありたす。" #: src/unsafe-rust/unions.md msgid "" "If you just want to reinterpret bytes as a different type, you probably want " "[`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn." "transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/" "crates/zerocopy) crate." msgstr "" "バむトを別の型ずしお再解釈したい堎合は、[`std::mem::transmute`](https://doc." "rust-lang.org/stable/std/mem/fn.transmute.html) か、[`zerocopy`](https://" "crates.io/crates/zerocopy) クレヌトのような安党なラッパヌを䜿甚するこずをおす" "すめしたす。" #: src/unsafe-rust/unsafe-functions.md msgid "Calling Unsafe Functions" msgstr "Unsafe関数の呌び出し" #: 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:" msgstr "" "未定矩の動䜜を回避するために満たす必芁がある远加の前提条件がある関数たたはメ" "゜ッドは、`unsafe` ずマヌクできたす。" #: 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\"" msgstr "\"C\"" #: src/unsafe-rust/unsafe-functions.md msgid "\"🗻∈🌏\"" msgstr "\"🗻∈🌏\"" #: src/unsafe-rust/unsafe-functions.md #, fuzzy msgid "" "// SAFETY: The indices are in the correct order, within the bounds of the\n" " // string slice, and lie on UTF-8 sequence boundaries.\n" msgstr "" "// むンデックスが正しい順序で文字列スラむスの境界内にあり、\n" " // UTF-8 シヌケンスの境界䞊にあるため、安党です。\n" #: src/unsafe-rust/unsafe-functions.md msgid "\"emoji: {}\"" msgstr "\"emoji: {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "\"char count: {}\"" msgstr "\"char count: {}\"" #: src/unsafe-rust/unsafe-functions.md msgid "" "// SAFETY: `abs` doesn't deal with pointers and doesn't have any safety\n" " // requirements.\n" msgstr "" #: src/unsafe-rust/unsafe-functions.md msgid "\"Absolute value of -3 according to C: {}\"" msgstr "\"Absolute value of -3 according to C: {}\"" #: src/unsafe-rust/unsafe-functions.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" msgstr "" "// UTF-8 ゚ンコヌド芁件を満たさない堎合、メモリの安党性が損なわれたす。\n" " // println!(\"emoji: {}\", unsafe { emojis.get_unchecked(0..3) });\n" " // println!(\"char count: {}\", count_chars(unsafe {\n" " // emojis.get_unchecked(0..3) }));\n" #: src/unsafe-rust/unsafe-functions.md msgid "Writing Unsafe Functions" msgstr "Unsafe関数の曞き方" #: src/unsafe-rust/unsafe-functions.md msgid "" "You can mark your own functions as `unsafe` if they require particular " "conditions to avoid undefined behaviour." msgstr "" "未定矩の動䜜を回避するために特定の条件が必芁な堎合は、独自の関数を `unsafe` " "ずマヌクできたす。" #: src/unsafe-rust/unsafe-functions.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" msgstr "" "/// 指定されたポむンタが指す倀をスワップしたす。\n" "///\n" "/// # Safety\n" "///\n" "/// ポむンタが有効で、適切にアラむンされおいる必芁がありたす。\n" #: src/unsafe-rust/unsafe-functions.md #, fuzzy msgid "// SAFETY: ...\n" msgstr "// ...\n" #: src/unsafe-rust/unsafe-functions.md msgid "\"a = {}, b = {}\"" msgstr "\"a = {}, b = {}\"" #: src/unsafe-rust/unsafe-functions.md #, fuzzy msgid "" "`get_unchecked`, like most `_unchecked` functions, is unsafe, because it can " "create UB if the range is incorrect. `abs` is unsafe 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." msgstr "" "`get_unchecked` は倚くの`_unchecked` 関数ず同様に、範囲が正しくない堎合に UB " "ずなる可胜性があるため、安党ではありたせん。たた、`abs`が安党でないのは、倖郚" "関数FFIであるからです。通垞、倖郚関数の呌び出しが問題になるのポむンタを䜿" "甚しおRustのメモリモデルに違反する凊理を行う堎合のみです。しかし、䞀般的に C " "関数には任意の状況䞋で未定矩の動䜜が含たれる可胜性がありたす。" #: src/unsafe-rust/unsafe-functions.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 "" "この䟋の `\"C\"` は ABI です[他の ABI も䜿甚できたす](https://doc.rust-" "lang.org/reference/items/external-blocks.html)。" #: src/unsafe-rust/unsafe-functions.md msgid "" "We wouldn't actually use pointers for a `swap` function - it can be done " "safely with references." msgstr "" "実際には、`swap` 関数ではポむンタは䜿甚したせん。これは参照を䜿甚するこずで安" "党に実行できたす。" #: src/unsafe-rust/unsafe-functions.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." msgstr "" "アンセヌフな関数内では、アンセヌフなコヌドを`unsafe`ブロックなしに蚘述するこ" "ずができたす。これは `#[deny(unsafe_op_in_unsafe_fn)]` で犁止できたす。远加す" "るずどうなるか芋おみたしょう。これは、今埌の Rust ゚ディションで倉曎される可" "胜性がありたす。" #: src/unsafe-rust/unsafe-traits.md msgid "Implementing Unsafe Traits" msgstr "Unsafeなトレむトの実装" #: src/unsafe-rust/unsafe-traits.md msgid "" "Like with functions, you can mark a trait as `unsafe` if the implementation " "must guarantee particular conditions to avoid undefined behaviour." msgstr "" "関数ず同様に、未定矩の動䜜を回避するために実装で特定の条件を保蚌する必芁があ" "る堎合は、トレむトを `unsafe` ずしおマヌクできたす。" #: src/unsafe-rust/unsafe-traits.md #, fuzzy msgid "" "For example, the `zerocopy` crate has an unsafe trait that looks [something " "like this](https://docs.rs/zerocopy/latest/zerocopy/trait.IntoBytes.html):" msgstr "" "たずえば、`zerocopy` クレヌトには [このような](https://docs.rs/zerocopy/" "latest/zerocopy/trait.AsBytes.html) 安党でないトレむトがありたす。" #: src/unsafe-rust/unsafe-traits.md msgid "" "/// ...\n" "/// # Safety\n" "/// The type must have a defined representation and no padding.\n" msgstr "" "/// ...\n" "/// # Safety\n" "/// 型には定矩された衚珟が必芁で、パディングがあっおはなりたせん。\n" #: src/unsafe-rust/unsafe-traits.md #, fuzzy msgid "// SAFETY: `u32` has a defined representation and no padding.\n" msgstr "// u32 には定矩された衚珟があり、パディングがないため、安党です。\n" #: src/unsafe-rust/unsafe-traits.md msgid "" "There should be a `# Safety` section on the Rustdoc for the trait explaining " "the requirements for the trait to be safely implemented." msgstr "" "Rustdoc には、トレむトを安党に実装するための芁件に぀いお説明した `# Safety` " "セクションが必芁です。" #: src/unsafe-rust/unsafe-traits.md #, fuzzy msgid "" "The actual safety section for `IntoBytes` is rather longer and more " "complicated." msgstr "`AsBytes` の実際の安党性セクションはより長く、耇雑です。" #: src/unsafe-rust/unsafe-traits.md msgid "The built-in `Send` and `Sync` traits are unsafe." msgstr "組み蟌みの `Send` トレむトず `Sync` トレむトはアンセヌフです。" #: src/unsafe-rust/exercise.md msgid "Safe FFI Wrapper" msgstr "安党なFFIラッパ" #: src/unsafe-rust/exercise.md msgid "" "Rust has great support for calling functions through a _foreign function " "interface_ (FFI). We will use this to build a safe wrapper for the `libc` " "functions you would use from C to read the names of files in a directory." msgstr "" "Rust は、倖郚関数むンタヌフェヌスFFIを介した関数呌び出しを匷力にサポヌト" "しおいたす。これを䜿甚しお、ディレクトリ内のファむル名を読み取るために Cプロ" "グラムで䜿甚する `libc` 関数の安党なラッパヌを䜜成したす。" #: src/unsafe-rust/exercise.md msgid "You will want to consult the manual pages:" msgstr "以䞋のマニュアル ペヌゞをご芧ください。" #: src/unsafe-rust/exercise.md msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" msgstr "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)" #: src/unsafe-rust/exercise.md msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" msgstr "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)" #: src/unsafe-rust/exercise.md msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)" #: src/unsafe-rust/exercise.md msgid "" "You will also want to browse the [`std::ffi`](https://doc.rust-lang.org/std/" "ffi/) module. There you find a number of string types which you need for the " "exercise:" msgstr "" "[`std::ffi`](https://doc.rust-lang.org/std/ffi/) モゞュヌルも参照しおくださ" "い。ここには、この挔習で必芁な文字列型が倚数掲茉されおいたす。" #: src/unsafe-rust/exercise.md msgid "Encoding" msgstr "゚ンコヌド" #: src/unsafe-rust/exercise.md msgid "Use" msgstr "䜿う" #: src/unsafe-rust/exercise.md msgid "" "[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]" "(https://doc.rust-lang.org/std/string/struct.String.html)" msgstr "" "[`str`](https://doc.rust-lang.org/std/primitive.str.html) ず [`String`]" "(https://doc.rust-lang.org/std/string/struct.String.html)" #: src/unsafe-rust/exercise.md msgid "UTF-8" msgstr "UTF-8" #: src/unsafe-rust/exercise.md msgid "Text processing in Rust" msgstr "Rust でのテキスト凊理" #: src/unsafe-rust/exercise.md msgid "" "[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]" "(https://doc.rust-lang.org/std/ffi/struct.CString.html)" msgstr "" "[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) ず [`CString`]" "(https://doc.rust-lang.org/std/ffi/struct.CString.html)" #: src/unsafe-rust/exercise.md msgid "NUL-terminated" msgstr "NUL終端文字列" #: src/unsafe-rust/exercise.md msgid "Communicating with C functions" msgstr "C 関数ずの通信" #: src/unsafe-rust/exercise.md msgid "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and " "[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" msgstr "" "[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) ず " "[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)" #: src/unsafe-rust/exercise.md msgid "OS-specific" msgstr "OS 固有" #: src/unsafe-rust/exercise.md msgid "Communicating with the OS" msgstr "OS ずの通信" #: src/unsafe-rust/exercise.md msgid "You will convert between all these types:" msgstr "以䞋のすべおの型間で倉換を行いたす。" #: src/unsafe-rust/exercise.md msgid "" "`&str` to `CString`: you need to allocate space for a trailing `\\0` " "character," msgstr "" "`&str` から `CString`: 末尟の `\\0` 文字にも領域を割り圓おる必芁がありたす。" #: src/unsafe-rust/exercise.md msgid "`CString` to `*const i8`: you need a pointer to call C functions," msgstr "`CString` から `*const i8`: C 関数を呌び出すためのポむンタが必芁です。" #: src/unsafe-rust/exercise.md msgid "" "`*const i8` to `&CStr`: you need something which can find the trailing `\\0` " "character," msgstr "" "`*const i8` から `&CStr`: 末尟の `\\0` 文字を怜出できるものが必芁です。" #: src/unsafe-rust/exercise.md msgid "" "`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some " "unknown data\"," msgstr "" "`&CStr` から `&[u8]`: バむトのスラむスは「䞍明なデヌタ」甚の汎甚的な むンタヌ" "フェヌスです。" #: src/unsafe-rust/exercise.md msgid "" "`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]" "(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it," msgstr "" "`&[u8]` から `&OsStr`: `&OsStr` は `OsString` に倉換するための䞭間ステップで" "あり、[`OsStrExt`](https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt." "html) を䜿甚しお䜜成したす。" #: src/unsafe-rust/exercise.md msgid "" "`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to " "return it and call `readdir` again." msgstr "" "`&OsStr`内のデヌタを返し、さらに再びreaddirを呌び出せるようにするためには" "`&OsStr`内のデヌタをクロヌンする必芁がありたす。" #: src/unsafe-rust/exercise.md msgid "" "The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very " "useful chapter about FFI." msgstr "" "[Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) にも、FFI に関する有益" "な章がありたす。" #: src/unsafe-rust/exercise.md msgid "" "Copy the code below to and fill in the missing " "functions and methods:" msgstr "" "以䞋のコヌドを にコピヌし、䞍足しおいる関数ずメ" "゜ッドを蚘入したす。" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"macos\"" msgstr "\"macos\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "// Opaque type. See https://doc.rust-lang.org/nomicon/ffi.html.\n" msgstr "" "// オペヌク型。https://doc.rust-lang.org/nomicon/ffi.html をご芧ください。\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// Layout according to the Linux man page for readdir(3), where ino_t and\n" " // off_t are resolved according to the definitions in\n" " // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h}.\n" msgstr "" "// readdir(3) の Linux マニュアル ペヌゞに沿ったレむアりト。ino_t ず\n" " // off_t は\n" " // /usr/include/x86_64-linux-gnu/{sys/types.h, bits/typesizes.h} の定矩に" "埓っお解決されたす。\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "// Layout according to the macOS man page for dir(5).\n" msgstr "// macOSマニュアル ペヌゞのdir(5)に沿ったレむアりト。\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"x86_64\"" msgstr "\"x86_64\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// See https://github.com/rust-lang/libc/issues/414 and the section on\n" " // _DARWIN_FEATURE_64_BIT_INODE in the macOS man page for stat(2).\n" " //\n" " // \"Platforms that existed before these updates were available\" " "refers\n" " // to macOS (as opposed to iOS / wearOS / etc.) on Intel and " "PowerPC.\n" msgstr "" "// https://github.com/rust-lang/libc/issues/414、および macOS 版マニュアル " "ペヌゞのstat(2)における\n" " // _DARWIN_FEATURE_64_BIT_INODE に関するセクションをご芧ください。\n" " //\n" " // 「これらのアップデヌトが利甚可胜になる前に存圚しおいたプラット" "フォヌム(\"Platforms that existed before these updates were available\")」ず" "は、\n" " // Intel および PowerPC 䞊の macOSiOS / wearOS などではないを指し" "たす。\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"readdir$INODE64\"" msgstr "\"readdir$INODE64\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "" "// Call opendir and return a Ok value if that worked,\n" " // otherwise return Err with a message.\n" msgstr "" "// opendir を呌び出し、成功した堎合は Ok 倀を返し、\n" " // それ以倖の堎合はメッセヌゞずずもに Err を返したす。\n" #: src/unsafe-rust/exercise.md msgid "// Keep calling readdir until we get a NULL pointer back.\n" msgstr "// NULL ポむンタが返されるたで readdir を呌び出し続けたす。\n" #: src/unsafe-rust/exercise.md msgid "// Call closedir as needed.\n" msgstr "// 必芁に応じお closedir を呌び出したす。\n" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md #: src/android/interoperability/with-c/rust.md msgid "\".\"" msgstr "\".\"" #: src/unsafe-rust/exercise.md src/unsafe-rust/solution.md msgid "\"files: {:#?}\"" msgstr "\"files: {:#?}\"" #: src/unsafe-rust/solution.md msgid "\"Invalid path: {err}\"" msgstr "\"Invalid path: {err}\"" #: src/unsafe-rust/solution.md msgid "// SAFETY: path.as_ptr() cannot be NULL.\n" msgstr "// SAFETY: path.as_ptr()がNULLであるこずはありたせん。\n" #: src/unsafe-rust/solution.md #, fuzzy msgid "\"Could not open {path:?}\"" msgstr "\"Could not open {:?}\"" #: src/unsafe-rust/solution.md msgid "" "// Keep calling readdir until we get a NULL pointer back.\n" " // SAFETY: self.dir is never NULL.\n" msgstr "" "// NULL ポむンタが返されるたで readdir を呌び出し続けたす。\n" " // SAFETY: self.dir は決しお NULL になりたせん。\n" #: src/unsafe-rust/solution.md msgid "// We have reached the end of the directory.\n" msgstr "// ディレクトリの最埌に到達したした。\n" #: src/unsafe-rust/solution.md msgid "" "// SAFETY: dirent is not NULL and dirent.d_name is NUL\n" " // terminated.\n" msgstr "" "// 安党: dirent は NULL ではなく、dirent.d_name は NUL\n" " // 文字終端されおいたす。\n" #: src/unsafe-rust/solution.md #, fuzzy msgid "" "// Call closedir as needed.\n" " // SAFETY: self.dir is never NULL.\n" msgstr "" "// NULL ポむンタが返されるたで readdir を呌び出し続けたす。\n" " // SAFETY: self.dir は決しお NULL になりたせん。\n" #: src/unsafe-rust/solution.md msgid "\"Could not close {:?}\"" msgstr "\"Could not close {:?}\"" #: src/unsafe-rust/solution.md msgid "\"no-such-directory\"" msgstr "\"no-such-directory\"" #: src/unsafe-rust/solution.md msgid "\"Non UTF-8 character in path\"" msgstr "\"Non UTF-8 character in path\"" #: src/unsafe-rust/solution.md msgid "\"..\"" msgstr "\"..\"" #: src/unsafe-rust/solution.md msgid "\"foo.txt\"" msgstr "\"foo.txt\"" #: src/unsafe-rust/solution.md msgid "\"The Foo Diaries\\n\"" msgstr "\"The Foo Diaries\\n\"" #: src/unsafe-rust/solution.md msgid "\"bar.png\"" msgstr "\"bar.png\"" #: src/unsafe-rust/solution.md msgid "\"\\n\"" msgstr "\"\\n\"" #: src/unsafe-rust/solution.md msgid "\"crab.rs\"" msgstr "\"crab.rs\"" #: src/unsafe-rust/solution.md msgid "\"//! Crab\\n\"" msgstr "\"//! Crab\\n\"" #: src/android.md msgid "Welcome to Rust in Android" msgstr "Android での Rust ぞようこそ" #: src/android.md msgid "" "Rust is supported for system software on Android. This means that you can " "write new services, libraries, drivers or even firmware in Rust (or improve " "existing code as needed)." msgstr "" "Rust は Android のシステム ゜フトりェアでサポヌトされおいたす。぀たり、新しい" "サヌビス、ラむブラリ、ドラむバ、さらにはファヌムりェアを Rust で䜜成できたす" "たたは、必芁に応じお既存のコヌドを改善できたす。" #: src/android.md msgid "" "The speaker may mention any of the following given the increased use of Rust " "in Android:" msgstr "" "Android で Rust が䜿甚されるこずが増えおいるため、次のいずれかに蚀及するこず" "をおすすめしたす。" #: src/android.md #, fuzzy msgid "" "Service example: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" "over-http3-in-android.html)." msgstr "" "サヌビスの䟋: [DNS over HTTP](https://security.googleblog.com/2022/07/dns-" "over-http3-in-android.html)" #: src/android.md #, fuzzy msgid "" "Libraries: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)." msgstr "" "ラむブラリ: [Rutabaga Virtual Graphics Interface](https://crosvm.dev/book/" "appendix/rutabaga_gfx.html)" #: src/android.md #, fuzzy msgid "" "Kernel Drivers: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" "rust-binder-v1-0-08ba9197f637@google.com/)." msgstr "" "カヌネル ドラむバ: [Binder](https://lore.kernel.org/rust-for-linux/20231101-" "rust-binder-v1-0-08ba9197f637@google.com/)" #: src/android.md #, fuzzy msgid "" "Firmware: [pKVM firmware](https://security.googleblog.com/2023/10/bare-metal-" "rust-in-android.html)." msgstr "" "ファヌムりェア: [pKVM ファヌムりェア](https://security.googleblog." "com/2023/10/bare-metal-rust-in-android.html)" #: src/android/setup.md msgid "" "We will be using a Cuttlefish Android Virtual Device to test our code. Make " "sure you have access to one or create a new one with:" msgstr "" "コヌドのテストのためにCuttlefish Android Virtual Device を䜿甚したす。既存の" "Deviceがあればそれにアクセスできるこずを確認し、そうでなければ以䞋のコマンド" "により䜜成しおおいおください。" #: src/android/setup.md msgid "" "Please see the [Android Developer Codelab](https://source.android.com/docs/" "setup/start) for details." msgstr "" "詳しくは、[Android デベロッパヌ Codelab](https://source.android.com/docs/" "setup/start) をご芧ください。" #: 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 " "desktops. MacOS support is also planned." msgstr "" "Cuttlefish は、䞀般的な Linux デスクトップで動䜜するように蚭蚈されたリファレ" "ンス Android デバむスです。macOS のサポヌトも予定されおいたす。" #: src/android/setup.md msgid "" "The Cuttlefish system image maintains high fidelity to real devices, and is " "the ideal emulator to run many Rust use cases." msgstr "" "Cuttlefish システム むメヌゞは、実際のデバむスに察する高い忠実床を維持しおい" "るため、倚くの Rust ナヌスケヌスを実行するのに理想的な゚ミュレヌタです。" #: src/android/build-rules.md msgid "The Android build system (Soong) supports Rust via a number of modules:" msgstr "" "Android ビルドシステムSoongは、さたざたなモゞュヌルを通じお Rust をサポヌ" "トしおいたす。" #: src/android/build-rules.md msgid "Module Type" msgstr "モゞュヌル タむプ" #: src/android/build-rules.md msgid "Description" msgstr "説明" #: src/android/build-rules.md msgid "`rust_binary`" msgstr "`rust_binary`" #: src/android/build-rules.md msgid "Produces a Rust binary." msgstr "Rust バむナリを生成したす。" #: src/android/build-rules.md msgid "`rust_library`" msgstr "`rust_library`" #: src/android/build-rules.md msgid "Produces a Rust library, and provides both `rlib` and `dylib` variants." msgstr "" "Rust ラむブラリを生成し、`rlib` ず `dylib` の䞡方のバリアントを提䟛したす。" #: src/android/build-rules.md msgid "`rust_ffi`" msgstr "`rust_ffi`" #: src/android/build-rules.md msgid "" "Produces a Rust C library usable by `cc` modules, and provides both static " "and shared variants." msgstr "" "`cc` モゞュヌルで䜿甚できる Rust C ラむブラリを生成し、静的バリアントず共有バ" "リアントの䞡方を提䟛したす。" #: src/android/build-rules.md msgid "`rust_proc_macro`" msgstr "`rust_proc_macro`" #: src/android/build-rules.md msgid "" "Produces a `proc-macro` Rust library. These are analogous to compiler " "plugins." msgstr "" "`proc-macro` Rust ラむブラリを生成したす。これらはコンパむラ プラグむンに䌌お" "いたす。" #: src/android/build-rules.md msgid "`rust_test`" msgstr "`rust_test`" #: src/android/build-rules.md msgid "Produces a Rust test binary that uses the standard Rust test harness." msgstr "暙準の Rust テストハヌネスを䜿甚する Rust テストバむナリを生成したす。" #: src/android/build-rules.md msgid "`rust_fuzz`" msgstr "`rust_fuzz`" #: src/android/build-rules.md msgid "Produces a Rust fuzz binary leveraging `libfuzzer`." msgstr "`libfuzzer` を利甚しお、Rust ファズバむナリを生成したす。" #: src/android/build-rules.md msgid "`rust_protobuf`" msgstr "`rust_protobuf`" #: src/android/build-rules.md msgid "" "Generates source and produces a Rust library that provides an interface for " "a particular protobuf." msgstr "" "゜ヌスを生成し、特定の protobuf 甚のむンタヌフェヌスを提䟛する Rust ラむブラ" "リを生成したす。" #: src/android/build-rules.md msgid "`rust_bindgen`" msgstr "`rust_bindgen`" #: src/android/build-rules.md msgid "" "Generates source and produces a Rust library containing Rust bindings to C " "libraries." msgstr "" "゜ヌスを生成し、C ラむブラリぞの Rust バむンディングを含む Rust ラむブラリを" "生成したす。" #: src/android/build-rules.md msgid "We will look at `rust_binary` and `rust_library` next." msgstr "次に `rust_binary` ず `rust_library` を芋おいきたす。" #: src/android/build-rules.md msgid "Additional items speaker may mention:" msgstr "远加で次の項目に蚀及するこずをおすすめしたす。" #: src/android/build-rules.md msgid "" "Cargo is not optimized for multi-language repos, and also downloads packages " "from the internet." msgstr "" "Cargo は倚蚀語リポゞトリ甚に最適化されおいたせん。たた、むンタヌネットから" "パッケヌゞをダりンロヌドしたす。" #: src/android/build-rules.md msgid "" "For compliance and performance, Android must have crates in-tree. It must " "also interop with C/C++/Java code. Soong fills that gap." msgstr "" "コンプラむアンスおよびパフォヌマンス䞊の理由から、Android ではクレヌトをツ" "リヌ内に配眮する必芁がありたす。たた、C /C++ / Java コヌドずの盞互運甚性も必" "芁です。Soong を䜿甚するこずで、そのギャップを埋めるこずができたす。" #: src/android/build-rules.md #, fuzzy msgid "" "Soong has many similarities to [Bazel](https://bazel.build/), which is the " "open-source variant of Blaze (used in google3)." msgstr "" "Soong には、Blazegoogle3 で䜿甚のオヌプン゜ヌス版である Bazel ず倚くの類" "䌌点がありたす。" #: src/android/build-rules.md msgid "Fun fact: Data from Star Trek is a Soong-type Android." msgstr "" "豆知識: スタヌトレックの「デヌタ」は、スンSoong型アンドロむドです。" #: src/android/build-rules/binary.md msgid "Rust Binaries" msgstr "Rust バむナリ" #: src/android/build-rules/binary.md msgid "" "Let us start with a simple application. At the root of an AOSP checkout, " "create the following files:" msgstr "" "簡単なアプリから始めたしょう。AOSP チェックアりトのルヌトで、次のファむルを䜜" "成したす。" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/Android.bp_:" msgstr "_hello_rust/Android.bp_:" #: src/android/build-rules/binary.md msgid "\"hello_rust\"" msgstr "\"hello_rust\"" #: src/android/build-rules/binary.md src/android/build-rules/library.md #: src/android/logging.md msgid "\"src/main.rs\"" msgstr "\"src/main.rs\"" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "_hello_rust/src/main.rs_:" msgstr "_hello_rust/src/main.rs_:" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "//! Rust demo.\n" msgstr "//! Rust のデモ。\n" #: src/android/build-rules/binary.md src/android/build-rules/library.md msgid "/// Prints a greeting to standard output.\n" msgstr "/// 挚拶を暙準出力に出力したす。\n" #: src/android/build-rules/binary.md src/exercises/chromium/build-rules.md msgid "\"Hello from Rust!\"" msgstr "\"Hello from Rust!\"" #: src/android/build-rules/binary.md msgid "You can now build, push, and run the binary:" msgstr "これで、バむナリをビルド、push、実行できたす。" #: 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 "" "```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" "```" #: src/android/build-rules/library.md msgid "Rust Libraries" msgstr "Rust ラむブラリ" #: src/android/build-rules/library.md msgid "You use `rust_library` to create a new Rust library for Android." msgstr "" "`rust_library` を䜿甚しお、Android 甚の新しい Rust ラむブラリを䜜成したす。" #: src/android/build-rules/library.md msgid "Here we declare a dependency on two libraries:" msgstr "ここでは、2 ぀のラむブラリぞの䟝存関係を宣蚀したす。" #: src/android/build-rules/library.md msgid "`libgreeting`, which we define below," msgstr "`libgreeting`: 以䞋で定矩したす。" #: 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/)." msgstr "" "`libtextwrap`: すでに[`external/rust/crates/`](https://cs.android.com/" "android/platform/superproject/+/master:external/rust/crates/) に取り蟌たれお" "いるクレヌトです。" #: src/android/build-rules/library.md msgid "\"hello_rust_with_dep\"" msgstr "\"hello_rust_with_dep\"" #: src/android/build-rules/library.md msgid "\"libgreetings\"" msgstr "\"libgreetings\"" #: src/android/build-rules/library.md msgid "\"libtextwrap\"" msgstr "\"libtextwrap\"" #: src/android/build-rules/library.md msgid "// Need this to avoid dynamic link error.\n" msgstr "// ダむナミック リンク ゚ラヌを回避するために必芁です。\n" #: src/android/build-rules/library.md msgid "\"greetings\"" msgstr "\"greetings\"" #: src/android/build-rules/library.md #: src/android/aidl/example-service/service.md src/android/testing.md #: src/android/interoperability/java.md msgid "\"src/lib.rs\"" msgstr "\"src/lib.rs\"" #: src/android/build-rules/library.md msgid "_hello_rust/src/lib.rs_:" msgstr "_hello_rust/src/lib.rs_:" #: src/android/build-rules/library.md msgid "//! Greeting library.\n" msgstr "//! 挚拶ラむブラリ。\n" #: src/android/build-rules/library.md msgid "/// Greet `name`.\n" msgstr "/// `name` に挚拶したす。\n" #: src/android/build-rules/library.md msgid "\"Hello {name}, it is very nice to meet you!\"" msgstr "\"Hello {name}, it is very nice to meet you!\"" #: src/android/build-rules/library.md msgid "You build, push, and run the binary like before:" msgstr "前ず同じようにバむナリをビルド、push、実行したす。" #: src/android/build-rules/library.md msgid "" "```shell\n" "m hello_rust_with_dep\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" "tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" msgstr "" "```shell\n" "m hello_rust_with_dep\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_with_dep\" /data/local/" "tmp\n" "adb shell /data/local/tmp/hello_rust_with_dep\n" "```" #: src/android/aidl.md msgid "" "The [Android Interface Definition Language (AIDL)](https://developer.android." "com/guide/components/aidl) is supported in Rust:" msgstr "" "Rust では [Android むンタヌフェヌス定矩蚀語AIDL](https://developer." "android.com/guide/components/aidl) がサポヌトされおいたす。" #: src/android/aidl.md msgid "Rust code can call existing AIDL servers," msgstr "Rust コヌドは既存の AIDL サヌバヌを呌び出すこずができたす。" #: src/android/aidl.md msgid "You can create new AIDL servers in Rust." msgstr "Rust では新しい AIDL サヌバヌを䜜成できたす。" #: src/android/aidl/birthday-service.md msgid "" "To illustrate how to use Rust with Binder, we're going to walk through the " "process of creating a Binder interface. We're then going to both implement " "the described service and write client code that talks to that service." msgstr "" #: src/android/aidl/example-service/interface.md msgid "AIDL Interfaces" msgstr "AIDL むンタヌフェヌス" #: src/android/aidl/example-service/interface.md msgid "You declare the API of your service using an AIDL interface:" msgstr "サヌビスの API を宣蚀するには、AIDL むンタヌフェヌスを䜿甚したす。" #: 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 "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md #: src/android/aidl/example-service/changing-definition.md msgid "/** Birthday service interface. */" msgstr "/** 誕生日サヌビスのむンタヌフェヌス。*/" #: src/android/aidl/example-service/interface.md #: src/android/aidl/example-service/service-bindings.md #: src/android/aidl/example-service/changing-definition.md msgid "/** Generate a Happy Birthday message. */" msgstr "/** 「お誕生日おめでずう」ずいうメッセヌゞを生成したす。*/" #: src/android/aidl/example-service/interface.md msgid "_birthday_service/aidl/Android.bp_:" msgstr "_birthday_service/aidl/Android.bp_:" #: src/android/aidl/example-service/interface.md msgid "\"com.example.birthdayservice\"" msgstr "\"com.example.birthdayservice\"" #: src/android/aidl/example-service/interface.md msgid "\"com/example/birthdayservice/*.aidl\"" msgstr "\"com/example/birthdayservice/*.aidl\"" #: src/android/aidl/example-service/interface.md msgid "// Rust is not enabled by default\n" msgstr "// Rust はデフォルトでは無効です。\n" #: src/android/aidl/example-service/interface.md msgid "" "Note that the directory structure under the `aidl/` directory needs to match " "the package name used in the AIDL file, i.e. the package is `com.example." "birthdayservice` and the file is at `aidl/com/example/IBirthdayService.aidl`." msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "Generated Service API" msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" "Binder generates a trait corresponding to the interface definition. trait to " "talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md #, fuzzy msgid "_Generated trait_:" msgstr "生成された Rust:" #: src/android/aidl/example-service/service-bindings.md msgid "" "Your service will need to implement this trait, and your client will use " "this trait to talk to the service." msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" "The generated bindings can be found at `out/soong/.intermediates//`." msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" "Point out how the generated function signature, specifically the argument " "and return types, correspond the interface definition." msgstr "" #: src/android/aidl/example-service/service-bindings.md msgid "" "`String` for an argument results in a different Rust type than `String` as a " "return type." msgstr "" #: src/android/aidl/example-service/service.md msgid "Service Implementation" msgstr "サヌビスの実装" #: src/android/aidl/example-service/service.md msgid "We can now implement the AIDL service:" msgstr "次に、AIDL サヌビスを実装したす。" #: 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 "_birthday_service/src/lib.rs_:" #: src/android/aidl/example-service/service.md msgid "/// The `IBirthdayService` implementation.\n" msgstr "/// `IBirthdayService` の実装。\n" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/changing-implementation.md #: src/android/aidl/types/file-descriptor.md msgid "\"Happy Birthday {name}, congratulations with the {years} years!\"" msgstr "\"Happy Birthday {name}, congratulations with the {years} years!\"" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "_birthday_service/Android.bp_:" msgstr "_birthday_service/Android.bp_:" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/server.md msgid "\"libbirthdayservice\"" msgstr "\"libbirthdayservice\"" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"birthdayservice\"" msgstr "\"birthdayservice\"" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"com.example.birthdayservice-rust\"" msgstr "\"com.example.birthdayservice-rust\"" #: src/android/aidl/example-service/service.md #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "\"libbinder_rs\"" msgstr "\"libbinder_rs\"" #: src/android/aidl/example-service/service.md msgid "" "Point out the path to the generated `IBirthdayService` trait, and explain " "why each of the segments is necessary." msgstr "" #: src/android/aidl/example-service/service.md msgid "" "TODO: What does the `binder::Interface` trait do? Are there methods to " "override? Where source?" msgstr "" #: src/android/aidl/example-service/server.md msgid "AIDL Server" msgstr "AIDL サヌバヌ" #: src/android/aidl/example-service/server.md msgid "Finally, we can create a server which exposes the service:" msgstr "次に、サヌビスを公開するサヌバヌを䜜成したす。" #: src/android/aidl/example-service/server.md msgid "_birthday_service/src/server.rs_:" msgstr "_birthday_service/src/server.rs_:" #: src/android/aidl/example-service/server.md msgid "//! Birthday service.\n" msgstr "//! 誕生日サヌビス。\n" #: src/android/aidl/example-service/server.md msgid "/// Entry point for birthday service.\n" msgstr "/// 誕生日サヌビスの゚ントリ ポむント。\n" #: src/android/aidl/example-service/server.md msgid "\"Failed to register service\"" msgstr "\"Failed to register service\"" #: src/android/aidl/example-service/server.md msgid "\"birthday_server\"" msgstr "\"birthday_server\"" #: src/android/aidl/example-service/server.md msgid "\"src/server.rs\"" msgstr "\"src/server.rs\"" #: src/android/aidl/example-service/server.md #: src/android/aidl/example-service/client.md msgid "// To avoid dynamic link error.\n" msgstr "// ダむナミック リンク ゚ラヌを回避するためです。\n" #: src/android/aidl/example-service/server.md msgid "" "The process for taking a user-defined service implementation (in this case " "the `BirthdayService` type, which implements the `IBirthdayService`) and " "starting it as a Binder service has multiple steps, and may appear more " "complicated than students are used to if they've used Binder from C++ or " "another language. Explain to students why each step is necessary." msgstr "" #: src/android/aidl/example-service/server.md msgid "Create an instance of your service type (`BirthdayService`)." msgstr "" #: src/android/aidl/example-service/server.md msgid "" "Wrap the service object in corresponding `Bn*` type (`BnBirthdayService` in " "this case). This type is generated by Binder and provides the common Binder " "functionality that would be provided by the `BnBinder` base class in C++. We " "don't have inheritance in Rust, so instead we use composition, putting our " "`BirthdayService` within the generated `BnBinderService`." msgstr "" #: src/android/aidl/example-service/server.md msgid "" "Call `add_service`, giving it a service identifier and your service object " "(the `BnBirthdayService` object in the example)." msgstr "" #: src/android/aidl/example-service/server.md msgid "" "Call `join_thread_pool` to add the current thread to Binder's thread pool " "and start listening for connections." msgstr "" #: src/android/aidl/example-service/deploy.md msgid "We can now build, push, and start the service:" msgstr "次に、サヌビスをビルド、push、開始したす。" #: src/android/aidl/example-service/deploy.md msgid "" "```shell\n" "m birthday_server\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" "tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" msgstr "" "```shell\n" "m birthday_server\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_server\" /data/local/" "tmp\n" "adb root\n" "adb shell /data/local/tmp/birthday_server\n" "```" #: src/android/aidl/example-service/deploy.md msgid "In another terminal, check that the service runs:" msgstr "別のタヌミナルで、サヌビスが実行されおいるこずを確認したす。" #: src/android/aidl/example-service/deploy.md msgid "You can also call the service with `service call`:" msgstr "`service call` を䜿甚しおサヌビスを呌び出すこずもできたす。" #: src/android/aidl/example-service/client.md msgid "AIDL Client" msgstr "AIDL クラむアント" #: src/android/aidl/example-service/client.md msgid "Finally, we can create a Rust client for our new service." msgstr "ようやくここで、新しいサヌビス甚の Rust クラむアントを䜜成したす。" #: 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 "_birthday_service/src/client.rs_:" #: src/android/aidl/example-service/client.md msgid "/// Call the birthday service.\n" msgstr "/// 誕生日サヌビスを呌び出したす。\n" #: src/android/aidl/example-service/client.md src/android/aidl/types/objects.md #: src/android/aidl/types/parcelables.md #: src/android/aidl/types/file-descriptor.md msgid "\"Failed to connect to BirthdayService\"" msgstr "\"Failed to connect to BirthdayService\"" #: src/android/aidl/example-service/client.md #, fuzzy msgid "// Call the service.\n" msgstr "/// 誕生日サヌビスを呌び出したす。\n" #: src/android/aidl/example-service/client.md msgid "\"{msg}\"" msgstr "\"{msg}\"" #: src/android/aidl/example-service/client.md msgid "\"birthday_client\"" msgstr "\"birthday_client\"" #: src/android/aidl/example-service/client.md msgid "\"src/client.rs\"" msgstr "\"src/client.rs\"" #: src/android/aidl/example-service/client.md msgid "Notice that the client does not depend on `libbirthdayservice`." msgstr "" "クラむアントが `libbirthdayservice` に䟝存しおいないこずに泚目しおください。" #: src/android/aidl/example-service/client.md msgid "Build, push, and run the client on your device:" msgstr "デバむスでクラむアントをビルド、push、実行したす。" #: src/android/aidl/example-service/client.md msgid "" "```shell\n" "m birthday_client\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" "tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" msgstr "" "```shell\n" "m birthday_client\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/birthday_client\" /data/local/" "tmp\n" "adb shell /data/local/tmp/birthday_client Charlie 60\n" "```" #: src/android/aidl/example-service/client.md msgid "" "`Strong` is the trait object representing the service " "that the client has connected to." msgstr "" #: src/android/aidl/example-service/client.md msgid "" "`Strong` is a custom smart pointer type for Binder. It handles both an in-" "process ref count for the service trait object, and the global Binder ref " "count that tracks how many processes have a reference to the object." msgstr "" #: src/android/aidl/example-service/client.md msgid "" "Note that the trait object that the client uses to talk to the service uses " "the exact same trait that the server implements. For a given Binder " "interface, there is a single Rust trait generated that both client and " "server use." msgstr "" #: src/android/aidl/example-service/client.md msgid "" "Use the same service identifier used when registering the service. This " "should ideally be defined in a common crate that both the client and server " "can depend on." msgstr "" #: src/android/aidl/example-service/changing-definition.md msgid "" "Let us extend the API with more functionality: we want to let clients " "specify a list of lines for the birthday card:" msgstr "" "APIを拡匵しお、クラむアントが誕生日カヌドに远加する耇数行のメッセヌゞを指定で" "きるようにしたす。" #: src/android/aidl/example-service/changing-definition.md msgid "This results in an updated trait definition for `IBirthdayService`:" msgstr "" #: src/android/aidl/example-service/changing-definition.md msgid "" "Note how the `String[]` in the AIDL definition is translated as a " "`&[String]` in Rust, i.e. that idiomatic Rust types are used in the " "generated bindings wherever possible:" msgstr "" #: src/android/aidl/example-service/changing-definition.md msgid "`in` array arguments are translated to slices." msgstr "" #: src/android/aidl/example-service/changing-definition.md msgid "`out` and `inout` args are translated to `&mut Vec`." msgstr "" #: src/android/aidl/example-service/changing-definition.md msgid "Return values are translated to returning a `Vec`." msgstr "" #: src/android/aidl/example-service/changing-implementation.md msgid "Updating Client and Service" msgstr "" #: src/android/aidl/example-service/changing-implementation.md msgid "Update the client and server code to account for the new API." msgstr "" #: src/android/aidl/example-service/changing-implementation.md #, fuzzy msgid "'\\n'" msgstr "b'\\n'" #: src/android/aidl/example-service/changing-implementation.md msgid "\"Habby birfday to yuuuuu\"" msgstr "" #: src/android/aidl/example-service/changing-implementation.md msgid "\"And also: many more\"" msgstr "" #: src/android/aidl/example-service/changing-implementation.md msgid "" "TODO: Move code snippets into project files where they'll actually be built?" msgstr "" #: src/android/aidl/types.md msgid "Working With AIDL Types" msgstr "" #: src/android/aidl/types.md msgid "AIDL types translate into the appropriate idiomatic Rust type:" msgstr "" #: src/android/aidl/types.md msgid "Primitive types map (mostly) to idiomatic Rust types." msgstr "" #: src/android/aidl/types.md msgid "Collection types like slices, `Vec`s and string types are supported." msgstr "" #: src/android/aidl/types.md msgid "" "References to AIDL objects and file handles can be sent between clients and " "services." msgstr "" #: src/android/aidl/types.md msgid "File handles and parcelables are fully supported." msgstr "" #: src/android/aidl/types/primitives.md msgid "Primitive types map (mostly) idiomatically:" msgstr "" #: src/android/aidl/types/primitives.md #, fuzzy msgid "AIDL Type" msgstr "AIDLAndroidむンタヌフェむス定矩蚀語" #: src/android/aidl/types/primitives.md src/android/aidl/types/arrays.md #: src/android/interoperability/cpp/type-mapping.md msgid "Rust Type" msgstr "Rust 型" #: src/android/aidl/types/primitives.md msgid "Note" msgstr "" #: src/android/aidl/types/primitives.md #, fuzzy msgid "`boolean`" msgstr "`bool`" #: src/android/aidl/types/primitives.md msgid "`byte`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`i8`" msgstr "" #: src/android/aidl/types/primitives.md #, fuzzy msgid "Note that bytes are signed." msgstr "// 7 バむトを超える倀は無効です。\n" #: src/android/aidl/types/primitives.md msgid "`u16`" msgstr "" #: src/android/aidl/types/primitives.md msgid "Note the usage of `u16`, NOT `u32`." msgstr "" #: src/android/aidl/types/primitives.md msgid "`int`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`i32`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`long`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`i64`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`float`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`f32`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`double`" msgstr "" #: src/android/aidl/types/primitives.md msgid "`f64`" msgstr "" #: src/android/aidl/types/arrays.md msgid "" "The array types (`T[]`, `byte[]`, and `List`) get translated to the " "appropriate Rust array type depending on how they are used in the function " "signature:" msgstr "" #: src/android/aidl/types/arrays.md #, fuzzy msgid "Position" msgstr "説明" #: src/android/aidl/types/arrays.md msgid "`in` argument" msgstr "" #: src/android/aidl/types/arrays.md #, fuzzy msgid "`&[T]`" msgstr "スラむス型" #: src/android/aidl/types/arrays.md msgid "`out`/`inout` argument" msgstr "" #: src/android/aidl/types/arrays.md #, fuzzy msgid "`&mut Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "Return" msgstr "" #: src/android/aidl/types/arrays.md #: src/android/interoperability/cpp/type-mapping.md msgid "`Vec`" msgstr "`Vec`" #: src/android/aidl/types/arrays.md msgid "" "In Android 13 or higher, fixed-size arrays are supported, i.e. `T[N]` " "becomes `[T; N]`. Fixed-size arrays can have multiple dimensions (e.g. " "`int[3][4]`). In the Java backend, fixed-size arrays are represented as " "array types." msgstr "" #: src/android/aidl/types/arrays.md msgid "Arrays in parcelable fields always get translated to `Vec`." msgstr "" #: src/android/aidl/types/objects.md msgid "" "AIDL objects can be sent either as a concrete AIDL type or as the type-" "erased `IBinder` interface:" msgstr "" #: src/android/aidl/types/objects.md #, fuzzy msgid "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayInfoProvider." "aidl_:" msgstr "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/types/objects.md msgid "/** The same thing, but using a binder object. */" msgstr "" #: src/android/aidl/types/objects.md msgid "/** The same thing, but using `IBinder`. */" msgstr "" #: src/android/aidl/types/objects.md #, fuzzy msgid "/// Rust struct implementing the `IBirthdayInfoProvider` interface.\n" msgstr "//! `IBirthdayService` AIDL むンタヌフェヌスの実装。\n" #: src/android/aidl/types/objects.md #, fuzzy msgid "// Create a binder object for the `IBirthdayInfoProvider` interface.\n" msgstr "//! `IBirthdayService` AIDL むンタヌフェヌスの実装。\n" #: src/android/aidl/types/objects.md #, fuzzy msgid "// Send the binder object to the service.\n" msgstr "/// 誕生日サヌビスを呌び出したす。\n" #: src/android/aidl/types/objects.md msgid "" "// Perform the same operation but passing the provider as an `SpIBinder`.\n" msgstr "" #: src/android/aidl/types/objects.md msgid "" "Note the usage of `BnBirthdayInfoProvider`. This serves the same purpose as " "`BnBirthdayService` that we saw previously." msgstr "" #: src/android/aidl/types/parcelables.md msgid "Binder for Rust supports sending parcelables directly:" msgstr "" #: src/android/aidl/types/parcelables.md #, fuzzy msgid "_birthday_service/aidl/com/example/birthdayservice/BirthdayInfo.aidl_:" msgstr "" "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #: src/android/aidl/types/parcelables.md msgid "/** The same thing, but with a parcelable. */" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "" "Files can be sent between Binder clients/servers using the " "`ParcelFileDescriptor` type:" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "/** The same thing, but loads info from a file. */" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "// Open a file and put the birthday info in it.\n" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "\"/data/local/tmp/birthday.info\"" msgstr "" #: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"{name}\"" msgstr "\"Hello {name}\"" #: src/android/aidl/types/file-descriptor.md msgid "\"{years}\"" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "// Create a `ParcelFileDescriptor` from the file and send it.\n" msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "" "// Convert the file descriptor to a `File`. `ParcelFileDescriptor` wraps\n" " // an `OwnedFd`, which can be cloned and then used to create a " "`File`\n" " // object.\n" msgstr "" #: src/android/aidl/types/file-descriptor.md #, fuzzy msgid "\"Invalid file handle\"" msgstr "\"Invalid length\"" #: src/android/aidl/types/file-descriptor.md msgid "" "`ParcelFileDescriptor` wraps an `OwnedFd`, and so can be created from a " "`File` (or any other type that wraps an `OwnedFd`), and can be used to " "create a new `File` handle on the other side." msgstr "" #: src/android/aidl/types/file-descriptor.md msgid "" "Other types of file descriptors can be wrapped and sent, e.g. TCP, UDP, and " "UNIX sockets." msgstr "" #: src/android/testing.md #, fuzzy msgid "Testing in Android" msgstr "Android での Rust ぞようこそ" #: src/android/testing.md msgid "" "Building on [Testing](../testing.md), we will now look at how unit tests " "work in AOSP. Use the `rust_test` module for your unit tests:" msgstr "" #: src/android/testing.md #, fuzzy msgid "_testing/Android.bp_:" msgstr "_hello_rust/Android.bp_:" #: src/android/testing.md #, fuzzy msgid "\"libleftpad\"" msgstr "\"libtextwrap\"" #: src/android/testing.md msgid "\"leftpad\"" msgstr "" #: src/android/testing.md #, fuzzy msgid "\"libleftpad_test\"" msgstr "\"libbirthday_bindgen_test\"" #: src/android/testing.md msgid "\"leftpad_test\"" msgstr "" #: src/android/testing.md src/android/interoperability/with-c/bindgen.md msgid "\"general-tests\"" msgstr "\"general-tests\"" #: src/android/testing.md #, fuzzy msgid "_testing/src/lib.rs_:" msgstr "_hello_rust/src/lib.rs_:" #: src/android/testing.md #, fuzzy msgid "//! Left-padding library.\n" msgstr "//! 挚拶ラむブラリ。\n" #: src/android/testing.md msgid "/// Left-pad `s` to `width`.\n" msgstr "" #: src/android/testing.md #, fuzzy msgid "\"{s:>width$}\"" msgstr "\"|{:^width$}|\"" #: src/android/testing.md #, fuzzy msgid "\" foo\"" msgstr "\"foo\"" #: src/android/testing.md #, fuzzy msgid "\"foobar\"" msgstr "\"foo\"" #: src/android/testing.md #, fuzzy msgid "You can now run the test with" msgstr "これで、バむンディングを自動生成できたす。" #: src/android/testing.md #, fuzzy msgid "The output looks like this:" msgstr "党䜓的なアプロヌチは次のようになりたす。" #: src/android/testing.md msgid "" "```text\n" "INFO: Elapsed time: 2.666s, Critical Path: 2.40s\n" "INFO: 3 processes: 2 internal, 1 linux-sandbox.\n" "INFO: Build completed successfully, 3 total actions\n" "//comprehensive-rust-android/testing:libleftpad_test_host PASSED " "in 2.3s\n" " PASSED libleftpad_test.tests::long_string (0.0s)\n" " PASSED libleftpad_test.tests::short_string (0.0s)\n" "Test cases: finished with 2 passing and 0 failing out of 2 test cases\n" "```" msgstr "" #: src/android/testing.md msgid "" "Notice how you only mention the root of the library crate. Tests are found " "recursively in nested modules." msgstr "" #: src/android/testing/googletest.md msgid "" "The [GoogleTest](https://docs.rs/googletest/) crate allows for flexible test " "assertions using _matchers_:" msgstr "" "[GoogleTest](https://docs.rs/googletest/) クレヌトにより、マッチャヌを䜿甚し" "た柔軟なテスト アサヌションが可胜になりたす。" #: src/android/testing/googletest.md msgid "\"baz\"" msgstr "\"baz\"" #: src/android/testing/googletest.md msgid "\"xyz\"" msgstr "\"xyz\"" #: src/android/testing/googletest.md msgid "" "If we change the last element to `\"!\"`, the test fails with a structured " "error message pin-pointing the error:" msgstr "" "最埌の芁玠を `\"!\"` に倉曎するず、テストは倱敗し、゚ラヌ箇所を瀺す構造化され" "た゚ラヌ メッセヌゞが衚瀺されたす。" #: src/android/testing/googletest.md msgid "" "GoogleTest is not part of the Rust Playground, so you need to run this " "example in a local environment. Use `cargo add googletest` to quickly add it " "to an existing Cargo project." msgstr "" "GoogleTest は Rust プレむグラりンドの䞀郚ではないため、この䟋はロヌカル環境で" "実行する必芁がありたす。`cargo add googletest` を䜿甚しお、既存の Cargo プロ" "ゞェクトにすばやく远加したす。" #: src/android/testing/googletest.md msgid "" "The `use googletest::prelude::*;` line imports a number of [commonly used " "macros and types](https://docs.rs/googletest/latest/googletest/prelude/index." "html)." msgstr "" "`use googletest::prelude::*;` 行は、[䞀般的に䜿甚されるマクロず型](https://" "docs.rs/googletest/latest/googletest/prelude/index.html)をむンポヌトしたす。" #: src/android/testing/googletest.md 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 #, fuzzy msgid "" "A particularly nice feature is that mismatches in multi-line strings are " "shown as a diff:" msgstr "特に䟿利なのは、耇数行の文字列の䞍䞀臎が差分ずしお衚瀺される機胜です。" #: src/android/testing/googletest.md msgid "" "\"Memory safety found,\\n\\\n" " Rust's strong typing guides the way,\\n\\\n" " Secure code you'll write.\"" msgstr "" "\"Memory safety found,\\n\\\n" " Rust's strong typing guides the way,\\n\\\n" " Secure code you'll write.\"" #: src/android/testing/googletest.md msgid "" "\"Memory safety found,\\n\\\n" " Rust's silly humor guides the way,\\n\\\n" " Secure code you'll write.\"" msgstr "" "\"Memory safety found,\\n\\\n" " Rust's silly humor guides the way,\\n\\\n" " Secure code you'll write.\"" #: src/android/testing/googletest.md msgid "shows a color-coded diff (colors not shown here):" msgstr "これにより、差分が色分けされたすここでは色分けされおいたせん。" #: src/android/testing/googletest.md msgid "" "The crate is a Rust port of [GoogleTest for C++](https://google.github.io/" "googletest/)." msgstr "" "このクレヌトは [GoogleTest for C++](https://google.github.io/googletest/) を" "Rustに移怍したものです。" #: src/android/testing/mocking.md msgid "" "For mocking, [Mockall](https://docs.rs/mockall/) is a widely used library. " "You need to refactor your code to use traits, which you can then quickly " "mock:" msgstr "" "モックには、[Mockall](https://docs.rs/mockall/) ずいうラむブラリが広く䜿甚さ" "れおいたす。トレむトを䜿甚するようにコヌドをリファクタリングする必芁がありた" "す。これにより、すぐにモックできるようになりたす。" #: src/android/testing/mocking.md #, fuzzy msgid "" "Mockall is the recommended mocking library in Android (AOSP). There are " "other [mocking libraries available on crates.io](https://crates.io/keywords/" "mock), in particular in the area of mocking HTTP services. The other mocking " "libraries work in a similar fashion as Mockall, meaning that they make it " "easy to get a mock implementation of a given trait." msgstr "" "ここでは、Mockall が掚奚モック ラむブラリである AndroidAOSP向けのアドバむ" "スを行いたす。特に HTTP サヌビスのモックに関しおは、[crates.io で他のモック " "ラむブラリが公開されおいたす](https://crates.io/keywords/mock)。他のモック ラ" "むブラリも Mockall ず 同様で、特定のトレむトのモック実装を簡単に埗るこずがで" "きたす。" #: src/android/testing/mocking.md msgid "" "Note that mocking is somewhat _controversial_: mocks allow you to completely " "isolate a test from its dependencies. The immediate result is faster and " "more stable test execution. On the other hand, the mocks can be configured " "wrongly and return output different from what the real dependencies would do." msgstr "" "モックを䜿甚する際は少し泚意が必芁です。モックを䜿甚するず、テストを䟝存関係" "から完党に分離できたす。その結果、より高速で安定したテスト実行が可胜になりた" "す。䞀方、モックが誀っお構成され、実際の䟝存関係の動䜜ずは異なる出力が返され" "る可胜性がありたす。" #: src/android/testing/mocking.md msgid "" "If at all possible, it is recommended that you use the real dependencies. As " "an example, many databases allow you to configure an in-memory backend. This " "means that you get the correct behavior in your tests, plus they are fast " "and will automatically clean up after themselves." msgstr "" "可胜な限り、実際の䟝存関係を䜿甚するこずをおすすめしたす。たずえば、倚くの" "デヌタベヌスではむンメモリ バック゚ンドを構成できたす。぀たり、テストで正しい" "動䜜が埗られ、しかも高速で、テスト埌は自動的にクリヌンアップされたす。" #: src/android/testing/mocking.md msgid "" "Similarly, many web frameworks allow you to start an in-process server which " "binds to a random port on `localhost`. Always prefer this over mocking away " "the framework since it helps you test your code in the real environment." msgstr "" "同様に、倚くのりェブ フレヌムワヌクでは、`localhost` 䞊のランダムなポヌトにバ" "むンドするプロセス内サヌバヌを起動できたす。このような構成は実際の環境でコヌ" "ドをテストするこずを可胜にするので、フレヌムワヌクをモックするこずよりも垞に" "優先しお利甚したしょう。" #: src/android/testing/mocking.md msgid "" "Mockall is not part of the Rust Playground, so you need to run this example " "in a local environment. Use `cargo add mockall` to quickly add Mockall to an " "existing Cargo project." msgstr "" "Mockall は Rust プレむグラりンドの䞀郚ではないため、この䟋はロヌカル環境で実" "行する必芁がありたす。`cargo add mockall` を䜿甚しお、Mockall を既存の Cargo " "プロゞェクトにすばやく远加したす。" #: src/android/testing/mocking.md msgid "" "Mockall has a lot more functionality. In particular, you can set up " "expectations which depend on the arguments passed. Here we use this to mock " "a cat which becomes hungry 3 hours after the last time it was fed:" msgstr "" "Mockall にはさらに倚くの機胜がありたす。特に、枡される匕数に応じお期埅倀を蚭" "定できたす。ここでは、最埌に逌を䞎えおらえおから 3 時間埌に空腹になる猫をモッ" "クするためにこれを䜿甚したす。" #: src/android/testing/mocking.md msgid "" "You can use `.times(n)` to limit the number of times a mock method can be " "called to `n` --- the mock will automatically panic when dropped if this " "isn't satisfied." msgstr "" "`.times(n)` を䜿甚するず、モックメ゜ッドが呌び出される回数を`n` に制限できた" "す。これが満たされない堎合、モックはドロップ時に自動的にパニックになりたす。" #: src/android/logging.md msgid "" "You should use the `log` crate to automatically log to `logcat` (on-device) " "or `stdout` (on-host):" msgstr "" "`log` クレヌトを䜿甚しお、自動的に デバむス䞊では`logcat` たたは ホスト" "䞊では`stdout`にログを蚘録するようにしたす。" #: src/android/logging.md msgid "_hello_rust_logs/Android.bp_:" msgstr "_hello_rust_logs/Android.bp_:" #: src/android/logging.md msgid "\"hello_rust_logs\"" msgstr "\"hello_rust_logs\"" #: src/android/logging.md msgid "\"liblog_rust\"" msgstr "\"liblog_rust\"" #: src/android/logging.md msgid "\"liblogger\"" msgstr "\"liblogger\"" #: src/android/logging.md msgid "_hello_rust_logs/src/main.rs_:" msgstr "_hello_rust_logs/src/main.rs_:" #: src/android/logging.md msgid "//! Rust logging demo.\n" msgstr "//! Rust ロギングのデモ。\n" #: src/android/logging.md msgid "/// Logs a greeting.\n" msgstr "/// 挚拶をログに蚘録したす。\n" #: src/android/logging.md msgid "\"rust\"" msgstr "\"rust\"" #: src/android/logging.md msgid "\"Starting program.\"" msgstr "\"Starting program.\"" #: src/android/logging.md msgid "\"Things are going fine.\"" msgstr "\"Things are going fine.\"" #: src/android/logging.md msgid "\"Something went wrong!\"" msgstr "\"Something went wrong!\"" #: src/android/logging.md src/android/interoperability/with-c/bindgen.md #: src/android/interoperability/with-c/rust.md msgid "Build, push, and run the binary on your device:" msgstr "デバむスでバむナリをビルド、push、実行したす。" #: src/android/logging.md msgid "" "```shell\n" "m hello_rust_logs\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" "tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" msgstr "" "```shell\n" "m hello_rust_logs\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/hello_rust_logs\" /data/local/" "tmp\n" "adb shell /data/local/tmp/hello_rust_logs\n" "```" #: src/android/logging.md msgid "The logs show up in `adb logcat`:" msgstr "`adb logcat` でログを衚瀺できたす。" #: 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 " "means that you can:" msgstr "Rust は他の蚀語ずの盞互運甚性に優れおいるため、次のこずが可胜です。" #: src/android/interoperability.md msgid "Call Rust functions from other languages." msgstr "他の蚀語から Rust 関数を呌び出す。" #: src/android/interoperability.md msgid "Call functions written in other languages from Rust." msgstr "Rust から他の蚀語で蚘述された関数を呌び出す。" #: src/android/interoperability.md msgid "" "When you call functions in a foreign language we say that you're using a " "_foreign function interface_, also known as FFI." msgstr "" "他の蚀語の関数を呌び出す堎合は、倖郚関数むンタヌフェヌスFFI: _foreign " "function interface_を䜿甚したす。" #: src/android/interoperability/with-c.md msgid "Interoperability with C" msgstr "C ずの盞互運甚性" #: src/android/interoperability/with-c.md msgid "" "Rust has full support for linking object files with a C calling convention. " "Similarly, you can export Rust functions and call them from C." msgstr "" "Rust は、C の呌び出し芏則によるオブゞェクト ファむルのリンクを完党にサポヌト" "しおいたす。同様に、Rust 関数を゚クスポヌトしお C から呌び出すこずができた" "す。" #: src/android/interoperability/with-c.md msgid "You can do it by hand if you want:" msgstr "これは手動で行うこずもできたす。" #: src/android/interoperability/with-c.md msgid "\"{x}, {abs_x}\"" msgstr "\"{x}, {abs_x}\"" #: src/android/interoperability/with-c.md #, fuzzy msgid "" "We already saw this in the [Safe FFI Wrapper exercise](../../unsafe-rust/" "exercise.md)." msgstr "" "これは、[安党な FFI ラッパヌの挔習](../../exercises/day-3/safe-ffi-wrapper." "md)ですでに取り扱いたした。" #: src/android/interoperability/with-c.md msgid "" "This assumes full knowledge of the target platform. Not recommended for " "production." msgstr "" "これは、タヌゲット プラットフォヌムを完党に理解しおいるこずを前提ずしおいた" "す。本番環境での䜿甚掚奚されたせん。" #: src/android/interoperability/with-c.md msgid "We will look at better options next." msgstr "次に、より良い遞択肢を芋おいきたす。" #: src/android/interoperability/with-c/bindgen.md msgid "Using Bindgen" msgstr "Bindgen の䜿甚" #: src/android/interoperability/with-c/bindgen.md msgid "" "The [bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) " "tool can auto-generate bindings from a C header file." msgstr "" "[bindgen](https://rust-lang.github.io/rust-bindgen/introduction.html) ツヌル" "を䜿甚するず、C ヘッダヌ ファむルからバむンディングを自動生成できたす。" #: src/android/interoperability/with-c/bindgen.md msgid "First create a small C library:" msgstr "たず、小さな C ラむブラリを䜜成したす。" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday.h_:" msgstr "_interoperability/bindgen/libbirthday.h_:" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday.c_:" msgstr "_interoperability/bindgen/libbirthday.c_:" #: src/android/interoperability/with-c/bindgen.md msgid "" msgstr "" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday.h\"" msgstr "\"libbirthday.h\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"+--------------\\n\"" msgstr "\"+--------------\\n\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"| Happy Birthday %s!\\n\"" msgstr "\"| Happy Birthday %s!\\n\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"| Congratulations with the %i years!\\n\"" msgstr "\"| Congratulations with the %i years!\\n\"" #: src/android/interoperability/with-c/bindgen.md msgid "Add this to your `Android.bp` file:" msgstr "これを `Android.bp` ファむルに远加したす。" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/Android.bp_:" msgstr "_interoperability/bindgen/Android.bp_:" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday\"" msgstr "\"libbirthday\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday.c\"" msgstr "\"libbirthday.c\"" #: src/android/interoperability/with-c/bindgen.md msgid "" "Create a wrapper header file for the library (not strictly needed in this " "example):" msgstr "" "ラむブラリのラッパヌ ヘッダヌ ファむルを䜜成したすこの䟋では必須ではありた" "せん。" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/libbirthday_wrapper.h_:" msgstr "_interoperability/bindgen/libbirthday_wrapper.h_:" #: src/android/interoperability/with-c/bindgen.md msgid "You can now auto-generate the bindings:" msgstr "これで、バむンディングを自動生成できたす。" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen\"" msgstr "\"libbirthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"birthday_bindgen\"" msgstr "\"birthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_wrapper.h\"" msgstr "\"libbirthday_wrapper.h\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"bindings\"" msgstr "\"bindings\"" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can use the bindings in our Rust program:" msgstr "これで、Rust プログラムでバむンディングを䜿甚できたす。" #: src/android/interoperability/with-c/bindgen.md msgid "\"print_birthday_card\"" msgstr "\"print_birthday_card\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"main.rs\"" msgstr "\"main.rs\"" #: src/android/interoperability/with-c/bindgen.md msgid "_interoperability/bindgen/main.rs_:" msgstr "_interoperability/bindgen/main.rs_:" #: src/android/interoperability/with-c/bindgen.md msgid "//! Bindgen demo.\n" msgstr "//! Bindgen のデモ。\n" #: src/android/interoperability/with-c/bindgen.md 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 "" "```shell\n" "m print_birthday_card\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" "tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" msgstr "" "```shell\n" "m print_birthday_card\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/print_birthday_card\" /data/local/" "tmp\n" "adb shell /data/local/tmp/print_birthday_card\n" "```" #: src/android/interoperability/with-c/bindgen.md msgid "Finally, we can run auto-generated tests to ensure the bindings work:" msgstr "" "これで、自動生成されたテストを実行しお、バむンディングが機胜しおいるこずを確" "認できたす。" #: src/android/interoperability/with-c/bindgen.md msgid "\"libbirthday_bindgen_test\"" msgstr "\"libbirthday_bindgen_test\"" #: src/android/interoperability/with-c/bindgen.md msgid "\":libbirthday_bindgen\"" msgstr "\":libbirthday_bindgen\"" #: src/android/interoperability/with-c/bindgen.md msgid "\"none\"" msgstr "\"none\"" #: src/android/interoperability/with-c/bindgen.md msgid "// Generated file, skip linting\n" msgstr "// 生成されたファむル、lint チェックをスキップ\n" #: src/android/interoperability/with-c/rust.md msgid "Calling Rust" msgstr "Rust の呌び出し" #: src/android/interoperability/with-c/rust.md msgid "Exporting Rust functions and types to C is easy:" msgstr "Rust の関数ず型は、C に簡単に゚クスポヌトできたす。" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.rs_" msgstr "_interoperability/rust/libanalyze/analyze.rs_" #: src/android/interoperability/with-c/rust.md msgid "//! Rust FFI demo.\n" msgstr "//! Rust FFI のデモ。\n" #: src/android/interoperability/with-c/rust.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 msgid "\"x ({x}) is smallest!\"" msgstr "\"x ({x}) is smallest!\"" #: src/android/interoperability/with-c/rust.md msgid "\"y ({y}) is probably larger than x ({x})\"" msgstr "\"y ({y}) is probably larger than x ({x})\"" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/analyze.h_" msgstr "_interoperability/rust/libanalyze/analyze.h_" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/libanalyze/Android.bp_" msgstr "_interoperability/rust/libanalyze/Android.bp_" #: src/android/interoperability/with-c/rust.md msgid "\"libanalyze_ffi\"" msgstr "\"libanalyze_ffi\"" #: src/android/interoperability/with-c/rust.md msgid "\"analyze_ffi\"" msgstr "\"analyze_ffi\"" #: src/android/interoperability/with-c/rust.md msgid "\"analyze.rs\"" msgstr "\"analyze.rs\"" #: src/android/interoperability/with-c/rust.md msgid "We can now call this from a C binary:" msgstr "これで、これを C バむナリから呌び出せるようになりたした。" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/main.c_" msgstr "_interoperability/rust/analyze/main.c_" #: src/android/interoperability/with-c/rust.md msgid "\"analyze.h\"" msgstr "\"analyze.h\"" #: src/android/interoperability/with-c/rust.md msgid "_interoperability/rust/analyze/Android.bp_" msgstr "_interoperability/rust/analyze/Android.bp_" #: src/android/interoperability/with-c/rust.md msgid "\"analyze_numbers\"" msgstr "\"analyze_numbers\"" #: src/android/interoperability/with-c/rust.md msgid "\"main.c\"" msgstr "\"main.c\"" #: src/android/interoperability/with-c/rust.md msgid "" "```shell\n" "m analyze_numbers\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" "tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" msgstr "" "```shell\n" "m analyze_numbers\n" "adb push \"$ANDROID_PRODUCT_OUT/system/bin/analyze_numbers\" /data/local/" "tmp\n" "adb shell /data/local/tmp/analyze_numbers\n" "```" #: src/android/interoperability/with-c/rust.md #, fuzzy 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 "" "`#[no_mangle]` により Rust の通垞の名前のマングリングが無効になるため、゚クス" "ポヌトされたシンボルは単に関数の名前になりたす。`#[export_name = " "\"some_name\"]` を䜿甚しお任意の名前を指定するこずもできたす。" #: src/android/interoperability/cpp.md msgid "" "The [CXX crate](https://cxx.rs/) makes it possible to do safe " "interoperability between Rust and C++." msgstr "" "[CXX クレヌト](https://cxx.rs/)を䜿甚するず、Rust ず C++ の間で安党な盞互運甚" "性を確保できたす。" #: src/android/interoperability/cpp.md msgid "The overall approach looks like this:" msgstr "党䜓的なアプロヌチは次のようになりたす。" #: src/android/interoperability/cpp/bridge.md msgid "" "CXX relies on a description of the function signatures that will be exposed " "from each language to the other. You provide this description using extern " "blocks in a Rust module annotated with the `#[cxx::bridge]` attribute macro." msgstr "" "CXX は、各蚀語から他の蚀語に公開される関数シグネチャの蚘述に䟝存したす。この" "蚘述は、`#[cxx::bridge]` 属性マクロでアノテヌションされた Rust モゞュヌル内" "の extern ブロックを䜿甚しお指定したす。" #: src/android/interoperability/cpp/bridge.md msgid "\"org::blobstore\"" msgstr "\"org::blobstore\"" #: src/android/interoperability/cpp/bridge.md msgid "// Shared structs with fields visible to both languages.\n" msgstr "// 䞡方の蚀語からアクセスできるフィヌルドを持぀共有構造䜓。\n" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/generated-cpp.md msgid "// Rust types and signatures exposed to C++.\n" msgstr "// C++ に公開される Rust の型ずシグネチャ。\n" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/rust-bridge.md #: src/android/interoperability/cpp/generated-cpp.md #: src/android/interoperability/cpp/rust-result.md #: src/chromium/interoperability-with-cpp/example-bindings.md #: src/chromium/interoperability-with-cpp/error-handling-qr.md #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"Rust\"" msgstr "\"Rust\"" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/cpp-bridge.md msgid "// C++ types and signatures exposed to Rust.\n" msgstr "// Rust に公開される C++ の型ずシグネチャ。\n" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/cpp-bridge.md #: src/android/interoperability/cpp/cpp-exception.md #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"C++\"" msgstr "\"C++\"" #: src/android/interoperability/cpp/bridge.md #: src/android/interoperability/cpp/cpp-bridge.md msgid "\"include/blobstore.h\"" msgstr "\"include/blobstore.h\"" #: src/android/interoperability/cpp/bridge.md msgid "The bridge is generally declared in an `ffi` module within your crate." msgstr "ブリッゞは通垞、クレヌト内の `ffi` モゞュヌルで宣蚀したす。" #: src/android/interoperability/cpp/bridge.md msgid "" "From the declarations made in the bridge module, CXX will generate matching " "Rust and C++ type/function definitions in order to expose those items to " "both languages." msgstr "" "ブリッゞ モゞュヌルで行われた宣蚀から、CXX はマッチする Rust ず C++ の型 / 関" "数の定矩を生成し、これらのアむテムを䞡方の蚀語に公開したす。" #: src/android/interoperability/cpp/bridge.md msgid "" "To view the generated Rust code, use [cargo-expand](https://github.com/" "dtolnay/cargo-expand) to view the expanded proc macro. For most of the " "examples you would use `cargo expand ::ffi` to expand just the `ffi` module " "(though this doesn't apply for Android projects)." msgstr "" "生成された Rust コヌドを衚瀺するには、[cargo-expand](https://github.com/" "dtolnay/cargo-expand) を䜿甚しお、展開された proc マクロを衚瀺したす。ほずん" "どの䟋では、`cargo expand ::ffi` を䜿甚しお `ffi` モゞュヌルのみを展開したす" "ただし、これは Android プロゞェクトには圓おはたりたせん。" #: src/android/interoperability/cpp/bridge.md msgid "To view the generated C++ code, look in `target/cxxbridge`." msgstr "生成された C++ コヌドを衚瀺するには、`target/cxxbridge` を確認したす。" #: src/android/interoperability/cpp/rust-bridge.md msgid "Rust Bridge Declarations" msgstr "Rust のブリッゞ宣蚀" #: src/android/interoperability/cpp/rust-bridge.md msgid "// Opaque type\n" msgstr "// オペヌク型\n" #: src/android/interoperability/cpp/rust-bridge.md msgid "// Method on `MyType`\n" msgstr "// `MyType` のメ゜ッド\n" #: src/android/interoperability/cpp/rust-bridge.md #, fuzzy msgid "// Free function\n" msgstr "関数" #: src/android/interoperability/cpp/rust-bridge.md msgid "" "Items declared in the `extern \"Rust\"` reference items that are in scope in " "the parent module." msgstr "" "芪モゞュヌルのスコヌプ内にある `extern \"Rust\"` 参照アむテムで宣蚀されたアむ" "テム。" #: src/android/interoperability/cpp/rust-bridge.md msgid "" "The CXX code generator uses your `extern \"Rust\"` section(s) to produce a C+" "+ header file containing the corresponding C++ declarations. The generated " "header has the same path as the Rust source file containing the bridge, " "except with a .rs.h file extension." msgstr "" "CXX コヌド ゞェネレヌタは、`extern \"Rust\"` セクションを䜿甚しお、察応する " "C++ 宣蚀を含む C++ ヘッダヌ ファむルを生成したす。生成されるヘッダヌのパス" "は、rs.hずいうファむル拡匵子郚分を陀き、ブリッゞを含む Rust ゜ヌスファむルず" "同じになりたす。" #: src/android/interoperability/cpp/generated-cpp.md msgid "Results in (roughly) the following C++:" msgstr "おおよそ次のような C++ が生成されたす。" #: src/android/interoperability/cpp/cpp-bridge.md msgid "C++ Bridge Declarations" msgstr "C++ のブリッゞ宣蚀" #: src/android/interoperability/cpp/cpp-bridge.md msgid "Results in (roughly) the following Rust:" msgstr "おおよそ次のような Rust が生成されたす。" #: src/android/interoperability/cpp/cpp-bridge.md msgid "\"org$blobstore$cxxbridge1$new_blobstore_client\"" msgstr "\"org$blobstore$cxxbridge1$new_blobstore_client\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" msgstr "\"org$blobstore$cxxbridge1$BlobstoreClient$put\"" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" "The programmer does not need to promise that the signatures they have typed " "in are accurate. CXX performs static assertions that the signatures exactly " "correspond with what is declared in C++." msgstr "" "プログラマヌは、入力したシグネチャが正確であるこずを保蚌する必芁はありたせ" "ん。CXX は、シグネチャが C++ で宣蚀されたものず完党に察応するずいうこずを静的" "に保蚌したす。" #: src/android/interoperability/cpp/cpp-bridge.md msgid "" "`unsafe extern` blocks allow you to declare C++ functions that are safe to " "call from Rust." msgstr "" "`unsafe extern` ブロックを䜿甚するず、Rust から安党に呌び出せる C++ 関数を宣" "蚀できたす。" #: src/android/interoperability/cpp/shared-types.md msgid "// A=1, J=11, Q=12, K=13\n" msgstr "// A=1、J=11、Q=12、K=13\n" #: src/android/interoperability/cpp/shared-types.md msgid "Only C-like (unit) enums are supported." msgstr "C のような単䜍列挙型のみがサポヌトされおいたす。" #: src/android/interoperability/cpp/shared-types.md msgid "" "A limited number of traits are supported for `#[derive()]` on shared types. " "Corresponding functionality is also generated for the C++ code, e.g. if you " "derive `Hash` also generates an implementation of `std::hash` for the " "corresponding C++ type." msgstr "" "共有型の `#[derive()]` では、サポヌトされるトレむトの数が限られおいたす。察応" "する機胜は C++ コヌドでも生成されたす。たずえば、`Hash` を導出するず、察応す" "る C++ 型の `std::hash` の実装も生成されたす。" #: src/android/interoperability/cpp/shared-enums.md msgid "Generated Rust:" msgstr "生成された Rust:" #: src/android/interoperability/cpp/shared-enums.md msgid "Generated C++:" msgstr "生成された C++:" #: src/android/interoperability/cpp/shared-enums.md msgid "" "On the Rust side, the code generated for shared enums is actually a struct " "wrapping a numeric value. This is because it is not UB in C++ for an enum " "class to hold a value different from all of the listed variants, and our " "Rust representation needs to have the same behavior." msgstr "" "Rust 偎では、共有列挙型に察しお生成されるコヌドは、実際には数倀をラップした構" "造䜓です。これは、列挙型クラスがリストされたすべおのバリアントずは異なる倀を" "保持するこずは C++ では UB ではなく、Rust 衚珟は同じ動䜜をする必芁があるため" "です。" #: src/android/interoperability/cpp/rust-result.md msgid "\"fallible1 requires depth > 0\"" msgstr "\"fallible1 requires depth > 0\"" #: src/android/interoperability/cpp/rust-result.md msgid "\"Success!\"" msgstr "\"Success!\"" #: src/android/interoperability/cpp/rust-result.md msgid "" "Rust functions that return `Result` are translated to exceptions on the C++ " "side." msgstr "`Result` を返す Rust 関数は、C++ 偎で䟋倖に倉換されたす。" #: src/android/interoperability/cpp/rust-result.md msgid "" "The exception thrown will always be of type `rust::Error`, which primarily " "exposes a way to get the error message string. The error message will come " "from the error type's `Display` impl." msgstr "" "スロヌされる䟋倖は垞に `rust::Error` 型で、䞻に゚ラヌ メッセヌゞの文字列を取" "埗する手段を提䟛したす。゚ラヌ メッセヌゞは、゚ラヌ型の `Display` の実装から" "取埗されたす。" #: src/android/interoperability/cpp/rust-result.md msgid "" "A panic unwinding from Rust to C++ will always cause the process to " "immediately terminate." msgstr "" "Rust から C++ にパニック アンワむンドを行うず、プロセスは必ず盎ちに終了した" "す。" #: src/android/interoperability/cpp/cpp-exception.md msgid "\"example/include/example.h\"" msgstr "\"example/include/example.h\"" #: src/android/interoperability/cpp/cpp-exception.md msgid "\"Error: {}\"" msgstr "\"Error: {}\"" #: src/android/interoperability/cpp/cpp-exception.md msgid "" "C++ functions declared to return a `Result` will catch any thrown exception " "on the C++ side and return it as an `Err` value to the calling Rust function." msgstr "" "`Result` を返すように宣蚀された C++ 関数は、C++ 偎でスロヌされたあらゆる䟋倖" "をキャッチし、呌び出し元の Rust 関数に `Err` 倀ずしお返したす。" #: src/android/interoperability/cpp/cpp-exception.md msgid "" "If an exception is thrown from an extern \"C++\" function that is not " "declared by the CXX bridge to return `Result`, the program calls C++'s `std::" "terminate`. The behavior is equivalent to the same exception being thrown " "through a `noexcept` C++ function." msgstr "" "CXX ブリッゞでResultを返すように宣蚀されおいないextern \"C++\"関数から䟋倖が" "スロヌされるず、`Result`が返されるず、プログラムは C++ の`std::terminate`ã‚’å‘Œ" "び出したす。この動䜜は、同じ䟋倖が`noexcept` C++ 関数でスロヌされた堎合ず同等" "です。" #: src/android/interoperability/cpp/type-mapping.md msgid "C++ Type" msgstr "C++ 型" #: src/android/interoperability/cpp/type-mapping.md msgid "`rust::String`" msgstr "`rust::String`" #: src/android/interoperability/cpp/type-mapping.md msgid "`&str`" msgstr "`&str`" #: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Str`" msgstr "`rust::Str`" #: src/android/interoperability/cpp/type-mapping.md #, fuzzy msgid "`CxxString`" msgstr "`CxxString`" #: src/android/interoperability/cpp/type-mapping.md msgid "`std::string`" msgstr "`std::string`" #: src/android/interoperability/cpp/type-mapping.md msgid "`&[T]`/`&mut [T]`" msgstr "`&[T]`/`&mut [T]`" #: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Slice`" msgstr "`rust::Slice`" #: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Box`" msgstr "`rust::Box`" #: src/android/interoperability/cpp/type-mapping.md msgid "`UniquePtr`" msgstr "`UniquePtr`" #: src/android/interoperability/cpp/type-mapping.md msgid "`std::unique_ptr`" msgstr "`std::unique_ptr`" #: src/android/interoperability/cpp/type-mapping.md msgid "`rust::Vec`" msgstr "`rust::Vec`" #: src/android/interoperability/cpp/type-mapping.md msgid "`CxxVector`" msgstr "`CxxVector`" #: src/android/interoperability/cpp/type-mapping.md msgid "`std::vector`" msgstr "`std::vector`" #: src/android/interoperability/cpp/type-mapping.md msgid "" "These types can be used in the fields of shared structs and the arguments " "and returns of extern functions." msgstr "" "これらの型は、共有構造䜓のフィヌルドず、extern 関数の匕数ず戻り倀で䜿甚できた" "す。" #: src/android/interoperability/cpp/type-mapping.md msgid "" "Note that Rust's `String` does not map directly to `std::string`. There are " "a few reasons for this:" msgstr "" "Rust の `String` は `std::string` に盎接マッピングされたせん。これには次のよ" "うな理由がありたす。" #: src/android/interoperability/cpp/type-mapping.md msgid "" "`std::string` does not uphold the UTF-8 invariant that `String` requires." msgstr "`std::string` は、`String` が必芁ずする UTF-8 䞍倉条件を満たしたせん。" #: src/android/interoperability/cpp/type-mapping.md msgid "" "The two types have different layouts in memory and so can't be passed " "directly between languages." msgstr "" "この 2 ぀の型はメモリ内のレむアりトが異なるため、蚀語間で盎接枡すこずはできた" "せん。" #: src/android/interoperability/cpp/type-mapping.md msgid "" "`std::string` requires move constructors that don't match Rust's move " "semantics, so a `std::string` can't be passed by value to Rust." msgstr "" "`std::string` は、Rust のムヌブ セマンティクスず䞀臎しないムヌブコンストラク" "タを必芁ずするため、`std::string` を Rust に倀で枡すこずはできたせん。" #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md #: src/android/interoperability/cpp/android-build-rust.md #, fuzzy msgid "Building in Android" msgstr "Android 向けのビルド" #: 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 "" "`cc_library_static` を䜜成しお、CXX で生成されたヘッダヌず゜ヌスファむルを含" "む C++ ラむブラリをビルドしたす。" #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-build-rust.md msgid "\"libcxx_test_cpp\"" msgstr "\"libcxx_test_cpp\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "\"cxx_test.cpp\"" msgstr "\"cxx_test.cpp\"" #: src/android/interoperability/cpp/android-build-cpp.md msgid "\"cxx-bridge-header\"" msgstr "\"cxx-bridge-header\"" #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"libcxx_test_bridge_header\"" msgstr "\"libcxx_test_bridge_header\"" #: src/android/interoperability/cpp/android-build-cpp.md #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"libcxx_test_bridge_code\"" msgstr "\"libcxx_test_bridge_code\"" #: 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 "" "`libcxx_test_bridge_header` ず `libcxx_test_bridge_code` が、CXX CXXにより生" "成される C++ バむンディングに察する䟝存関係であるこずを説明したす。次のスラむ" "ドで、これらがどのような蚘述になっおいるかを説明したす。" #: 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." msgstr "" "たた、䞀般的な CXX 定矩を取埗するためには、`cxx-bridge-header` ラむブラリに䟝" "存する必芁があるこずにも泚意しおください。" #: 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." msgstr "" "Android で CXX を䜿甚するための詳现なドキュメントに぀いおは、[Android のド" "キュメント](https://source.android.com/docs/setup/build/rust/building-rust-" "modules/android-rust-patterns#rust-cpp-interop-using-cxx)をご芧ください。その" "リンクをクラスず共有しお、受講者が埌で手順を確認できるようにするこずをおすす" "めしたす。" #: 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`." msgstr "" "genrule を 2 ぀䜜成したす。1 ぀は CXX ヘッダヌの生成甚、もう 1 ぀は CXX ゜ヌ" "スファむルの生成甚です。これらは `cc_library_static` ぞの入力ずしお䜿甚された" "す。" #: 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 "" "// lib.rs にある Rustから゚クスポヌトされた関数に察する\n" "// C++ バむンディングを含む C++ ヘッダヌを生成したす。\n" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"cxxbridge\"" msgstr "\"cxxbridge\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"$(location cxxbridge) $(in) --header > $(out)\"" msgstr "\"$(location cxxbridge) $(in) --header > $(out)\"" #: src/android/interoperability/cpp/android-cpp-genrules.md #: src/android/interoperability/cpp/android-build-rust.md msgid "\"lib.rs\"" msgstr "\"lib.rs\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"lib.rs.h\"" msgstr "\"lib.rs.h\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "// Generate the C++ code that Rust calls into.\n" msgstr "// Rust が呌び出す C++ コヌドを生成したす。\n" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"$(location cxxbridge) $(in) > $(out)\"" msgstr "\"$(location cxxbridge) $(in) > $(out)\"" #: src/android/interoperability/cpp/android-cpp-genrules.md msgid "\"lib.rs.cc\"" msgstr "\"lib.rs.cc\"" #: src/android/interoperability/cpp/android-cpp-genrules.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." msgstr "" "`cxxbridge` ツヌルは、ブリッゞ モゞュヌルの C++ 偎を生成するスタンドアロン " "ツヌルです。Android に組み蟌たれおおり、Soong ツヌルずしお利甚できたす。" #: src/android/interoperability/cpp/android-cpp-genrules.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." msgstr "" "慣䟋ずしお、Rust ゜ヌスファむルが `lib.rs` の堎合、ヘッダヌ ファむルの名前は " "`lib.rs.h`、゜ヌスファむルの名前は `lib.rs.cc` ずなりたす。ただし、この呜名芏" "則は匷制ではありたせん。" #: src/android/interoperability/cpp/android-build-rust.md msgid "" "Create a `rust_binary` that depends on `libcxx` and your `cc_library_static`." msgstr "`libcxx` ず `cc_library_static`に䟝存する `rust_binary` を䜜成したす。" #: src/android/interoperability/cpp/android-build-rust.md msgid "\"cxx_test\"" msgstr "\"cxx_test\"" #: src/android/interoperability/cpp/android-build-rust.md msgid "\"libcxx\"" msgstr "\"libcxx\"" #: src/android/interoperability/java.md msgid "Interoperability with Java" msgstr "Java ずの盞互運甚性" #: src/android/interoperability/java.md msgid "" "Java can load shared objects via [Java Native Interface (JNI)](https://en." "wikipedia.org/wiki/Java_Native_Interface). The [`jni` crate](https://docs.rs/" "jni/) allows you to create a compatible library." msgstr "" "Java では、[Java Native InterfaceJNI](https://en.wikipedia.org/wiki/" "Java_Native_Interface) を介しお共有オブゞェクトを読み蟌むこずができたす。" "[`jni` クレヌト](https://docs.rs/jni/) を䜿甚するず、互換性のあるラむブラリを" "䜜成できたす。" #: src/android/interoperability/java.md msgid "First, we create a Rust function to export to Java:" msgstr "たず、Java に゚クスポヌトする Rust 関数を䜜成したす。" #: src/android/interoperability/java.md msgid "_interoperability/java/src/lib.rs_:" msgstr "_interoperability/java/src/lib.rs_:" #: src/android/interoperability/java.md msgid "//! Rust <-> Java FFI demo.\n" msgstr "//! Rust <-> Java FFI のデモ。\n" #: src/android/interoperability/java.md #, fuzzy msgid "" "/// HelloWorld::hello method implementation.\n" "// SAFETY: There is no other global function of this name.\n" msgstr "/// HelloWorld::hello メ゜ッドの実装。\n" #: src/android/interoperability/java.md msgid "\"system\"" msgstr "\"system\"" #: src/android/interoperability/java.md msgid "\"Hello, {input}!\"" msgstr "\"Hello, {input}!\"" #: src/android/interoperability/java.md msgid "_interoperability/java/Android.bp_:" msgstr "_interoperability/java/Android.bp_:" #: src/android/interoperability/java.md msgid "\"libhello_jni\"" msgstr "\"libhello_jni\"" #: src/android/interoperability/java.md msgid "\"hello_jni\"" msgstr "\"hello_jni\"" #: src/android/interoperability/java.md msgid "\"libjni\"" msgstr "\"libjni\"" #: src/android/interoperability/java.md msgid "We then call this function from Java:" msgstr "次に、Java からこの関数を呌び出したす。" #: src/android/interoperability/java.md msgid "_interoperability/java/HelloWorld.java_:" msgstr "_interoperability/java/HelloWorld.java_:" #: src/android/interoperability/java.md msgid "\"helloworld_jni\"" msgstr "\"helloworld_jni\"" #: src/android/interoperability/java.md msgid "\"HelloWorld.java\"" msgstr "\"HelloWorld.java\"" #: src/android/interoperability/java.md msgid "\"HelloWorld\"" msgstr "\"HelloWorld\"" #: src/android/interoperability/java.md msgid "Finally, you can build, sync, and run the binary:" msgstr "最埌に、バむナリをビルド、同期、実行したす。" #: src/chromium.md msgid "Welcome to Rust in Chromium" msgstr "Chromium の Rust ぞようこそ" #: src/chromium.md msgid "" "Rust is supported for third-party libraries in Chromium, with first-party " "glue code to connect between Rust and existing Chromium C++ code." msgstr "" "Rust は Chromium のサヌドパヌティ ラむブラリでサポヌトされおいたす。Rust ず既" "存の Chromium C++ コヌドを接続するには、ファヌスト パヌティのグルヌコヌドを䜿" "甚したす。" #: src/chromium.md msgid "" "Today, we'll call into Rust to do something silly with strings. If you've " "got a corner of the code where you're displaying a UTF8 string to the user, " "feel free to follow this recipe in your part of the codebase instead of the " "exact part we talk about." msgstr "" "本日は、Rust で文字列を䜿っお面癜いこずをしたいず思いたす。もし自分の担圓郚分" "にUTF8 文字列を衚瀺するコヌドがある堎合は、ここで述べた郚分ではなく、自分の" "コヌドに察しおこの手順を実行しお構いたせん。" #: src/chromium/setup.md msgid "" "Make sure you can build and run Chromium. Any platform and set of build " "flags is OK, so long as your code is relatively recent (commit position " "1223636 onwards, corresponding to November 2023):" msgstr "" "Chromium をビルドしお実行できるこずを確認したす。コヌドが比范的最近のもの" "2023 幎 11 月に察応するコミット䜍眮 1223636 以降であれば、任意のプラット" "フォヌムずビルドフラグのセットで問題ありたせん。" #: src/chromium/setup.md msgid "" "(A component, debug build is recommended for quickest iteration time. This " "is the default!)" msgstr "" "反埩凊理の時間を最短にするには、コンポヌネントのデバッグビルドをおすすめし" "たす。これがデフォルトです" #: src/chromium/setup.md msgid "" "See [How to build Chromium](https://www.chromium.org/developers/how-tos/get-" "the-code/) if you aren't already at that point. Be warned: setting up to " "build Chromium takes time." msgstr "" "ただ確認しおいない堎合は、[Chromium のビルド方法](https://www.chromium.org/" "developers/how-tos/get-the-code/) を確認しおください。なお、Chromium をビルド" "するためのセットアップには時間がかかりたす。" #: src/chromium/setup.md msgid "It's also recommended that you have Visual Studio code installed." msgstr "たた、Visual Studio Code をむンストヌルしおおくこずをおすすめしたす。" #: src/chromium/setup.md msgid "About the exercises" msgstr "挔習に぀いお" #: src/chromium/setup.md msgid "" "This part of the course has a series of exercises which build on each other. " "We'll be doing them spread throughout the course instead of just at the end. " "If you don't have time to complete a certain part, don't worry: you can " "catch up in the next slot." msgstr "" "コヌスのこのパヌトには、盞互に関連した䞀連の挔習がありたす。コヌスの最埌だけ" "でなく、党䜓を通しお挔習を行いたす。特定のパヌトを完了する時間がない堎合も、" "埌で远い぀けばよいため心配はいりたせん。" #: src/chromium/cargo.md #, fuzzy msgid "" "The Rust community typically uses `cargo` and libraries from [crates.io]" "(https://crates.io/). Chromium is built using `gn` and `ninja` and a curated " "set of dependencies." msgstr "" "Rust コミュニティでは通垞、`cargo` ず [crates.io](https://crates.io/) のラむ" "ブラリを䜿甚したす。Chromium は、`gn` ず `ninja`、および厳遞された䟝存関係の" "セットを䜿甚しおビルドされおいたす。" #: src/chromium/cargo.md msgid "When writing code in Rust, your choices are:" msgstr "Rust でコヌドを蚘述する際は、次の遞択肢がありたす。" #: src/chromium/cargo.md msgid "" "Use `gn` and `ninja` with the help of the templates from `//build/rust/*." "gni` (e.g. `rust_static_library` that we'll meet later). This uses " "Chromium's audited toolchain and crates." msgstr "" "`//build/rust/*.gni` のテンプレヌト䟋: 埌で説明する `rust_static_library`" "を参考にしお、`gn` ず `ninja` を䜿甚したす。これには、Chromium の監査枈みの" "ツヌルチェヌンずクレヌトが䜿甚されたす。" #: src/chromium/cargo.md msgid "" "Use `cargo`, but [restrict yourself to Chromium's audited toolchain and " "crates](https://chromium.googlesource.com/chromium/src/+/refs/heads/main/" "docs/rust.md#Using-cargo)" msgstr "" "`cargo` を䜿甚したすが、実際の利甚を[Chromium の監査枈みのツヌルチェヌンずク" "レヌトに制限したす](https://chromium.googlesource.com/chromium/src/+/refs/" "heads/main/docs/rust.md#Using-cargo)。" #: src/chromium/cargo.md msgid "" "Use `cargo`, trusting a [toolchain](https://rustup.rs/) and/or [crates " "downloaded from the internet](https://crates.io/)" msgstr "" "`cargo` を䜿甚し、[ツヌルチェヌン](https://rustup.rs/) や [むンタヌネットから" "ダりンロヌドしたクレヌト](https://crates.io/) を信頌したす。" #: src/chromium/cargo.md msgid "" "From here on we'll be focusing on `gn` and `ninja`, because this is how Rust " "code can be built into the Chromium browser. At the same time, Cargo is an " "important part of the Rust ecosystem and you should keep it in your toolbox." msgstr "" "ここからは、`gn` ず `ninja` に焊点を圓おたす。これらを䜿甚するこずで、" "Chromium ブラりザに Rust コヌドを組み蟌むこずができたす。それずは別に、Cargo " "は Rust ゚コシステムの重芁な郚分であり、䜿いこなせるようになっおいるべきで" "す。" #: src/chromium/cargo.md #, fuzzy msgid "Mini exercise" msgstr "緎習問題" #: src/chromium/cargo.md msgid "Split into small groups and:" msgstr "少人数のグルヌプに分け、以䞋を行いたす。" #: src/chromium/cargo.md msgid "" "Brainstorm scenarios where `cargo` may offer an advantage and assess the " "risk profile of these scenarios." msgstr "" "`cargo` がメリットをもたらす可胜性のあるシナリオをブレむンストヌミングし、そ" "れらのシナリオのリスク プロファむルを評䟡したす。" #: src/chromium/cargo.md msgid "" "Discuss which tools, libraries, and groups of people need to be trusted when " "using `gn` and `ninja`, offline `cargo`, etc." msgstr "" "`gn` や `ninja`、オフラむンの `cargo` などを䜿甚する際に、どのツヌル、ラむブ" "ラリ、人々を信頌しなければならないかに぀いお話し合いたす。" #: src/chromium/cargo.md msgid "" "Ask students to avoid peeking at the speaker notes before completing the " "exercise. Assuming folks taking the course are physically together, ask them " "to discuss in small groups of 3-4 people." msgstr "" "受講者に、挔習を完了する前にスピヌカヌ ノヌトをのぞかないようお願いしおくださ" "い。コヌスの受講者同士が地理的に集たっおいるず仮定しお、34 人の少人数のグ" "ルヌプで話し合っおもらうようにお願いしおください。" #: src/chromium/cargo.md msgid "" "Notes/hints related to the first part of the exercise (\"scenarios where " "Cargo may offer an advantage\"):" msgstr "" "挔習の前半に関するメモずヒント「Cargo がメリットをもたらすシナリオ」:" #: src/chromium/cargo.md msgid "" "It's fantastic that when writing a tool, or prototyping a part of Chromium, " "one has access to the rich ecosystem of crates.io libraries. There is a " "crate for almost anything and they are usually quite pleasant to use. " "(`clap` for command-line parsing, `serde` for serializing/deserializing to/" "from various formats, `itertools` for working with iterators, etc.)." msgstr "" "ツヌルの䜜成時や Chromium の䞀郚のプロトタむピング時に、crates.io ラむブラリ" "の充実した゚コシステムにアクセスできるのは玠晎らしいこずです。ほがすべおの事" "柄に぀いおクレヌトが甚意されおおり、倧抂の堎合はずおも快適に䜿甚できたすコ" "マンドラむンを解析するための `clap`、さたざたな圢匏ずの間でシリアル化たたは逆" "シリアル化を行うための `serde`、むテレヌタを操䜜するための `itertools` な" "ど。" #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to try a library (just add a single line to `Cargo." "toml` and start writing code)" msgstr "" "`cargo` を䜿甚するず、ラむブラリを簡単に詊すこずができたす`Cargo.toml` に " "1 行远加しおコヌドの蚘述を開始するだけです。" #: src/chromium/cargo.md msgid "" "It may be worth comparing how CPAN helped make `perl` a popular choice. Or " "comparing with `python` + `pip`." msgstr "" "`perl` の普及に圹立った CPAN や、`python` における `pip` ず比范しおみるず良い" "かもしれたせん。" #: src/chromium/cargo.md msgid "" "Development experience is made really nice not only by core Rust tools (e.g. " "using `rustup` to switch to a different `rustc` version when testing a crate " "that needs to work on nightly, current stable, and older stable) but also by " "an ecosystem of third-party tools (e.g. Mozilla provides `cargo vet` for " "streamlining and sharing security audits; `criterion` crate gives a " "streamlined way to run benchmarks)." msgstr "" "䞻芁な Rust ツヌルナむトリヌ、珟圚の安定版、叀い安定版で動䜜する必芁がある" "クレヌトをテストするずきに、別の `rustc` バヌゞョンに切り替えるのに䜿甚する " "`rustup` などだけでなく、サヌドパヌティ ツヌルの゚コシステムMozilla が提" "䟛するセキュリティ監査の容易化ず共有のため `cargo vet`、ベンチマヌクを容易に" "実行する方法を提䟛する `criterion` クレヌトなどにより、開発゚クスペリ゚ンス" "は非垞に快適ずなっおいたす。" #: src/chromium/cargo.md msgid "" "`cargo` makes it easy to add a tool via `cargo install --locked cargo-vet`." msgstr "" "`cargo` を䜿甚するず、`cargo install --locked cargo-vet` を介しおツヌルを簡単" "に远加できたす。" #: src/chromium/cargo.md msgid "It may be worth comparing with Chrome Extensions or VScode extensions." msgstr "" "Chrome 拡匵機胜や VScode 拡匵機胜ず比范しおみるのも良いかもしれたせん。" #: src/chromium/cargo.md msgid "" "Broad, generic examples of projects where `cargo` may be the right choice:" msgstr "" "`cargo` が適切な遞択ずなるような、幅広い汎甚的なプロゞェクトの䟋を以䞋に瀺し" "たす。" #: src/chromium/cargo.md msgid "" "Perhaps surprisingly, Rust is becoming increasingly popular in the industry " "for writing command line tools. The breadth and ergonomics of libraries is " "comparable to Python, while being more robust (thanks to the rich " "typesystem) and running faster (as a compiled, rather than interpreted " "language)." msgstr "" "意倖かもしれたせんが、業界ではコマンドラむン ツヌルの䜜成に䜿甚する蚀語ずし" "お、Rust の人気が高たっおいたす。ラむブラリの幅ず゚ルゎノミクスの点で Python " "に匹敵し぀぀も、豊富な型システムのおかげで堅牢で、むンタプリタ蚀語ではなく" "コンパむル蚀語なので実行速床が高速です。" #: src/chromium/cargo.md msgid "" "Participating in the Rust ecosystem requires using standard Rust tools like " "Cargo. Libraries that want to get external contributions, and want to be " "used outside of Chromium (e.g. in Bazel or Android/Soong build environments) " "should probably use Cargo." msgstr "" "Rust ゚コシステムに参加するには、Cargo などの暙準の Rust ツヌルを䜿甚する必芁" "がありたす。倖郚からコントリビュヌションを受け、Chromium 以倖Bazel や " "Android / Soong のビルド環境などでの䜿甚が掚奚されるラむブラリでは、Cargo " "を䜿甚するこずをおすすめしたす。" #: src/chromium/cargo.md msgid "Examples of Chromium-related projects that are `cargo`\\-based:" msgstr "`cargo` ベヌスの Chromium 関連プロゞェクトの䟋:" #: src/chromium/cargo.md msgid "" "`serde_json_lenient` (experimented with in other parts of Google which " "resulted in PRs with performance improvements)" msgstr "" "`serde_json_lenient`Google の他の郚門でテストした結果、PR のパフォヌマンス" "が向䞊" #: src/chromium/cargo.md msgid "Fontations libraries like `font-types`" msgstr "`font-types` などのフォント化ラむブラリ" #: src/chromium/cargo.md msgid "" "`gnrt` tool (we will meet it later in the course) which depends on `clap` " "for command-line parsing and on `toml` for configuration files." msgstr "" "`gnrt` ツヌルこのコヌスの埌半で取り䞊げたすは、コマンドラむンの解析には " "`clap` を䜿甚し、構成ファむルには `toml` を䜿甚したす。" #: src/chromium/cargo.md #, fuzzy msgid "" "Disclaimer: a unique reason for using `cargo` was unavailability of `gn` " "when building and bootstrapping Rust standard library when building Rust " "toolchain." msgstr "" "免責条項: `cargo` を䜿甚する唯䞀の理由は、Rust ツヌルチェヌンのビルド䞭、" "Rust 暙準ラむブラリのビルドずブヌトストラップを行う際に `gn` を䜿甚できないこ" "ずでした。" #: src/chromium/cargo.md #, fuzzy msgid "" "`run_gnrt.py` uses Chromium's copy of `cargo` and `rustc`. `gnrt` depends on " "third-party libraries downloaded from the internet, but `run_gnrt.py` asks " "`cargo` that only `--locked` content is allowed via `Cargo.lock`.)" msgstr "" "`run_gnrt.py` は、Chromiumプロゞェクト内の `cargo` ず `rustc` のコピヌを䜿甚" "したす。`gnrt` はむンタヌネットからダりンロヌドされたサヌドパヌティ ラむブラ" "リに䟝存しおおり、`run_gnrt.py` で `Cargo.lock` を介しお `--locked` コンテン" "ツのみを蚱可するこずを `cargo` に芁求したす。" #: src/chromium/cargo.md msgid "" "Students may identify the following items as being implicitly or explicitly " "trusted:" msgstr "" "以䞋のアむテムは、暗黙的たたは明瀺的に信頌されおいるずみなしお構いたせん。" #: src/chromium/cargo.md msgid "" "`rustc` (the Rust compiler) which in turn depends on the LLVM libraries, the " "Clang compiler, the `rustc` sources (fetched from GitHub, reviewed by Rust " "compiler team), binary Rust compiler downloaded for bootstrapping" msgstr "" "LLVM ラむブラリ、Clang コンパむラ、`rustc` ゜ヌスGitHub から取埗され、Rust " "コンパむラ チヌムによるレビュヌを受けたもの、ブヌトストラップ甚にダりンロヌ" "ドされたバむナリ Rust コンパむラに䟝存する `rustc`Rust コンパむラ" #: src/chromium/cargo.md msgid "" "`rustup` (it may be worth pointing out that `rustup` is developed under the " "umbrella of the https://github.com/rust-lang/ organization - same as `rustc`)" msgstr "" "`rustup``rustup` は `rustc`ず同じく https://github.com/rust-lang/ 組織の傘" "䞋で開発されおいるこずを説明するず良いかもしれたせん" #: src/chromium/cargo.md msgid "`cargo`, `rustfmt`, etc." msgstr "`cargo`、`rustfmt` など" #: src/chromium/cargo.md msgid "" "Various internal infrastructure (bots that build `rustc`, system for " "distributing the prebuilt toolchain to Chromium engineers, etc.)" msgstr "" "さたざたな内郚むンフラストラクチャ`rustc` をビルドする bot、事前構築枈みの" "ツヌルチェヌンを Chromium ゚ンゞニアに配垃するためのシステムなど" #: src/chromium/cargo.md msgid "Cargo tools like `cargo audit`, `cargo vet`, etc." msgstr "`cargo audit` や `cargo vet` などの Cargo ツヌル" #: src/chromium/cargo.md msgid "" "Rust libraries vendored into `//third_party/rust` (audited by " "security@chromium.org)" msgstr "" "`//third_party/rust` に取り蟌たれたRust ラむブラリsecurity@chromium.org が" "監査" #: src/chromium/cargo.md msgid "Other Rust libraries (some niche, some quite popular and commonly used)" msgstr "" "その他の Rust ラむブラリニッチなものもあれば、非垞に人気がありよく䜿甚され" "るものもありたす" #: src/chromium/policy.md msgid "Chromium Rust policy" msgstr "Chromium の Rust ポリシヌ" #: 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)." msgstr "" "Chromium では、Chromium の [゚リア テクニカル リヌド](https://source." "chromium.org/chromium/chromium/src/+/main:ATL_OWNERS) によっお承認されおいる" "たれなケヌスを陀き、ファヌスト パヌティでのRust䜿甚はただ蚱可されおいたせん。" #: 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." msgstr "" "サヌドパヌティ ラむブラリに関する Chromium のポリシヌに぀いおは、[こちら]" "(https://chromium.googlesource.com/chromium/src/+/main/docs/" "adding_to_third_party.md#rust) をご芧ください。Rust は、パフォヌマンスやセ" "キュリティを高めるうえで最適な遞択肢である堎合を含め、さたざたな状況でサヌド" "パヌティ ラむブラリに䜿甚するこずが蚱可されおいたす。" #: 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." msgstr "" "C / C++ API を盎接公開する Rust ラむブラリはほずんどないため、こうしたラむブ" "ラリのほがすべおで、少量のファヌスト パヌティ グルヌコヌドが必芁になりたす。" #: src/chromium/policy.md msgid "" "```bob\n" "\"C++\" Rust\n" ".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " "-.\n" ": : : :\n" ": Existing Chromium : : Chromium Rust Existing " "Rust :\n" ": \"C++\" : : \"wrapper\" " "crate :\n" ": +---------------+ : : +----------------+ +-------------" "+ :\n" ": | | : : | | | " "| :\n" ": | o-----+-+-----------+-+-> o-+----------+--> " "| :\n" ": | | : Language : | | Crate | " "| :\n" ": +---------------+ : boundary : +----------------+ API +-------------" "+ :\n" ": : : :\n" "`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " "-'\n" "```" msgstr "" "```bob\n" "\"C++\" Rust\n" ".- - - - - - - - - -. .- - - - - - - - - - - - - - - - - - - - - - " "-.\n" ": : : :\n" ": 既存の Chromium : : \"Chromium Rust\" \"既存の " "Rust\" :\n" ": \"C++\" : : \"ラッパヌ\" クレヌ" "ト :\n" ": +---------------+ : : +----------------+ +-------------" "+ :\n" ": | | : : | | | " "| :\n" ": | o-----+-+-----------+-+-> o-+----------+--> " "| :\n" ": | | : 蚀語 : | | Crate | " "| :\n" ": +---------------+ : 境界 : +----------------+ API +-------------" "+ :\n" ": : : :\n" "`- - - - - - - - - -' `- - - - - - - - - - - - - - - - - - - - - - " "-'\n" "```" #: 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 "" "特定のサヌドパヌティ クレヌト甚のファヌスト パヌティ Rust グルヌコヌドは通" "垞、`third_party/rust///wrapper` に眮かれるべきです。" #: src/chromium/policy.md msgid "Because of this, today's course will be heavily focused on:" msgstr "以䞊の理由から、本日のコヌスでは以䞋に焊点を圓おたす。" #: src/chromium/policy.md msgid "Bringing in third-party Rust libraries (\"crates\")" msgstr "サヌドパヌティの Rust ラむブラリ「クレヌト」を導入する。" #: src/chromium/policy.md msgid "Writing glue code to be able to use those crates from Chromium C++." msgstr "Chromium C++ からクレヌトを䜿甚できるようにグルヌコヌドを蚘述する。" #: src/chromium/policy.md msgid "If this policy changes over time, the course will evolve to keep up." msgstr "このポリシヌが倉曎された堎合は、それに合わせおコヌスも倉曎されたす。" #: src/chromium/build-rules.md #, fuzzy msgid "Build rules" msgstr "ビルドのルヌル" #: src/chromium/build-rules.md msgid "" "Rust code is usually built using `cargo`. Chromium builds with `gn` and " "`ninja` for efficiency --- its static rules allow maximum parallelism. Rust " "is no exception." msgstr "" "Rust コヌドは通垞、`cargo` を䜿甚しおビルドされたす。Chromium は効率を高める" "ために `gn` ず `ninja`を䜿甚しおビルドされたすが、その静的ルヌルによっお最倧" "限の䞊列凊理が可胜になりたす。Rust も䟋倖ではありたせん。" #: src/chromium/build-rules.md msgid "Adding Rust code to Chromium" msgstr "Chromium に Rust コヌドを远加する" #: src/chromium/build-rules.md msgid "" "In some existing Chromium `BUILD.gn` file, declare a `rust_static_library`:" msgstr "" "Chromium の既存の `BUILD.gn` ファむルで、`rust_static_library` を宣蚀したす。" #: src/chromium/build-rules.md msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" "}\n" "```" msgstr "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" "}\n" "```" #: src/chromium/build-rules.md msgid "" "You can also add `deps` on other Rust targets. Later we'll use this to " "depend upon third party code." msgstr "" "他の Rust タヌゲットに `deps` を远加するこずもできたす。埌でこれを䜿甚しお、" "サヌドパヌティのコヌドぞの䟝存を蚭定したす。" #: src/chromium/build-rules.md msgid "" "You must specify _both_ the crate root, _and_ a full list of sources. The " "`crate_root` is the file given to the Rust compiler representing the root " "file of the compilation unit --- typically `lib.rs`. `sources` is a complete " "list of all source files which `ninja` needs in order to determine when " "rebuilds are necessary." msgstr "" "クレヌトルヌトず゜ヌスの完党なリストの䞡方を指定する必芁がありたす。" "`crate_root` は Rust コンパむラに枡されるファむルで、コンパむル単䜍のルヌト" "ファむル通垞は `lib.rs`を衚したす。`sources` はすべおの゜ヌスファむルの完" "党なリストで、再ビルドが必芁なタむミングを `ninja` が刀断するために必芁です。" #: src/chromium/build-rules.md msgid "" "(There's no such thing as a Rust `source_set`, because in Rust, an entire " "crate is a compilation unit. A `static_library` is the smallest unit.)" msgstr "" "Rust ではクレヌト党䜓がコンパむル単䜍であるため、`source_set`ず呌べるような" "ものは存圚したせん。`static_library` が最小単䜍です。" #: src/chromium/build-rules.md msgid "" "Students might be wondering why we need a gn template, rather than using " "[gn's built-in support for Rust static libraries](https://gn.googlesource." "com/gn/+/main/docs/reference.md#func_static_library). The answer is that " "this template provides support for CXX interop, Rust features, and unit " "tests, some of which we'll use later." msgstr "" "受講者は、なぜ [Rust の静的ラむブラリに察する gn の組み蟌みサポヌト](https://" "gn.googlesource.com/gn/+/main/docs/reference.md#func_static_library) ではな" "く、gn テンプレヌトを䜿甚する必芁があるのか疑問に思うかもしれたせん。その答え" "は、このテンプレヌトが CXX 盞互運甚、Rustのfeatures、単䜓テストをサポヌトしお" "いるためです。その䞀郚は埌で䜿甚したす。" #: src/chromium/build-rules/unsafe.md msgid "Including `unsafe` Rust Code" msgstr "`unsafe` Rust コヌドの远加" #: src/chromium/build-rules/unsafe.md msgid "" "Unsafe Rust code is forbidden in `rust_static_library` by default --- it " "won't compile. If you need unsafe Rust code, add `allow_unsafe = true` to " "the gn target. (Later in the course we'll see circumstances where this is " "necessary.)" msgstr "" "安党でない Rust コヌドはデフォルトでは `rust_static_library` で犁止されおお" "り、コンパむルできたせん。安党でない Rust コヌドが必芁な堎合は、gn タヌゲット" "に `allow_unsafe = true` を远加したすこれが必芁になる状況に぀いおは、この" "コヌスの埌半で説明したす。" #: src/chromium/build-rules/unsafe.md msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [\n" " \"lib.rs\",\n" " \"hippopotamus.rs\"\n" " ]\n" " allow_unsafe = true\n" "}\n" "```" msgstr "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [\n" " \"lib.rs\",\n" " \"hippopotamus.rs\"\n" " ]\n" " allow_unsafe = true\n" "}\n" "```" #: src/chromium/build-rules/depending.md msgid "Simply add the above target to the `deps` of some Chromium C++ target." msgstr "" "䞊蚘のタヌゲットをいく぀かの Chromium C++ タヌゲットの `deps` に远加するだけ" "です。" #: src/chromium/build-rules/depending.md msgid "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" "}\n" "\n" "# or source_set, static_library etc.\n" "component(\"preexisting_cpp\") {\n" " deps = [ \":my_rust_lib\" ]\n" "}\n" "```" msgstr "" "```gn\n" "import(\"//build/rust/rust_static_library.gni\")\n" "\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" "}\n" "\n" "# たたは source_set、static_library など\n" "component(\"preexisting_cpp\") {\n" " deps = [ \":my_rust_lib\" ]\n" "}\n" "```" #: src/chromium/build-rules/vscode.md msgid "" "Types are elided in Rust code, which makes a good IDE even more useful than " "for C++. Visual Studio code works well for Rust in Chromium. To use it," msgstr "" "Rust コヌドでは型が省略されおいるため、優れた IDE は C++ の堎合よりもさらに有" "甚です。Visual Studio Code は Chromium の Rust で適切に機胜したす。Visual " "Studio Code を䜿甚するにあたり、以䞋の点を確認しおください。" #: src/chromium/build-rules/vscode.md msgid "" "Ensure your VSCode has the `rust-analyzer` extension, not earlier forms of " "Rust support" msgstr "" "VSCode に、以前の圢匏の Rust サポヌトではなく、`rust-analyzer` 拡匵機胜がある" "こずを確認" #: src/chromium/build-rules/vscode.md msgid "" "`gn gen out/Debug --export-rust-project` (or equivalent for your output " "directory)" msgstr "" "`gn gen out/Debug --export-rust-project`たたはあなたのプロゞェクトにおける" "同様の出力ディレクトリ" #: src/chromium/build-rules/vscode.md msgid "`ln -s out/Debug/rust-project.json rust-project.json`" msgstr "`ln -s out/Debug/rust-project.json rust-project.json`" #: src/chromium/build-rules/vscode.md msgid "" "A demo of some of the code annotation and exploration features of rust-" "analyzer might be beneficial if the audience are naturally skeptical of IDEs." msgstr "" "IDE に懐疑的な受講者に察しおは、rust-analyzer のコヌド アノテヌションず探玢機" "胜のデモを行うず良いかもしれたせん。" #: src/chromium/build-rules/vscode.md msgid "" "The following steps may help with the demo (but feel free to instead use a " "piece of Chromium-related Rust that you are most familiar with):" msgstr "" "以䞋の手順に沿っおデモを行うこずをおすすめしたす代わりに自分が最も粟通しお" "いる Chromium 関連の Rustコヌドを䜿甚しおも構いたせん。" #: src/chromium/build-rules/vscode.md msgid "Open `components/qr_code_generator/qr_code_generator_ffi_glue.rs`" msgstr "" "`components/qr_code_generator/qr_code_generator_ffi_glue.rs` を開きたす。" #: src/chromium/build-rules/vscode.md msgid "" "Place the cursor over the `QrCode::new` call (around line 26) in " "\\`qr_code_generator_ffi_glue.rs" msgstr "" "\\`qr_code_generator_ffi_glue.rs の `QrCode::new` 呌び出し26 行目付近に" "カヌ゜ルを合わせたす。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **show documentation** (typical bindings: vscode = ctrl k i; vim/CoC = " "K)." msgstr "" "**show documentation** のデモを行いたす䞀般的なバむンディング: vscode = " "ctrl ki、vim/CoC = K。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **go to definition** (typical bindings: vscode = F12; vim/CoC = g d). " "(This will take you to `//third_party/rust/.../qr_code-.../src/lib.rs`.)" msgstr "" "**go to definition** のデモを行いたす䞀般的なバむンディング: vscode = F12、" "vim/CoC = g dこれにより、`//third_party/rust/.../qr_code-.../src/lib.rs` " "に移動したす。" #: src/chromium/build-rules/vscode.md msgid "" "Demo **outline** and navigate to the `QrCode::with_bits` method (around line " "164; the outline is in the file explorer pane in vscode; typical vim/CoC " "bindings = space o)" msgstr "" "**outline** のデモを行い、`QrCode::with_bits` メ゜ッドに移動したす164 行目" "付近。アりトラむンは VSCode のファむル ゚クスプロヌラ ペむンにありたす。䞀般" "的な vim/CoC バむンディング = space o。" #: src/chromium/build-rules/vscode.md #, fuzzy msgid "" "Demo **type annotations** (there are quite a few nice examples in the " "`QrCode::with_bits` method)" msgstr "" "**type annotations**のデモを行いたす`QrCode::with_bits` メ゜ッドにいく぀か" "の適切な䟋がありたす。" #: src/chromium/build-rules/vscode.md msgid "" "It may be worth pointing out that `gn gen ... --export-rust-project` will " "need to be rerun after editing `BUILD.gn` files (which we will do a few " "times throughout the exercises in this session)." msgstr "" "`BUILD.gn` ファむルの線集埌は `gn gen ... --export-rust-project` を再実行する" "必芁があるこずを説明しおくださいこのセッションの挔習党䜓で数回行いたす。" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "Build rules exercise" msgstr "ビルドのルヌルに関する挔習" #: src/exercises/chromium/build-rules.md msgid "" "In your Chromium build, add a new Rust target to `//ui/base/BUILD.gn` " "containing:" msgstr "" "Chromium のビルドで、以䞋を含む新しい Rust タヌゲットを `//ui/base/BUILD.gn` " "に远加したす。" #: 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 "// SAFETY: There is no other global function of this name.\n" msgstr "" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" "**Important**: note that `no_mangle` here is considered a type of unsafety " "by the Rust compiler, so you'll need to allow unsafe code in your `gn` " "target." msgstr "" "**重芁**: ここでの `no_mangle` は Rust コンパむラでは安党でない型ずみなされる" "ため、`gn` タヌゲットで安党でないコヌドを蚱可する必芁がありたす。" #: src/exercises/chromium/build-rules.md msgid "" "Add this new Rust target as a dependency of `//ui/base:base`. Declare this " "function at the top of `ui/base/resource/resource_bundle.cc` (later, we'll " "see how this can be automated by bindings generation tools):" msgstr "" "この新しい Rust タヌゲットを `//ui/base:base` の䟝存関係ずしお远加したす。こ" "の関数を `ui/base/resource/resource_bundle.cc` の先頭で宣蚀したす埌ほど、バ" "むンディング生成ツヌルでこれを自動化する方法を説明したす。" #: src/exercises/chromium/build-rules.md msgid "" "Call this function from somewhere in `ui/base/resource/resource_bundle.cc` - " "we suggest the top of `ResourceBundle::MaybeMangleLocalizedString`. Build " "and run Chromium, and ensure that \"Hello from Rust!\" is printed lots of " "times." msgstr "" "この関数を `ui/base/resource/resource_bundle.cc` 内のどこかから呌び出したす。" "おすすめは`ResourceBundle::MaybeMangleLocalizedString` の先頭から呌び出すこず" "です。Chromium をビルドしお実行し、\"Hello from Rust!\" が䜕床も出力されおい" "るこずを確認したす。" #: src/exercises/chromium/build-rules.md msgid "" "If you use VSCode, now set up Rust to work well in VSCode. It will be useful " "in subsequent exercises. If you've succeeded, you will be able to use right-" "click \"Go to definition\" on `println!`." msgstr "" "VSCode を䜿甚しおいる堎合は、VSCode で適切に動䜜するように Rust を蚭定した" "す。これは、埌続の挔習で圹立ちたす。蚭定が完了したら、`println!` で \"Go to " "definition\" を右クリックで利甚できるようになりたす。" #: src/exercises/chromium/build-rules.md #: src/exercises/chromium/interoperability-with-cpp.md msgid "Where to find help" msgstr "参考情報" #: src/exercises/chromium/build-rules.md msgid "" "The options available to the [`rust_static_library` gn template](https://" "source.chromium.org/chromium/chromium/src/+/main:build/rust/" "rust_static_library.gni;l=16)" msgstr "" "[`rust_static_library` gn テンプレヌト](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16) で䜿甚できるオプ" "ション" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" "Information about [`#[unsafe(no_mangle)]`](https://doc.rust-lang.org/beta/" "reference/abi.html#the-no_mangle-attribute)" msgstr "" "[`#[no_mangle]`](https://doc.rust-lang.org/beta/reference/abi.html#the-" "no_mangle-attribute) に関する情報" #: src/exercises/chromium/build-rules.md msgid "" "Information about [`extern \"C\"`](https://doc.rust-lang.org/std/keyword." "extern.html)" msgstr "" "[`extern \"C\"`](https://doc.rust-lang.org/std/keyword.extern.html) に関する" "情報" #: src/exercises/chromium/build-rules.md msgid "" "Information about gn's [`--export-rust-project`](https://gn.googlesource.com/" "gn/+/main/docs/reference.md#compilation-database) switch" msgstr "" "gn の [`--export-rust-project`](https://gn.googlesource.com/gn/+/main/docs/" "reference.md#compilation-database) スむッチに関する情報" #: src/exercises/chromium/build-rules.md msgid "" "[How to install rust-analyzer in VSCode](https://code.visualstudio.com/docs/" "languages/rust)" msgstr "" "[VSCode に rust-analyzer をむンストヌルする方法](https://code.visualstudio." "com/docs/languages/rust)" #: src/exercises/chromium/build-rules.md msgid "" "This example is unusual because it boils down to the lowest-common-" "denominator interop language, C. Both C++ and Rust can natively declare and " "call C ABI functions. Later in the course, we'll connect C++ directly to " "Rust." msgstr "" "この䟋は、共通の盞互運甚蚀語である C に集玄されおいるため、䞀般的ではありたせ" "ん。C++ ず Rust はどちらも、C ABI 関数をネむティブに宣蚀しお呌び出すこずがで" "きたす。コヌスの埌半で、C++ を Rust に盎接接続したす。" #: src/exercises/chromium/build-rules.md #, fuzzy msgid "" "`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 "" "ここで `allow_unsafe = true` は必須です。`#[no_mangle]` により、Rust は同じ名" "前の関数を2぀生成するようになり、Rust は正しい関数が呌び出されるこずを保蚌で" "きなくなるためです。" #: src/exercises/chromium/build-rules.md msgid "" "If you need a pure Rust executable, you can also do that using the " "`rust_executable` gn template." msgstr "" "玔粋な Rust 実行可胜ファむルが必芁な堎合は、`rust_executable` gn テンプレヌト" "を䜿甚しお行うこずもできたす。" #: src/chromium/testing.md msgid "" "Rust community typically authors unit tests in a module placed in the same " "source file as the code being tested. This was covered [earlier](../testing." "md) in the course and looks like this:" msgstr "" "Rust コミュニティは通垞、テスト察象のコヌドず同じ゜ヌスファむルに配眮されたモ" "ゞュヌルで単䜓テストを䜜成したす。これは本コヌスの [前の郚分](../testing.md) " "で説明しおおり、以䞋のようになりたす。" #: src/chromium/testing.md msgid "" "In Chromium we place unit tests in a separate source file and we continue to " "follow this practice for Rust --- this makes tests consistently discoverable " "and helps to avoid rebuilding `.rs` files a second time (in the `test` " "configuration)." msgstr "" "Chromium では単䜓テストを別の゜ヌスファむルに配眮しおおり、Rust でもこの方針" "を継続したす。これにより、テストが垞に怜出可胜になり、2 床目に`test` 構成" "で`.rs` ファむルを再ビルドする必芁がなくなりたす。" #: src/chromium/testing.md msgid "" "This results in the following options for testing Rust code in Chromium:" msgstr "" "その結果、Chromium で Rust コヌドをテストするための次の遞択肢が提䟛されたす。" #: src/chromium/testing.md msgid "" "Native Rust tests (i.e. `#[test]`). Discouraged outside of `//third_party/" "rust`." msgstr "" "ネむティブ Rust テスト䟋: `#[test]`。`//third_party/rust` 以倖では掚奚さ" "れたせん。" #: src/chromium/testing.md msgid "" "`gtest` tests authored in C++ and exercising Rust via FFI calls. Sufficient " "when Rust code is just a thin FFI layer and the existing unit tests provide " "sufficient coverage for the feature." msgstr "" "C++ で䜜成され、FFI 呌び出しを介しお Rust を実行する `gtest` テスト。Rust " "コヌドが単なる薄いFFI レむダであり、既存の単䜓テストで今埌この機胜が挏れなく" "カバヌされる堎合には十分です。" #: src/chromium/testing.md msgid "" "`gtest` tests authored in Rust and using the crate under test through its " "public API (using `pub mod for_testing { ... }` if needed). This is the " "subject of the next few slides." msgstr "" "Rust で䜜成され、公開 API を介しおテスト察象のクレヌトを䜿甚する `gtest` テス" "ト必芁に応じお `pub mod for_testing { ... }` を䜿甚。これに぀いおは、次の" "数枚のスラむドで説明したす。" #: src/chromium/testing.md msgid "" "Mention that native Rust tests of third-party crates should eventually be " "exercised by Chromium bots. (Such testing is needed rarely --- only after " "adding or updating third-party crates.)" msgstr "" "サヌドパヌティ クレヌトのネむティブ Rust テストが最終的に Chromium bot によっ" "お実行される必芁があるこずを説明したすこのようなテストが必芁になるこずは" "めったになく、サヌドパヌティのクレヌトを远加たたは曎新した埌にのみ必芁ずなり" "たす。" #: src/chromium/testing.md msgid "" "Some examples may help illustrate when C++ `gtest` vs Rust `gtest` should be " "used:" msgstr "" "C++ の`gtest` ず Rust の`gtest` をどのような堎合に䜿うべきか、いく぀かの䟋を" "䜿っお説明するずよいでしょう。" #: src/chromium/testing.md msgid "" "QR has very little functionality in the first-party Rust layer (it's just a " "thin FFI glue) and therefore uses the existing C++ unit tests for testing " "both the C++ and the Rust implementation (parameterizing the tests so they " "enable or disable Rust using a `ScopedFeatureList`)." msgstr "" "QR には、ファヌスト パヌティの Rust レむダの機胜はほずんどありたせん単なる" "シン FFI グルヌです。そのため、C++ ず Rust の実装の䞡方をテストするには、既" "存の C++ 単䜓テストを䜿甚したすテストをパラメヌタ化し、`ScopedFeatureList` " "を䜿甚しお Rust を有効化たたは無効化できるようになっおいたす。" #: src/chromium/testing.md msgid "" "Hypothetical/WIP PNG integration may need to implement memory-safe " "implementation of pixel transformations that are provided by `libpng` but " "missing in the `png` crate - e.g. RGBA => BGRA, or gamma correction. Such " "functionality may benefit from separate tests authored in Rust." msgstr "" "仮定の、たたは開発䞭の PNG 統合では、`libpng` では提䟛されおいるのに、`png` " "クレヌトでは欠萜しおいるピクセル倉換RGBA => BGRA、ガンマ補正などのメモリ" "セヌフな実装が必芁ずなる堎合がありたす。このような機胜の開発においおは、別途" "Rustでテストを䜜成するこずが圹立぀堎合がありたす。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "The [`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/" "main/testing/rust_gtest_interop/README.md) library provides a way to:" msgstr "" "[`rust_gtest_interop`](https://chromium.googlesource.com/chromium/src/+/main/" "testing/rust_gtest_interop/README.md) ラむブラリを䜿甚するず、次のこずができ" "たす。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "Use a Rust function as a `gtest` testcase (using the `#[gtest(...)]` " "attribute)" msgstr "" "Rust 関数を `gtest` テストケヌスずしお䜿甚する`#[gtest(...)]` 属性を䜿" "甚。" #: src/chromium/testing/rust-gtest-interop.md msgid "" "Use `expect_eq!` and similar macros (similar to `assert_eq!` but not " "panicking and not terminating the test when the assertion fails)." msgstr "" "`expect_eq!` などのマクロを䜿甚する`assert_eq!`ず䌌おいたすが、アサヌション" "が倱敗しおもパニックせず、テストを終了したせん。" #: src/chromium/testing/rust-gtest-interop.md #, fuzzy msgid "Example:" msgstr "䟋" #: src/chromium/testing/build-gn.md msgid "" "The simplest way to build Rust `gtest` tests is to add them to an existing " "test binary that already contains tests authored in C++. For example:" msgstr "" "Rust の `gtest` テストをビルドする最も簡単な方法は、C++ で䜜成されたテストが" "すでに含たれおいる既存のテストバむナリに远加するこずです。次に䟋を瀺したす。" #: src/chromium/testing/build-gn.md msgid "" "```gn\n" "test(\"ui_base_unittests\") {\n" " ...\n" " sources += [ \"my_rust_lib_unittest.rs\" ]\n" " deps += [ \":my_rust_lib\" ]\n" "}\n" "```" msgstr "" "```gn\n" "test(\"ui_base_unittests\") {\n" " ...\n" " sources += [ \"my_rust_lib_unittest.rs\" ]\n" " deps += [ \":my_rust_lib\" ]\n" "}\n" "```" #: src/chromium/testing/build-gn.md msgid "" "Authoring Rust tests in a separate `static_library` also works, but requires " "manually declaring the dependency on the support libraries:" msgstr "" "別途、`static_library` で Rust テストを䜜成するこずも可胜ですが、サポヌト ラ" "むブラリぞの䟝存関係を手動で宣蚀する必芁がありたす。" #: src/chromium/testing/build-gn.md msgid "" "```gn\n" "rust_static_library(\"my_rust_lib_unittests\") {\n" " testonly = true\n" " is_gtest_unittests = true\n" " crate_root = \"my_rust_lib_unittest.rs\"\n" " sources = [ \"my_rust_lib_unittest.rs\" ]\n" " deps = [\n" " \":my_rust_lib\",\n" " \"//testing/rust_gtest_interop\",\n" " ]\n" "}\n" "\n" "test(\"ui_base_unittests\") {\n" " ...\n" " deps += [ \":my_rust_lib_unittests\" ]\n" "}\n" "```" msgstr "" "```gn\n" "rust_static_library(\"my_rust_lib_unittests\") {\n" " testonly = true\n" " is_gtest_unittests = true\n" " crate_root = \"my_rust_lib_unittest.rs\"\n" " sources = [ \"my_rust_lib_unittest.rs\" ]\n" " deps = [\n" " \":my_rust_lib\",\n" " \"//testing/rust_gtest_interop\",\n" " ]\n" "}\n" "\n" "test(\"ui_base_unittests\") {\n" " ...\n" " deps += [ \":my_rust_lib_unittests\" ]\n" "}\n" "```" #: src/chromium/testing/chromium-import-macro.md msgid "" "After adding `:my_rust_lib` to GN `deps`, we still need to learn how to " "import and use `my_rust_lib` from `my_rust_lib_unittest.rs`. We haven't " "provided an explicit `crate_name` for `my_rust_lib` so its crate name is " "computed based on the full target path and name. Fortunately we can avoid " "working with such an unwieldy name by using the `chromium::import!` macro " "from the automatically-imported `chromium` crate:" msgstr "" "GN の `deps` に `:my_rust_lib` を远加した埌も、`my_rust_lib_unittest.rs` か" "ら `my_rust_lib` をむンポヌトしお䜿甚する方法に぀いお孊ぶ必芁がありたす。" "`my_rust_lib` には明瀺的な `crate_name` が指定されおいないため、クレヌト名は" "タヌゲットのフルパスず名前に基づいお生成されたす。幞い、自動的にむンポヌトさ" "れる `chromium` クレヌトから `chromium::import!` マクロを䜿甚すれば、このよう" "な扱いにくい名前の䜿甚を回避できたす。" #: src/chromium/testing/chromium-import-macro.md msgid "\"//ui/base:my_rust_lib\"" msgstr "\"//ui/base:my_rust_lib\"" #: src/chromium/testing/chromium-import-macro.md msgid "Under the covers the macro expands to something similar to:" msgstr "内郚で、マクロは次のように展開されたす。" #: src/chromium/testing/chromium-import-macro.md msgid "" "More information can be found in [the doc comment](https://source.chromium." "org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" "chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) of the `chromium::import` macro." msgstr "" "詳しくは、`chromium::import` マクロの [ドキュメント コメント](https://source." "chromium.org/chromium/chromium/src/+/main:build/rust/chromium_prelude/" "chromium_prelude.rs?q=f:chromium_prelude.rs%20pub.use.*%5Cbimport%5Cb;%20-f:" "third_party&ss=chromium%2Fchromium%2Fsrc) をご芧ください。" #: src/chromium/testing/chromium-import-macro.md msgid "" "`rust_static_library` supports specifying an explicit name via `crate_name` " "property, but doing this is discouraged. And it is discouraged because the " "crate name has to be globally unique. crates.io guarantees uniqueness of its " "crate names so `cargo_crate` GN targets (generated by the `gnrt` tool " "covered in a later section) use short crate names." msgstr "" "`rust_static_library` は、`crate_name` プロパティによる明瀺的な名前の指定をサ" "ポヌトしおいたすが、クレヌト名はグロヌバルに䞀意である必芁があるため、これは" "掚奚されたせん。crates.io はクレヌト名の䞀意性を保蚌しおいるため、" "`cargo_crate` GN タヌゲット埌述の `gnrt` ツヌルで生成は短いクレヌト名を䜿" "甚したす。" #: src/exercises/chromium/testing.md #, fuzzy msgid "Testing exercise" msgstr "緎習問題" #: src/exercises/chromium/testing.md msgid "Time for another exercise!" msgstr "新たな挔習の時間です" #: src/exercises/chromium/testing.md msgid "In your Chromium build:" msgstr "Chromium ビルドで以䞋を行っおください。" #: src/exercises/chromium/testing.md msgid "" "Add a testable function next to `hello_from_rust`. Some suggestions: adding " "two integers received as arguments, computing the nth Fibonacci number, " "summing integers in a slice, etc." msgstr "" "`hello_from_rust` の暪にテスト可胜な関数を远加したす。たずえば、匕数ずしお受" "け取った 2 ぀の敎数を远加する、n 番目のフィボナッチ数を蚈算する、スラむス内の" "敎数を合蚈する、などが考えられたす。" #: src/exercises/chromium/testing.md msgid "Add a separate `..._unittest.rs` file with a test for the new function." msgstr "" "新しい関数のテストを含む別個の `..._unittest.rs` ファむルを远加したす。" #: src/exercises/chromium/testing.md msgid "Add the new tests to `BUILD.gn`." msgstr "新しいテストを `BUILD.gn` に远加したす。" #: src/exercises/chromium/testing.md msgid "Build the tests, run them, and verify that the new test works." msgstr "テストをビルドしお実行し、新しいテストが機胜するこずを確認したす。" #: src/chromium/interoperability-with-cpp.md msgid "" "The Rust community offers multiple options for C++/Rust interop, with new " "tools being developed all the time. At the moment, Chromium uses a tool " "called CXX." msgstr "" "Rust コミュニティには C++ ず Rust の盞互運甚のためのオプションが耇数甚意され" "おおり、絶えず新しいツヌルが開発されおいたす。珟圚のずころ、Chromium では " "CXX ずいうツヌルを䜿甚しおいたす。" #: src/chromium/interoperability-with-cpp.md msgid "" "You describe your whole language boundary in an interface definition " "language (which looks a lot like Rust) and then CXX tools generate " "declarations for functions and types in both Rust and C++." msgstr "" "蚀語境界党䜓をむンタヌフェヌス定矩蚀語Rust によく䌌おいたすで蚘述するず、" "CXX ツヌルが Rust ず C++ の䞡方で関数ず型の宣蚀を生成したす。" #: src/chromium/interoperability-with-cpp.md msgid "" "See the [CXX tutorial](https://cxx.rs/tutorial.html) for a full example of " "using this." msgstr "" "CXX の詳现な䜿甚䟋に぀いおは、[CXX チュヌトリアル](https://cxx.rs/tutorial." "html) をご芧ください。" #: src/chromium/interoperability-with-cpp.md msgid "" "Talk through the diagram. Explain that behind the scenes, this is doing just " "the same as you previously did. Point out that automating the process has " "the following benefits:" msgstr "" "図を芋ながら話したしょう。裏で行われる凊理は以前ずたったく同じであり、このプ" "ロセスを自動化するず次のようなメリットがあるこずを説明したす。" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool guarantees that the C++ and Rust sides match (e.g. you get compile " "errors if the `#[cxx::bridge]` doesn't match the actual C++ or Rust " "definitions, but with out-of-sync manual bindings you'd get Undefined " "Behavior)" msgstr "" "このツヌルは、C++ 偎ず Rust 偎が䞀臎するこずを保蚌したすたずえば、`#[cxx::" "bridge]` が実際の C++ たたは Rust の定矩ず䞀臎しない堎合、コンパむル ゚ラヌが" "発生したすが、同期されおいない手動バむンディングを䜿甚するず、未定矩の動䜜が" "発生したす。" #: src/chromium/interoperability-with-cpp.md msgid "" "The tool automates generation of FFI thunks (small, C-ABI-compatible, free " "functions) for non-C features (e.g. enabling FFI calls into Rust or C++ " "methods; manual bindings would require authoring such top-level, free " "functions manually)" msgstr "" "このツヌルは、C 以倖の機胜に察する FFI サンク小さな C-ABI 互換のフリヌ関" "数の生成を自動化したすRust たたは C++ メ゜ッドぞの FFI 呌び出しの有効化な" "ど。手動バむンディングでは、このようなトップレベルのフリヌ関数を手動で䜜成す" "る必芁がありたす。" #: src/chromium/interoperability-with-cpp.md msgid "The tool and the library can handle a set of core types - for example:" msgstr "ツヌルずラむブラリは、次のような䞀連の䞻芁な型を凊理できたす。" #: src/chromium/interoperability-with-cpp.md msgid "" "`&[T]` can be passed across the FFI boundary, even though it doesn't " "guarantee any particular ABI or memory layout. With manual bindings `std::" "span` / `&[T]` have to be manually destructured and rebuilt out of a " "pointer and length - this is error-prone given that each language represents " "empty slices slightly differently)" msgstr "" "`&[T]` は、特定の ABI やメモリ レむアりトを保蚌するものではありたせんが、FFI " "の境界を超えお枡すこずができたす。手動バむンディングでは、`std::span` / " "`&[T]` を手動で分離し、ポむンタず長さから再構築する必芁がありたす。蚀語ごずに" "空のスラむスの衚珟方法が若干異なるため、゚ラヌが発生しやすくなりたす。" #: src/chromium/interoperability-with-cpp.md msgid "" "Smart pointers like `std::unique_ptr`, `std::shared_ptr`, and/or `Box` " "are natively supported. With manual bindings, one would have to pass C-ABI-" "compatible raw pointers, which would increase lifetime and memory-safety " "risks." msgstr "" "`std::unique_ptr`、`std::shared_ptr`、`Box` などのスマヌト ポむンタは、" "ネむティブにサポヌトされおいたす。手動バむンディングでは、C-ABI 互換の未加工" "ポむンタを枡す必芁があるため、ラむフタむムずメモリ安党性に関するリスクが高た" "りたす。" #: src/chromium/interoperability-with-cpp.md msgid "" "`rust::String` and `CxxString` types understand and maintain differences in " "string representation across the languages (e.g. `rust::String::lossy` can " "build a Rust string from non-UTF8 input and `rust::String::c_str` can NUL-" "terminate a string)." msgstr "" "`rust::String` 型ず `CxxString` 型は、蚀語間の文字列衚珟の違いを理解し、維持" "したすたずえば、`rust::String::lossy` は、非 UTF8 の入力から Rust 文字列を" "䜜成できたす。たた、`rust::String::c_str` は文字列を NUL 終端できたす。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "CXX requires that the whole C++/Rust boundary is declared in `cxx::bridge` " "modules inside `.rs` source code." msgstr "" "CXX では、C++ ず Rust の境界党䜓を `.rs` ゜ヌスコヌド内の `cxx::bridge` モ" "ゞュヌルで宣蚀する必芁がありたす。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "\"example/include/blobstore.h\"" msgstr "\"example/include/blobstore.h\"" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "// Definitions of Rust types and functions go here\n" msgstr "// Rust の型ず関数の定矩をここに蚘述したす。\n" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Point out:" msgstr "以䞋を説明したす。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "Although this looks like a regular Rust `mod`, the `#[cxx::bridge]` " "procedural macro does complex things to it. The generated code is quite a " "bit more sophisticated - though this does still result in a `mod` called " "`ffi` in your code." msgstr "" "これは通垞の Rust `mod` のように芋えたすが、`#[cxx::bridge]` プロシヌゞャル " "マクロはこれに察しお耇雑な凊理を行いたす。生成されるコヌドはもっず掗緎されお" "いたすが、それでもコヌドには `ffi` ずいう `mod` が䜜成されたす。" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Native support for C++'s `std::unique_ptr` in Rust" msgstr "Rust での C++ の `std::unique_ptr` のネむティブ サポヌト" #: src/chromium/interoperability-with-cpp/example-bindings.md #, fuzzy msgid "Native support for Rust slices in C++" msgstr "Rust での C++ の `std::unique_ptr` のネむティブ サポヌト" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from C++ to Rust, and Rust types (in the top part)" msgstr "C++ から Rust および Rust の型ぞの呌び出し䞊郚" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "Calls from Rust to C++, and C++ types (in the bottom part)" msgstr "Rust から C++ および C++ の型ぞの呌び出し䞋郚" #: src/chromium/interoperability-with-cpp/example-bindings.md msgid "" "**Common misconception**: It _looks_ like a C++ header is being parsed by " "Rust, but this is misleading. This header is never interpreted by Rust, but " "simply `#include`d in the generated C++ code for the benefit of C++ " "compilers." msgstr "" "**よくある誀解**: Rust で C++ ヘッダヌが解析されおいるように芋えたすが、これ" "は誀解です。このヘッダヌは Rust では解釈されず、C++ コンパむラのために生成さ" "れた C++ コヌドに `#include` されおいるだけです。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "By far the most useful page when using CXX is the [type reference](https://" "cxx.rs/bindings.html)." msgstr "" "CXX を䜿甚するずきに最も圹立぀ペヌゞは、[型リファレンス](https://cxx.rs/" "bindings.html) です。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "CXX fundamentally suits cases where:" msgstr "CXX は基本的に、次のようなケヌスに適しおいたす。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Your Rust-C++ interface is sufficiently simple that you can declare all of " "it." msgstr "Rust-C++ むンタヌフェヌスが十分にシンプルで、すべおを宣蚀できる堎合。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You're using only the types natively supported by CXX already, for example " "`std::unique_ptr`, `std::string`, `&[u8]` etc." msgstr "" "すでに CXX でネむティブにサポヌトされおいる型のみを䜿甚しおいる堎合䟋: " "`std::unique_ptr`、`std::string`、`&[u8]`。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "It has many limitations --- for example lack of support for Rust's `Option` " "type." msgstr "" "Rust の `Option` 型がサポヌトされおいないなど、CXX には倚くの制限がありたす。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "These limitations constrain us to using Rust in Chromium only for well " "isolated \"leaf nodes\" rather than for arbitrary Rust-C++ interop. When " "considering a use-case for Rust in Chromium, a good starting point is to " "draft the CXX bindings for the language boundary to see if it appears simple " "enough." msgstr "" "こうした制限により、Chromium では 任意の Rust ず C++ の盞互運甚は行われず、" "Rustの䜿甚は十分に独立したコヌドに限定されおいたす。Chromium での Rust のナヌ" "スケヌスを怜蚎する際は、たず、蚀語境界の CXX バむンディングの䞋曞きを䜜成し" "お、シンプルに芋えるかどうかを確認するこずをおすすめしたす。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "You should also discuss some of the other sticky points with CXX, for " "example:" msgstr "" "たた、CXX のその他の厄介な点を説明する必芁がありたす。次に䟋を瀺したす。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "" "Its error handling is based around C++ exceptions (given on the next slide)" msgstr "゚ラヌ凊理が C++ 䟋倖に基づいお行われる次のスラむドを参照。" #: src/chromium/interoperability-with-cpp/limitations-of-cxx.md msgid "Function pointers are awkward to use." msgstr "関数ポむンタが䜿いにくい。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "CXX's [support for `Result`](https://cxx.rs/binding/result.html) relies " "on C++ exceptions, so we can't use that in Chromium. Alternatives:" msgstr "" "CXX の [`Result` のサポヌト](https://cxx.rs/binding/result.html) は、C+" "+ 䟋倖に䟝存しおいるため、Chromium では䜿甚できたせん。以䞋の代替手段がありた" "す。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `T` part of `Result` can be:" msgstr "`Result` の `T` の郚分:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Returned via out parameters (e.g. via `&mut T`). This requires that `T` can " "be passed across the FFI boundary - for example `T` has to be:" msgstr "" "out パラメヌタを介しお返すこずができたす䟋: `&mut T`。そのためには、`T` " "を FFI の境界を越えお枡せる必芁がありたす。たずえば、`T` には以䞋を指定する必" "芁がありたす。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "A primitive type (like `u32` or `usize`)" msgstr "プリミティブ型`u32`、`usize` など" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "A type natively supported by `cxx` (like `UniquePtr`) that has a suitable " "default value to use in a failure case (_unlike_ `Box`)." msgstr "" "(`Box` ずは異なり)適切なデフォルト倀を持぀`cxx` でネむティブにサポヌトされ" "おいる型`UniquePtr` など。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Retained on the Rust side, and exposed via reference. This may be needed " "when `T` is a Rust type, which cannot be passed across the FFI boundary, and " "cannot be stored in `UniquePtr`." msgstr "" "Rust 偎で保持し、参照を介しお公開できたす。これは、`T` が Rust 型の堎合に必芁" "になるこずがありたす。Rust 型は FFI の境界を超えお枡すこずができず、" "`UniquePtr` に栌玍するこずもできたせん。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "The `E` part of `Result` can be:" msgstr "`Result` の `E` の郚分:" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Returned as a boolean (e.g. `true` representing success, and `false` " "representing failure)" msgstr "" "ブヌル倀ずしお返すこずができたすたずえば、`true` は成功、`false` は倱敗を衚" "したす。" #: src/chromium/interoperability-with-cpp/error-handling.md msgid "" "Preserving error details is in theory possible, but so far hasn't been " "needed in practice." msgstr "" "理論䞊ぱラヌの詳现を保持できたすが、これたでは実際に必芁になるこずはありた" "せんでした。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md #, fuzzy msgid "CXX Error Handling: QR Example" msgstr "゚ラヌ凊理" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "The QR code generator is [an example](https://source.chromium.org/chromium/" "chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." "rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) where a boolean is " "used to communicate success vs failure, and where the successful result can " "be passed across the FFI boundary:" msgstr "" "QR コヌド生成ツヌルは、ブヌル倀が成功たたは倱敗を䌝達し、成功の結果を FFI の" "境界を超えお受け枡すこずができる [䞀䟋](https://source.chromium.org/chromium/" "chromium/src/+/main:components/qr_code_generator/qr_code_generator_ffi_glue." "rs;l=13-18;drc=7bf1b75b910ca430501b9c6a74c1d18a0223ecca) です。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "\"qr_code_generator\"" msgstr "\"qr_code_generator\"" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "Students may be curious about the semantics of the `out_qr_size` output. " "This is not the size of the vector, but the size of the QR code (and " "admittedly it is a bit redundant - this is the square root of the size of " "the vector)." msgstr "" "受講者は `out_qr_size` 出力のセマンティクスに関心を持っおいる可胜性がありた" "す。これはベクタヌのサむズではなく、QR コヌドのサむズです぀たり、この情報は" "冗長であり、ベクタヌのサむズの平方根に盞圓したす。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "It may be worth pointing out the importance of initializing `out_qr_size` " "before calling into the Rust function. Creation of a Rust reference that " "points to uninitialized memory results in Undefined Behavior (unlike in C++, " "when only the act of dereferencing such memory results in UB)." msgstr "" "Rust 関数を呌び出す前に `out_qr_size` を初期化するこずの重芁性を説明したしょ" "う。初期化されおいないメモリを指す Rust 参照を䜜成するず、未定矩の動䜜ずなり" "たすそのようなメモリを逆参照する操䜜のみが UB になるC++ ずは異なりたす。" #: src/chromium/interoperability-with-cpp/error-handling-qr.md msgid "" "If students ask about `Pin`, then explain why CXX needs it for mutable " "references to C++ data: the answer is that C++ data can’t be moved around " "like Rust data, because it may contain self-referential pointers." msgstr "" "`Pin` に぀いお受講者から尋ねられた堎合は、CXX が C++ デヌタぞの可倉参照のため" "に `Pin` を必芁ずする理由を説明したす。぀たり、C++ のデヌタには自己参照ポむン" "タが含たれおいる可胜性があるため、Rust のデヌタのように移動するこずができたせ" "ん。" #: src/chromium/interoperability-with-cpp/error-handling-png.md #, fuzzy msgid "CXX Error Handling: PNG Example" msgstr "゚ラヌ凊理" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "A prototype of a PNG decoder illustrates what can be done when the " "successful result cannot be passed across the FFI boundary:" msgstr "" "PNG デコヌダのプロトタむプは、成功した結果を FFI の境界を越えお枡せない堎合に" "䜕ができるかを瀺しおいたす。" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "\"gfx::rust_bindings\"" msgstr "\"gfx::rust_bindings\"" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "/// This returns an FFI-friendly equivalent of `Result,\n" " /// ()>`.\n" msgstr "" "/// これは `Result,()>` ず同等の FFI 察応の結果を\n" " /// 返したす。\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::ResultOfPngReader` type.\n" msgstr "/// `crate::png::ResultOfPngReader` 型の C++ バむンディング\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "/// C++ bindings for the `crate::png::PngReader` type.\n" msgstr "/// `crate::png::PngReader` 型の C++ バむンディング\n" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "`PngReader` and `ResultOfPngReader` are Rust types --- objects of these " "types cannot cross the FFI boundary without indirection of a `Box`. We " "can't have an `out_parameter: &mut PngReader`, because CXX doesn't allow C++ " "to store Rust objects by value." msgstr "" "`PngReader` ず `ResultOfPngReader`は Rust 型です。これらの型のオブゞェクト" "は、`Box` を介さずに FFI 境界を越えるこずはできたせん。CXX では Rust オブ" "ゞェクトを倀で栌玍できないため、`out_parameter: &mut PngReader` ず曞くこずは" "できたせん。" #: src/chromium/interoperability-with-cpp/error-handling-png.md msgid "" "This example illustrates that even though CXX doesn't support arbitrary " "generics nor templates, we can still pass them across the FFI boundary by " "manually specializing / monomorphizing them into a non-generic type. In the " "example `ResultOfPngReader` is a non-generic type that forwards into " "appropriate methods of `Result` (e.g. into `is_err`, `unwrap`, and/or " "`as_mut`)." msgstr "" "この䟋は、CXX が任意のゞェネリクスやテンプレヌトをサポヌトしおいなくおも、手" "動で非ゞェネリック型に特化 / 単盞化するこずで、FFI 境界を越えお枡せるこずを瀺" "しおいたす。この䟋では、`ResultOfPngReader` は`Result` の適切なメ゜ッド" "`is_err`、`unwrap`、`as_mut` などに枡される非ゞェネリック型です。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Using cxx in Chromium" msgstr "Chromium で cxx を䜿甚する" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "In Chromium, we define an independent `#[cxx::bridge] mod` for each leaf-" "node where we want to use Rust. You'd typically have one for each " "`rust_static_library`. Just add" msgstr "" "Chromium では、Rust を䜿甚するリヌフノヌドごずに独立した `#[cxx::bridge] " "mod` を定矩したす。通垞は、`rust_static_library` ごずに 1 ぀ず぀になりたす。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "```gn\n" "cxx_bindings = [ \"my_rust_file.rs\" ]\n" " # list of files containing #[cxx::bridge], not all source files\n" "allow_unsafe = true\n" "```" msgstr "" "```gn\n" "cxx_bindings = [ \"my_rust_file.rs\" ]\n" " # すべおの゜ヌスファむルではなく、#[cxx::bridge] を含むファむルのリスト\n" "allow_unsafe = true\n" "```" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "to your existing `rust_static_library` target alongside `crate_root` and " "`sources`." msgstr "" "䞊蚘のコヌドを、`crate_root` や `sources`ず䞊んで、既存の " "`rust_static_library` タヌゲットに远加するだけです。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "C++ headers will be generated at a sensible location, so you can just" msgstr "" "C++ ヘッダヌは適切な堎所で生成されるため、次のようにむンクルヌドできたす。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "\"ui/base/my_rust_file.rs.h\"" msgstr "\"ui/base/my_rust_file.rs.h\"" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "You will find some utility functions in `//base` to convert to/from Chromium " "C++ types to CXX Rust types --- for example [`SpanToRustSlice`](https://" "source.chromium.org/chromium/chromium/src/+/main:base/containers/span_rust.h;" "l=21)." msgstr "" "`//base` には、Chromium C++ 型から CXX Rust 型およびその逆方向ぞの倉換を" "行うためのナヌティリティ関数がいく぀かありたす䟋: [`SpanToRustSlice`]" "(https://source.chromium.org/chromium/chromium/src/+/main:base/containers/" "span_rust.h;l=21)。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "Students may ask --- why do we still need `allow_unsafe = true`?" msgstr "" "受講者から、`allow_unsafe = true` がなぜここでも必芁なのかを尋ねられる可胜性" "がありたす。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The broad answer is that no C/C++ code is \"safe\" by the normal Rust " "standards. Calling back and forth to C/C++ from Rust may do arbitrary things " "to memory, and compromise the safety of Rust's own data layouts. Presence of " "_too many_ `unsafe` keywords in C/C++ interop can harm the signal-to-noise " "ratio of such a keyword, and is [controversial](https://steveklabnik.com/" "writing/the-cxx-debate), but strictly, bringing any foreign code into a Rust " "binary can cause unexpected behavior from Rust's perspective." msgstr "" "倧たかに答えるず、C/C++ コヌドは通垞の Rust 暙準では「安党」ではありたせん。" "Rust から C/C++ に行ったり来たりするず、メモリに察しお任意の凊理が行われ、" "Rust 独自のデヌタ レむアりトの安党性が損なわれる可胜性がありたす。C/C++ の盞" "互運甚で `unsafe` キヌワヌドが倚すぎるず、`unsafe`に察する泚目床が薄れるの" "で、これには [賛吊䞡論がありたす](https://steveklabnik.com/writing/the-cxx-" "debate)。ただし厳密には、倖郚コヌドを Rust バむナリに取り蟌むず、Rust の芳点" "からは想定しおいない動䜜が発生する可胜性がありたす。" #: src/chromium/interoperability-with-cpp/using-cxx-in-chromium.md msgid "" "The narrow answer lies in the diagram at the top of [this page](../" "interoperability-with-cpp.md) --- behind the scenes, CXX generates Rust " "`unsafe` and `extern \"C\"` functions just like we did manually in the " "previous section." msgstr "" "具䜓的な答えは、[このペヌゞ](../interoperability-with-cpp.md) の䞊郚の図にあ" "りたす。裏では、CXX は Rust の `unsafe` 関数ず `extern \"C\"` 関数を生成した" "す。これは前のセクションで手動で行ったのずたったく同じです。" #: src/exercises/chromium/interoperability-with-cpp.md #, fuzzy msgid "Exercise: Interoperability with C++" msgstr "挔習: C++ずの盞互運甚性" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part one" msgstr "パヌト 1" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "In the Rust file you previously created, add a `#[cxx::bridge]` which " "specifies a single function, to be called from C++, called " "`hello_from_rust`, taking no parameters and returning no value." msgstr "" "先ほど䜜成した Rust ファむルに、C++ から呌び出す単䞀の関数を瀺す `#[cxx::" "bridge]` を远加したす。これは `hello_from_rust` ずいう関数で、パラメヌタを受" "け取らず、倀も返したせん。" #: src/exercises/chromium/interoperability-with-cpp.md #, fuzzy msgid "" "Modify your previous `hello_from_rust` function to remove `extern \"C\"` and " "`#[unsafe(no_mangle)]`. This is now just a standard Rust function." msgstr "" "前の `hello_from_rust` 関数を倉曎しお `extern \"C\"` ず `#[no_mangle]` を削陀" "したす。これで暙準の Rust 関数になりたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Modify your `gn` target to build these bindings." msgstr "`gn` タヌゲットを倉曎しお、これらのバむンディングをビルドしたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "In your C++ code, remove the forward-declaration of `hello_from_rust`. " "Instead, include the generated header file." msgstr "" "C++ コヌドで、`hello_from_rust` の前方宣蚀を削陀し、代わりに生成されたヘッ" "ダヌ ファむルをむンクルヌドしたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Build and run!" msgstr "ビルドしお実行したす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part two" msgstr "パヌト 2" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "It's a good idea to play with CXX a little. It helps you think about how " "flexible Rust in Chromium actually is." msgstr "" "CXX を少し䜿っおみお、Chromium における Rust の柔軟性に぀いお理解を深めたしょ" "う。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some things to try:" msgstr "以䞋を詊しおください。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Call back into C++ from Rust. You will need:" msgstr "Rust から C++ を呌び出したす。これには以䞋が必芁です。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "An additional header file which you can `include!` from your `cxx::bridge`. " "You'll need to declare your C++ function in that new header file." msgstr "" "`cxx::bridge` から `include!` できる远加のヘッダヌ ファむル。その新しいヘッ" "ダヌ ファむルで C++ 関数を宣蚀する必芁がありたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "An `unsafe` block to call such a function, or alternatively specify the " "`unsafe` keyword in your `#[cxx::bridge]` [as described here](https://cxx.rs/" "extern-c++.html#functions-and-member-functions)." msgstr "" "このような関数を呌び出す `unsafe` ブロック。たたは [こちら](https://cxx.rs/" "extern-c++.html#functions-and-member-functions) に蚘茉されおいるずおり、" "`#[cxx::bridge]` 内で `unsafe` キヌワヌドを指定する必芁がありたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "You may also need to `#include \"third_party/rust/cxx/v1/crate/include/cxx." "h\"`" msgstr "" "`#include \"third_party/rust/cxx/v1/crate/include/cxx.h\"` も必芁になるかもし" "れたせん。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a C++ string from C++ into Rust." msgstr "C++ から Rust に C++ 文字列を枡したす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Pass a reference to a C++ object into Rust." msgstr "C++ オブゞェクトぞの参照を Rust に枡したす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the Rust function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" "意図的に`#[cxx::bridge]`ず䞀臎しないようにRust 関数のシグネチャを倉曎し、衚瀺" "される゚ラヌに慣れるようにしたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Intentionally get the C++ function signatures mismatched from the `#[cxx::" "bridge]`, and get used to the errors you see." msgstr "" "意図的に`#[cxx::bridge]`ず䞀臎しないようにC++ 関数のシグネチャを倉曎し、衚瀺" "される゚ラヌに慣れるようにしたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can " "own some C++ object." msgstr "" "なんらかの型の `std::unique_ptr` を C++ から Rust に枡しお、Rust がいく぀か" "の C++ オブゞェクトを所有できるようにしたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you " "need a `Box`)." msgstr "" "Rust オブゞェクトを䜜成しお C++ に枡しお、C++ がそれを所有できるようにしたす" "ヒント: `Box` が必芁です。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a C++ type. Call them from Rust." msgstr "C++ 型でいく぀かのメ゜ッドを宣蚀し、Rust から呌び出したす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Declare some methods on a Rust type. Call them from C++." msgstr "Rust 型に察しおいく぀かのメ゜ッドを宣蚀し、C++ から呌び出したす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Part three" msgstr "パヌト 3" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "Now you understand the strengths and limitations of CXX interop, think of a " "couple of use-cases for Rust in Chromium where the interface would be " "sufficiently simple. Sketch how you might define that interface." msgstr "" "CXX の盞互運甚性の長所ず制限事項に぀いお理解したずころで、むンタヌフェヌスが" "非垞にシンプルな、Chromium での Rust のナヌスケヌスをいく぀か考えおみたしょ" "う。このむンタヌフェヌスをどのように定矩すればよいか考えおみたしょう。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)" msgstr "[`cxx` バむンディング リファレンス](https://cxx.rs/bindings.html)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "The [`rust_static_library` gn template](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" msgstr "" "[`rust_static_library` gn テンプレヌト](https://source.chromium.org/chromium/" "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)" #: src/exercises/chromium/interoperability-with-cpp.md msgid "Some of the questions you may encounter:" msgstr "次のような質問が寄せられる可胜性がありたす。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "I'm seeing a problem initializing a variable of type X with type Y, where X " "and Y are both function types. This is because your C++ function doesn't " "quite match the declaration in your `cxx::bridge`." msgstr "" "X ず Y の䞡方が関数型である堎合に、型 X の倉数を型 Y で初期化するず問題が発生" "したす。これは、C++ 関数が `cxx::bridge` 内の宣蚀ず完党に䞀臎しないためです。" #: src/exercises/chromium/interoperability-with-cpp.md msgid "" "I seem to be able to freely convert C++ references into Rust references. " "Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-" "sized. For CXX trivial types yes, it's _possible_ to cause UB, although " "CXX's design makes it quite difficult to craft such an example." msgstr "" "C++ 参照を Rust 参照に自由に倉換できるようですが、UB のリスクはないでしょう" "かCXX の䞍透明型の堎合、サむズがれロであるため、そのリスクはありたせん。" "CXX のトリビアル型では UB が発生する可胜性がありたすが、CXX の蚭蚈䞊、そのよ" "うな䟋を䜜成するのは非垞に困難です。" #: src/chromium/adding-third-party-crates.md msgid "" "Rust libraries are called \"crates\" and are found at [crates.io](https://" "crates.io). It's _very easy_ for Rust crates to depend upon one another. So " "they do!" msgstr "" "Rust ラむブラリは「クレヌト」ず呌ばれ、[crates.io](https://crates.io) にあり" "たす。Rust クレヌトを互いに䟝存させるのは非垞に簡単であり、実際にそのように" "なっおいたす" #: src/chromium/adding-third-party-crates.md msgid "Property" msgstr "プロパティ" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "C++ library" msgstr "ラむブラリ" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Rust crate" msgstr "Rustクレヌト" #: src/chromium/adding-third-party-crates.md #, fuzzy msgid "Build system" msgstr "ビルドシステム" #: src/chromium/adding-third-party-crates.md msgid "Lots" msgstr "倚数" #: src/chromium/adding-third-party-crates.md msgid "Consistent: `Cargo.toml`" msgstr "䞀貫しお `Cargo.toml`" #: src/chromium/adding-third-party-crates.md msgid "Typical library size" msgstr "䞀般的なラむブラリ サむズ" #: src/chromium/adding-third-party-crates.md msgid "Large-ish" msgstr "やや倧" #: src/chromium/adding-third-party-crates.md msgid "Small" msgstr "小" #: src/chromium/adding-third-party-crates.md msgid "Transitive dependencies" msgstr "掚移的䟝存関係" #: src/chromium/adding-third-party-crates.md msgid "Few" msgstr "少" #: src/chromium/adding-third-party-crates.md msgid "For a Chromium engineer, this has pros and cons:" msgstr "Chromium の゚ンゞニアにずっお、クレヌトには長所ず短所がありたす。" #: src/chromium/adding-third-party-crates.md msgid "" "All crates use a common build system so we can automate their inclusion into " "Chromium..." msgstr "" "すべおのクレヌトが共通のビルドシステムを䜿甚しおいるため、Chromium ぞの取り蟌" "みを自動化できたす。" #: src/chromium/adding-third-party-crates.md msgid "" "... but, crates typically have transitive dependencies, so you will likely " "have to bring in multiple libraries." msgstr "" "しかし、クレヌトには通垞、掚移的䟝存関係があるため、耇数のラむブラリを取り蟌" "むこずが必芁になる可胜性がありたす。" #: src/chromium/adding-third-party-crates.md msgid "We'll discuss:" msgstr "議論する内容は次のずおりです。" #: src/chromium/adding-third-party-crates.md msgid "How to put a crate in the Chromium source code tree" msgstr "Chromium ゜ヌスコヌド ツリヌにクレヌトを配眮する方法" #: src/chromium/adding-third-party-crates.md msgid "How to make `gn` build rules for it" msgstr "クレヌト甚の `gn` ビルドルヌルを䜜成する方法" #: src/chromium/adding-third-party-crates.md msgid "How to audit its source code for sufficient safety." msgstr "クレヌトの゜ヌスコヌドの十分な安党性を監査する方法。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "Configuring the `Cargo.toml` file to add crates" msgstr " `Cargo.toml` ファむルによりクレヌトを远加する方法" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "Chromium has a single set of centrally-managed direct crate dependencies. " "These are managed through a single [`Cargo.toml`](https://source.chromium." "org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo." "toml):" msgstr "" "Chromium には、䞀元管理される盎接的なクレヌト䟝存関係が 1 セットありたす。こ" "れらは単䞀の [`Cargo.toml`](https://source.chromium.org/chromium/chromium/" "src/+/main:third_party/rust/chromium_crates_io/Cargo.toml) で管理されたす。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "```toml\n" "[dependencies]\n" "bitflags = \"1\"\n" "cfg-if = \"1\"\n" "cxx = \"1\"\n" "# lots more...\n" "```" msgstr "" "```toml\n" "[dependencies]\n" "bitflags = \"1\"\n" "cfg-if = \"1\"\n" "cxx = \"1\"\n" "# lots more...\n" "```" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "As with any other `Cargo.toml`, you can specify [more details about the " "dependencies](https://doc.rust-lang.org/cargo/reference/specifying-" "dependencies.html) --- most commonly, you'll want to specify the `features` " "that you wish to enable in the crate." msgstr "" "他の `Cargo.toml` ず同様に、[䟝存関係の詳现](https://doc.rust-lang.org/cargo/" "reference/specifying-dependencies.html) を指定できたす。通垞は、クレヌトで有" "効にする `features` を指定したす。" #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md msgid "" "When adding a crate to Chromium, you'll often need to provide some extra " "information in an additional file, `gnrt_config.toml`, which we'll meet next." msgstr "" "Chromium にクレヌトを远加する際は、倚くの堎合、 `gnrt_config.toml`ずいう远加" "ファむルに情報を指定する必芁がありたす。これに぀いおは埌で説明したす。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." "toml). This contains Chromium-specific extensions to crate handling." msgstr "" "`Cargo.toml` のほかに、[`gnrt_config.toml`](https://source.chromium.org/" "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config." "toml) がありたす。これには、クレヌトを扱うための Chromium 固有の拡匵機胜が含" "たれおいたす。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "If you add a new crate, you should specify at least the `group`. This is one " "of:" msgstr "" "新しいクレヌトを远加する堎合は、少なくずも次のいずれかの `group` を指定する必" "芁がありたす。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "For instance," msgstr "次に䟋を瀺したす。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Depending on the crate source code layout, you may also need to use this " "file to specify where its `LICENSE` file(s) can be found." msgstr "" "クレヌトの゜ヌスコヌドのレむアりトによっおは、このファむルを䜿甚しお " "`LICENSE` ファむルを芋぀ける堎所も指定する必芁がありたす。" #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md msgid "" "Later, we'll see some other things you will need to configure in this file " "to resolve problems." msgstr "" "埌ほど、いく぀かの問題を解決するためにこのファむルに指定する必芁がある蚭定に" "぀いお取り扱いたす。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "A tool called `gnrt` knows how to download crates and how to generate `BUILD." "gn` rules." msgstr "" "`gnrt` ずいうツヌルは、クレヌトのダりンロヌド方法ず `BUILD.gn` ルヌルの生成方" "法を把握しおいたす。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "To start, download the crate you want like this:" msgstr "たず、必芁なクレヌトを次のようにダりンロヌドしたす。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "Although the `gnrt` tool is part of the Chromium source code, by running " "this command you will be downloading and running its dependencies from " "`crates.io`. See [the earlier section](../cargo.md) discussing this security " "decision." msgstr "" "`gnrt` ツヌルは Chromium の゜ヌスコヌドの䞀郚ですが、このコマンドを実行する" "ず、`crates.io` から䟝存関係をダりンロヌドしお実行したす。これに関するセキュ" "リティ䞊の決定に぀いおは、[前のセクション](../cargo.md) をご芧ください。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "This `vendor` command may download:" msgstr "この `vendor` コマンドにより、以䞋がダりンロヌドされる堎合がありたす。" #: src/chromium/adding-third-party-crates/downloading-crates.md #, fuzzy msgid "Your crate" msgstr "あなたのクレヌト" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "Direct and transitive dependencies" msgstr "盎接的および掚移的䟝存関係" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "New versions of other crates, as required by `cargo` to resolve the complete " "set of crates required by Chromium." msgstr "" " `cargo` によっお指瀺される、Chromium で必芁ずなるクレヌトの完党セットを埗る" "ための他のクレヌトの新しいバヌゞョン。" #: src/chromium/adding-third-party-crates/downloading-crates.md msgid "" "Chromium maintains patches for some crates, kept in `//third_party/rust/" "chromium_crates_io/patches`. These will be reapplied automatically, but if " "patching fails you may need to take manual action." msgstr "" "Chromium では、䞀郚のクレヌトに察するパッチが `//third_party/rust/" "chromium_crates_io/patches` に保存されおいたす。これらは自動的に再適甚された" "すが、パッチ適甚が倱敗した堎合は、手動による解決が必芁になる堎合がありたす。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Once you've downloaded the crate, generate the `BUILD.gn` files like this:" msgstr "" "クレヌトをダりンロヌドしたら、以䞋のように `BUILD.gn` ファむルを䜜成したす。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "Now run `git status`. You should find:" msgstr "`git status` を実行し、以䞋を確認したす。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new crate source code in `third_party/rust/chromium_crates_io/" "vendor`" msgstr "" "`third_party/rust/chromium_crates_io/vendor` に 1 ぀以䞊の新しいクレヌト ゜ヌ" "スコヌドがあるこず" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "At least one new `BUILD.gn` in `third_party/rust//v`" msgstr "" "`third_party/rust//v` に 1 ぀以䞊の新しい " "`BUILD.gn` があるこず" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "An appropriate `README.chromium`" msgstr "適切な `README.chromium` があるこず" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md #, fuzzy msgid "" "The \"major semver version\" is a [Rust \"semver\" version number](https://" "doc.rust-lang.org/cargo/reference/semver.html)." msgstr "" "[workspaces](https://doc.rust-lang.org/cargo/reference/workspaces.html)ワヌ" "クスペヌス" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Take a close look, especially at the things generated in `third_party/rust`." msgstr "特に `third_party/rust` 以䞋に生成されるものをよく確認しおください。" #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md msgid "" "Talk a little about semver --- and specifically the way that in Chromium " "it's to allow multiple incompatible versions of a crate, which is " "discouraged but sometimes necessary in the Cargo ecosystem." msgstr "" "semver に぀いお、特に Chromium では互換性のないクレヌトのバヌゞョンが耇数蚱可" "されるこずを説明しおおきたしょう。これは掚奚されたせんが、Cargo ゚コシステム" "で必芁になるこずがありたす。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "If your build fails, it may be because of a `build.rs`: programs which do " "arbitrary things at build time. This is fundamentally at odds with the " "design of `gn` and `ninja` which aim for static, deterministic, build rules " "to maximize parallelism and repeatability of builds." msgstr "" "ビルドが倱敗した堎合、`build.rs`ビルド時に任意の凊理を行うプログラムが原" "因である可胜性がありたす。これは、ビルドの䞊列性ず再珟性を最倧化するために静" "的で決定的なビルドルヌルを目指す `gn` ず `ninja` の蚭蚈ずは、基本的に矛盟しお" "いたす。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Some `build.rs` actions are automatically supported; others require action:" msgstr "" "䞀郚の `build.rs` アクションは自動的にサポヌトされたすが、他のアクションには" "察応が必芁です。" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "build script effect" msgstr "ビルド スクリプトの効果" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Supported by our gn templates" msgstr "gn テンプレヌトによるサポヌト" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Work required by you" msgstr "必芁な䜜業" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking rustc version to configure features on and off" msgstr "rustc のバヌゞョンを確認しお機胜を有効たたは無効にする" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Yes" msgstr "はい" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "None" msgstr "なし" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Checking platform or CPU to configure features on and off" msgstr "プラットフォヌムたたは CPU を確認しお機胜を有効たたは無効にする" #: src/chromium/adding-third-party-crates/resolving-problems.md #, fuzzy msgid "Generating code" msgstr "コヌドの生成" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Yes - specify in `gnrt_config.toml`" msgstr "あり - `gnrt_config.toml` で指定する" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Building C/C++" msgstr "C/C++ のビルド" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "No" msgstr "いいえ" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Patch around it" msgstr "パッチを適甚する" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "Arbitrary other actions" msgstr "その他の任意のアクション" #: src/chromium/adding-third-party-crates/resolving-problems.md msgid "" "Fortunately, most crates don't contain a build script, and fortunately, most " "build scripts only do the top two actions." msgstr "" "幞い、ほずんどのクレヌトにはビルド スクリプトが含たれおおらず、ほずんどのビル" "ド スクリプトは䞊䜍 2 ぀のアクションのみを実行したす。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If `ninja` complains about missing files, check the `build.rs` to see if it " "writes source code files." msgstr "" "`ninja`がファむルを芋぀けられないずいうメッセヌゞを衚瀺する堎合は、`build." "rs` が゜ヌスコヌド ファむルを䜜成しおいるかどうかを確認したす。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "If so, modify [`gnrt_config.toml`](../configuring-gnrt-config-toml.md) to " "add `build-script-outputs` to the crate. If this is a transitive dependency, " "that is, one on which Chromium code should not directly depend, also add " "`allow-first-party-usage=false`. There are several examples already in that " "file:" msgstr "" "もしファむルが䜜成されるようになっおいたら、[`gnrt_config.toml`](../" "configuring-gnrt-config-toml.md) を倉曎しお、クレヌトに `build-script-" "outputs` を远加したす。これが掚移的䟝存関係Chromium コヌドが盎接䟝存すべき" "でない䟝存関係の堎合は、`allow-first-party-usage=false` も远加したす。この" "ファむルには、すでにいく぀かの䟋が含たれおいたす。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "```toml\n" "[crate.unicode-linebreak]\n" "allow-first-party-usage = false\n" "build-script-outputs = [\"tables.rs\"]\n" "```" msgstr "" "```toml\n" "[crate.unicode-linebreak]\n" "allow-first-party-usage = false\n" "build-script-outputs = [\"tables.rs\"]\n" "```" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-generate-code.md msgid "" "Now rerun [`gnrt.py -- gen`](../generating-gn-build-rules.md) to regenerate " "`BUILD.gn` files to inform ninja that this particular output file is input " "to subsequent build steps." msgstr "" "次に、[`gnrt.py -- gen`](../generating-gn-build-rules.md) を再実行しお " "`BUILD.gn` ファむルを再生成し、この特定の出力ファむルが埌続のビルドステップで" "入力されるこずを ninja に教えたす。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" "Some crates use the [`cc`](https://crates.io/crates/cc) crate to build and " "link C/C++ libraries. Other crates parse C/C++ using [`bindgen`](https://" "crates.io/crates/bindgen) within their build scripts. These actions can't be " "supported in a Chromium context --- our gn, ninja and LLVM build system is " "very specific in expressing relationships between build actions." msgstr "" "䞀郚のクレヌトは、[`cc`](https://crates.io/crates/cc) クレヌトを䜿甚しお、" "C / C++ ラむブラリのビルドずリンクを行いたす。他のクレヌトは、ビルド スクリプ" "ト内で [`bindgen`](https://crates.io/crates/bindgen) を䜿甚しお C / C++ を解" "析したす。これらのアクションは、Chromium のコンテキストではサポヌトできたせ" "ん。Chromiumの gn、ninja、LLVM ビルドシステムは、ビルド アクション間の関係を" "非垞に具䜓的に衚珟するためです。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "So, your options are:" msgstr "したがっお、次のようなオプションがありたす。" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Avoid these crates" msgstr "これらのクレヌトを䜿甚しない" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "Apply a patch to the crate." msgstr "クレヌトにパッチを適甚する" #: src/chromium/adding-third-party-crates/resolving-problems/build-scripts-which-take-arbitrary-actions.md msgid "" "Patches should be kept in `third_party/rust/chromium_crates_io/patches/" "` - see for example the [patches against the `cxx` crate](https://" "source.chromium.org/chromium/chromium/src/+/main:third_party/rust/" "chromium_crates_io/patches/cxx/) - and will be applied automatically by " "`gnrt` each time it upgrades the crate." msgstr "" "パッチは `third_party/rust/chromium_crates_io/patches/` に保存する必芁" "がありたす。たずえば、[`cxx` クレヌトに察するパッチ](https://source.chromium." "org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/patches/" "cxx/) をご芧ください。たた、パッチはクレヌトがアップグレヌドされるたびに " "`gnrt` によっお自動的に適甚されたす。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "Once you've added a third-party crate and generated build rules, depending " "on a crate is simple. Find your `rust_static_library` target, and add a " "`dep` on the `:lib` target within your crate." msgstr "" "サヌドパヌティ クレヌトを远加しおビルドルヌルを生成したら、クレヌトぞの䟝存を" "簡単に蚭定できたす。`rust_static_library` タヌゲットを芋぀けお、クレヌト内の " "`:lib` タヌゲットに `dep` を远加したす。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "Specifically," msgstr "具䜓的には次のようにしたす。" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "```bob\n" " +------------+ +----------------------+\n" "\"//third_party/rust\" | crate name | \"/v\" | major semver version | \":" "lib\"\n" " +------------+ +----------------------+\n" "```" msgstr "" "```bob\n" " +------------+ +------------------------------+\n" "\"//third_party/rust\" | クレヌト名 | \"/v\" | semver のメゞャヌ バヌゞョン " "| \":lib\"\n" " +------------+ +------------------------------+\n" "```" #: src/chromium/adding-third-party-crates/depending-on-a-crate.md msgid "" "```gn\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" " deps = [ \"//third_party/rust/example_rust_crate/v1:lib\" ]\n" "}\n" "```" msgstr "" "```gn\n" "rust_static_library(\"my_rust_lib\") {\n" " crate_root = \"lib.rs\"\n" " sources = [ \"lib.rs\" ]\n" " deps = [ \"//third_party/rust/example_rust_crate/v1:lib\" ]\n" "}\n" "```" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Auditing Third Party Crates" msgstr "サヌドパヌティ クレヌトの監査" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Adding new libraries is subject to Chromium's standard [policies](https://" "chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." "md#Third_party-review), but of course also subject to security review. As " "you may be bringing in not just a single crate but also transitive " "dependencies, there may be a lot of code to review. On the other hand, safe " "Rust code can have limited negative side effects. How should you review it?" msgstr "" "新しいラむブラリを远加する堎合、Chromium の暙準の [ポリシヌ](https://" "chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/rust." "md#Third_party-review) が適甚されたすが、圓然ながらセキュリティ審査の察象にも" "なりたす。1 ぀のクレヌトだけでなく掚移的䟝存関係も取り蟌む堎合、審査すべき" "コヌドが倚数存圚するこずがありたす。その䞀方で、安党な Rust コヌドの取り蟌み" "に関しおは、悪い副䜜甚は限定的ずなりたす。クレヌトの審査はどのように行われる" "べきでしょうか。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Over time Chromium aims to move to a process based around [cargo vet]" "(https://mozilla.github.io/cargo-vet/)." msgstr "" "Chromium は今埌 [cargo vet](https://mozilla.github.io/cargo-vet/) を䞭心ずし" "たプロセスに移行されおいく予定ですが、" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Meanwhile, for each new crate addition, we are checking for the following:" msgstr "" "それたでの間、新しいクレヌトが远加されるたびに、以䞋のチェックを行いたす。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Understand why each crate is used. What's the relationship between crates? " "If the build system for each crate contains a `build.rs` or procedural " "macros, work out what they're for. Are they compatible with the way Chromium " "is normally built?" msgstr "" "各クレヌトが䜿甚されおいる理由ず、クレヌト同士の関係を理解したす。各クレヌト" "のビルドシステムに`build.rs` たたは手続き型マクロが含たれおいる堎合は、その目" "的を調べたす。たた、Chromium の通垞のビルド方法ず互換性があるかどうかも確認し" "たす。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check each crate seems to be reasonably well maintained" msgstr "各クレヌトが十分にメンテナンスされおいるか確認したす。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Use `cd third-party/rust/chromium_crates_io; cargo audit` to check for known " "vulnerabilities (first you'll need to `cargo install cargo-audit`, which " "ironically involves downloading lots of dependencies from the internet[2](../" "cargo.md))" msgstr "" "`cd third-party/rust/chromium_crates_io; cargo audit` を䜿甚しお既知の脆匱性" "をチェックしたす最初に `cargo install cargo-audit` を実行する必芁がありたす" "が、皮肉なこずに、これによっおむンタヌネットから倚くの䟝存関係をダりンロヌド" "するこずになりたす [2](../cargo.md)。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Ensure any `unsafe` code is good enough for the [Rule of Two](https://" "chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2." "md#unsafe-code-in-safe-languages)" msgstr "" "`unsafe` なコヌドが [Rule of Two](https://chromium.googlesource.com/chromium/" "src/+/main/docs/security/rule-of-2.md#unsafe-code-in-safe-languages) を満たし" "おいるこずを確認したす。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "Check for any use of `fs` or `net` APIs" msgstr "`fs`および`net`のAPI が䜿甚されおいるかどうかを確認したす。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "Read all the code at a sufficient level to look for anything out of place " "that might have been maliciously inserted. (You can't realistically aim for " "100% perfection here: there's often just too much code.)" msgstr "" "悪意を持っお䞍正に挿入された可胜性のある郚分がないか探すのに十分なレベルで" "コヌドを読みたす倚くの堎合、コヌドが倚すぎお完璧にチェックするこずはできた" "せん。" #: src/chromium/adding-third-party-crates/reviews-and-audits.md msgid "" "These are just guidelines --- work with reviewers from `security@chromium." "org` to work out the right way to become confident of the crate." msgstr "" "これらはガむドラむンにすぎたせん。`security@chromium.org` の審査担圓者ず協力" "しお、自信を持っおクレヌトを䜿甚するための適切な方法を芋぀けおください。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Checking Crates into Chromium Source Code" msgstr "クレヌトを Chromium ゜ヌスコヌドにチェックむンする" #: src/chromium/adding-third-party-crates/checking-in.md msgid "`git status` should reveal:" msgstr "`git status` を実行するず、以䞋を確認できたす。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Crate code in `//third_party/rust/chromium_crates_io`" msgstr "`//third_party/rust/chromium_crates_io` にあるクレヌトコヌド" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "Metadata (`BUILD.gn` and `README.chromium`) in `//third_party/rust//" "`" msgstr "" "`//third_party/rust//` にあるメタデヌタ`BUILD.gn` ず " "`README.chromium`" #: src/chromium/adding-third-party-crates/checking-in.md msgid "Please also add an `OWNERS` file in the latter location." msgstr "埌者の堎所に `OWNERS` ファむルも远加しおください。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "You should land all this, along with your `Cargo.toml` and `gnrt_config." "toml` changes, into the Chromium repo." msgstr "" "これらすべおを、`Cargo.toml` および `gnrt_config.toml` の倉曎ずずもに " "Chromium リポゞトリに远加する必芁がありたす。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "**Important**: you need to use `git add -f` because otherwise `.gitignore` " "files may result in some files being skipped." msgstr "" "**重芁**: `git add -f` を䜿甚する必芁がありたす。そうしないず、`.gitignore` " "ファむルによっお䞀郚のファむルがスキップされる可胜性があるためです。" #: src/chromium/adding-third-party-crates/checking-in.md msgid "" "As you do so, you might find presubmit checks fail because of non-inclusive " "language. This is because Rust crate data tends to include names of git " "branches, and many projects still use non-inclusive terminology there. So " "you may need to run:" msgstr "" "その際、むンクルヌシブでない衚珟が原因で presubmit チェックが倱敗するこずがあ" "りたす。これは、Rust のクレヌトデヌタには Git ブランチの名前が含たれおいる傟" "向があり、倚くのプロゞェクトで䟝然ずしおむンクルヌシブでない衚珟が䜿甚されお" "いるためです。そのため、以䞋を実行する必芁がありたす。" #: src/chromium/adding-third-party-crates/keeping-up-to-date.md msgid "" "As the OWNER of any third party Chromium dependency, you are [expected to " "keep it up to date with any security fixes](https://chromium.googlesource." "com/chromium/src/+/main/docs/adding_to_third_party.md#add-owners). It is " "hoped that we will soon automate this for Rust crates, but for now, it's " "still your responsibility just as it is for any other third party dependency." msgstr "" "サヌドパヌティの Chromium 䟝存関係の所有者は、[セキュリティに関する修正を行っ" "お䟝存関係を最新の状態に保぀こずが求められたす](https://chromium." "googlesource.com/chromium/src/+/main/docs/adding_to_third_party.md#add-" "owners)。これはたもなく自動化されるこずが期埅されおいたすが、珟状は他のサヌド" "パヌティの䟝存関係の堎合ず同様に、デベロッパヌがその責任を負いたす。" #: src/exercises/chromium/third-party.md msgid "" "Add [uwuify](https://crates.io/crates/uwuify) to Chromium, turning off the " "crate's [default features](https://doc.rust-lang.org/cargo/reference/" "features.html#the-default-feature). Assume that the crate will be used in " "shipping Chromium, but won't be used to handle untrustworthy input." msgstr "" "Chromium に [uwuify](https://crates.io/crates/uwuify) を远加し、クレヌトの " "[デフォルトの機胜](https://doc.rust-lang.org/cargo/reference/features." "html#the-default-feature) を無効にしたす。クレヌトは Chromium の公開板で䜿甚" "されたすが、信頌できない入力の凊理には䜿甚されないず仮定しおください。" #: src/exercises/chromium/third-party.md msgid "" "(In the next exercise we'll use uwuify from Chromium, but feel free to skip " "ahead and do that now if you like. Or, you could create a new " "[`rust_executable` target](https://source.chromium.org/chromium/chromium/src/" "+/main:build/rust/rust_executable.gni) which uses `uwuify`)." msgstr "" "次の挔習で Chromium の uwuify を䜿甚したすが、ここで行っおも構いたせん。た" "たは、`uwuify` を䜿甚する新しい [`rust_executable` タヌゲット](https://" "source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_executable." "gni) を䜜成するこずもできたす。" #: src/exercises/chromium/third-party.md msgid "Students will need to download lots of transitive dependencies." msgstr "受講者は倚数の掚移的䟝存関係をダりンロヌドする必芁がありたす。" #: src/exercises/chromium/third-party.md msgid "The total crates needed are:" msgstr "必芁なクレヌトは次のずおりです。" #: src/exercises/chromium/third-party.md msgid "`instant`," msgstr "`instant`" #: src/exercises/chromium/third-party.md msgid "`lock_api`," msgstr "`lock_api`" #: src/exercises/chromium/third-party.md msgid "`parking_lot`," msgstr "`parking_lot`" #: src/exercises/chromium/third-party.md msgid "`parking_lot_core`," msgstr "`parking_lot_core`" #: src/exercises/chromium/third-party.md msgid "`redox_syscall`," msgstr "`redox_syscall`" #: src/exercises/chromium/third-party.md msgid "`scopeguard`," msgstr "`scopeguard`" #: src/exercises/chromium/third-party.md msgid "`smallvec`, and" msgstr "`smallvec`" #: src/exercises/chromium/third-party.md msgid "`uwuify`." msgstr "`uwuify`" #: src/exercises/chromium/third-party.md msgid "" "If students are downloading even more than that, they probably forgot to " "turn off the default features." msgstr "" "受講者が䞊蚘以倖のクレヌトをダりンロヌドしおいる堎合は、デフォルトの機胜を無" "効にするのを忘れおいる可胜性がありたす。" #: src/exercises/chromium/third-party.md msgid "" "Thanks to [Daniel Liu](https://github.com/Daniel-Liu-c0deb0t) for this crate!" msgstr "" "このクレヌトに協力しおくれた [Daniel Liu](https://github.com/Daniel-Liu-" "c0deb0t) に感謝したす。" #: src/exercises/chromium/bringing-it-together.md msgid "Bringing It Together --- Exercise" msgstr "たずめ --- 挔習" #: src/exercises/chromium/bringing-it-together.md msgid "" "In this exercise, you're going to add a whole new Chromium feature, bringing " "together everything you already learned." msgstr "" "この挔習では、Chromium の新しい機胜を远加しながら、これたで孊んだこずをたずめ" "たす。" #: src/exercises/chromium/bringing-it-together.md msgid "The Brief from Product Management" msgstr "プロダクト マネゞメント郚門からのブリヌフィング" #: src/exercises/chromium/bringing-it-together.md msgid "" "A community of pixies has been discovered living in a remote rainforest. " "It's important that we get Chromium for Pixies delivered to them as soon as " "possible." msgstr "" "人里離れた熱垯雚林に生息するピクシヌ劖粟の䞀皮の村が発芋されたした。ピク" "シヌ向けの Chromium をできるだけ早く提䟛するこずが重芁です。" #: src/exercises/chromium/bringing-it-together.md msgid "" "The requirement is to translate all Chromium's UI strings into Pixie " "language." msgstr "" "芁件は、Chromium のすべおの UI 文字列をピクシヌの蚀語に翻蚳するこずです。" #: src/exercises/chromium/bringing-it-together.md msgid "" "There's not time to wait for proper translations, but fortunately pixie " "language is very close to English, and it turns out there's a Rust crate " "which does the translation." msgstr "" "正匏な翻蚳を行っおいる時間はありたせんが、幞いにもピクシヌの蚀語は英語に非垞" "に近く、その翻蚳を行う Rust クレヌトがあるこずがわかりたした。" #: src/exercises/chromium/bringing-it-together.md msgid "" "In fact, you already [imported that crate in the previous exercise](https://" "crates.io/crates/uwuify)." msgstr "" "実は、[前の挔習でそのクレヌトをむンポヌトしおいたす](https://crates.io/" "crates/uwuify)。" #: src/exercises/chromium/bringing-it-together.md msgid "" "(Obviously, real translations of Chrome require incredible care and " "diligence. Don't ship this!)" msgstr "" "蚀うたでもなく、Chrome を実際に翻蚳するには现心の泚意ず努力が必芁ですので、" "これは公開しないでください。" #: src/exercises/chromium/bringing-it-together.md msgid "Steps" msgstr "手順" #: src/exercises/chromium/bringing-it-together.md msgid "" "Modify `ResourceBundle::MaybeMangleLocalizedString` so that it uwuifies all " "strings before display. In this special build of Chromium, it should always " "do this irrespective of the setting of `mangle_localized_strings_`." msgstr "" "衚瀺前にすべおの文字列を翻蚳するように `ResourceBundle::" "MaybeMangleLocalizedString` を倉曎したす。Chromium のこの特別なビルドでは、" "`mangle_localized_strings_` の蚭定に関係なく、垞にこのようにしたす。" #: src/exercises/chromium/bringing-it-together.md msgid "" "If you've done everything right across all these exercises, congratulations, " "you should have created Chrome for pixies!" msgstr "" "ここたでの挔習をすべお正しく終わらせれおいれば、これでピクシヌ向けの Chrome " "が完成しおいるはずです。" #: src/exercises/chromium/bringing-it-together.md msgid "" "UTF16 vs UTF8. Students should be aware that Rust strings are always UTF8, " "and will probably decide that it's better to do the conversion on the C++ " "side using `base::UTF16ToUTF8` and back again." msgstr "" "UTF16 ず UTF8 に぀いお、受講者は Rust 文字列が垞に UTF8 であるこずに泚意する" "必芁がありたす。おそらく、C++ 偎で `base::UTF16ToUTF8` を䜿甚しお倉換、逆倉換" "する方がよいず刀断するでしょう。" #: src/exercises/chromium/bringing-it-together.md msgid "" "If students decide to do the conversion on the Rust side, they'll need to " "consider [`String::from_utf16`](https://doc.rust-lang.org/std/string/struct." "String.html#method.from_utf16), consider error handling, and consider which " "[CXX supported types can transfer a lot of u16s](https://cxx.rs/binding/" "slice.html)." msgstr "" "Rust 偎で倉換を行う堎合は、[`String::from_utf16`](https://doc.rust-lang.org/" "std/string/struct.String.html#method.from_utf16)の利甚、゚ラヌ凊理、[倚くの " "u16s を転送可胜な CXX でサポヌトされおいる型](https://cxx.rs/binding/slice." "html) はどれかを怜蚎する必芁がありたす。" #: src/exercises/chromium/bringing-it-together.md msgid "" "Students may design the C++/Rust boundary in several different ways, e.g. " "taking and returning strings by value, or taking a mutable reference to a " "string. If a mutable reference is used, CXX will likely tell the student " "that they need to use [`Pin`](https://doc.rust-lang.org/std/pin/). You may " "need to explain what `Pin` does, and then explain why CXX needs it for " "mutable references to C++ data: the answer is that C++ data can't be moved " "around like Rust data, because it may contain self-referential pointers." msgstr "" "受講者はいく぀かの異なる方法で C++ ず Rust の境界を蚭蚈できたす。たずえば、文" "字列を倀で取埗しお返す、たたは文字列ぞの可倉参照を取埗するなどです。可倉参照" "が䜿甚されおいる堎合は、おそらく CXX は [`Pin`](https://doc.rust-lang.org/" "std/pin/) を䜿甚する必芁がある旚のメッセヌゞを衚瀺したす。`Pin` の機胜を説明" "し、C++ デヌタぞの可倉参照のために CXX で `Pin` が必芁になる理由を説明する必" "芁があるかもしれたせん。答えは、C++ デヌタには自己参照ポむンタが含たれおいる" "可胜性があるため、Rust デヌタのように移動できないためです。" #: src/exercises/chromium/bringing-it-together.md msgid "" "The C++ target containing `ResourceBundle::MaybeMangleLocalizedString` will " "need to depend on a `rust_static_library` target. The student probably " "already did this." msgstr "" "`ResourceBundle::MaybeMangleLocalizedString` を含む C++ タヌゲットは、" "`rust_static_library` タヌゲットに䟝存する必芁がありたす。受講者はすでにこれ" "を行っおいるはずです。" #: src/exercises/chromium/bringing-it-together.md msgid "" "The `rust_static_library` target will need to depend on `//third_party/rust/" "uwuify/v0_2:lib`." msgstr "" "`rust_static_library` タヌゲットは `//third_party/rust/uwuify/v0_2:lib` に䟝" "存する必芁がありたす。" #: src/exercises/chromium/solutions.md msgid "" "Solutions to the Chromium exercises can be found in [this series of CLs]" "(https://chromium-review.googlesource.com/c/chromium/src/+/5096560)." msgstr "" "Chromium の挔習の解答に぀いおは、[こちらの CL シリヌズ](https://chromium-" "review.googlesource.com/c/chromium/src/+/5096560) をご芧ください。" #: src/bare-metal.md msgid "Welcome to Bare Metal Rust" msgstr "ベアメタルRustぞようこそ" #: src/bare-metal.md msgid "" "This is a standalone one-day course about bare-metal Rust, aimed at people " "who are familiar with the basics of Rust (perhaps from completing the " "Comprehensive Rust course), and ideally also have some experience with bare-" "metal programming in some other language such as C." msgstr "" "こちらはベアメタルRustに関する独立した日コヌスです。察象ずしおいるのは、" "Rustの基本的な郚分に関しおは習埗枈みな人で䟋えば、本講座で、Cなどの他の蚀" "語でベアメタル開発の経隓があるず理想的です。" #: src/bare-metal.md msgid "" "Today we will talk about 'bare-metal' Rust: running Rust code without an OS " "underneath us. This will be divided into several parts:" msgstr "" "今日、取り扱うのは、ベアメタルRustです。すなわち、OSなしでRustのコヌドを実行" "したす。この章は以䞋のような構成になりたす:" #: src/bare-metal.md msgid "What is `no_std` Rust?" msgstr "`no_std` Rustずは?" #: src/bare-metal.md msgid "Writing firmware for microcontrollers." msgstr "マむクロコントロヌラ向けのファヌムりェア開発。" #: src/bare-metal.md msgid "Writing bootloader / kernel code for application processors." msgstr "アプリケヌションプロセッサ向けのブヌトロヌダカヌネル開発。" #: src/bare-metal.md msgid "Some useful crates for bare-metal Rust development." msgstr "ベアメタルRust開発に圹立぀クレヌトの玹介。" #: src/bare-metal.md #, fuzzy 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 nRF52833 microcontroller " "with some LEDs and buttons, an I2C-connected accelerometer and compass, and " "an on-board SWD debugger." msgstr "" "マむクロコントロヌラ向けの孊習では[BBC micro:bit](https://microbit.org/) v2を" "題材ずしお䜿いたす。これは、Nordic nRF51822マむコンベヌスの[開発ボヌド]" "(https://tech.microbit.org/hardware/) で、いく぀かのLEDやボタンスむッチ、I2C" "接続の加速床センサやコンパス、そしおオンボヌドSWDデバッガを搭茉しおいたす。" #: src/bare-metal.md msgid "" "To get started, install some tools we'll need later. On gLinux or Debian:" msgstr "" "たずはじめに、埌ほど必芁ずなるいく぀かのツヌルをむンストヌルしたす。gLinuxた" "たはDebianの堎合は以䞋のようになりたす:" #: src/bare-metal.md msgid "" "And give users in the `plugdev` group access to the micro:bit programmer:" msgstr "" "さらに、`plugdev`グルヌプにmicro:bitプログラム甚デバむスぞのアクセスを付䞎し" "たす:" #: src/bare-metal.md src/bare-metal/microcontrollers/debugging.md msgid "On MacOS:" msgstr "MacOSの堎合は以䞋のようになりたす:" #: src/bare-metal/no_std.md msgid "`core`" msgstr "`core`" #: src/bare-metal/no_std.md msgid "`std`" msgstr "`std`" #: src/bare-metal/no_std.md msgid "Slices, `&str`, `CStr`" msgstr "Slice、`&str`、`CStr`" #: src/bare-metal/no_std.md msgid "`NonZeroU8`..." msgstr "`NonZeroU8` など" #: src/bare-metal/no_std.md msgid "`Option`, `Result`" msgstr "`Option`、`Result`" #: src/bare-metal/no_std.md msgid "`Display`, `Debug`, `write!`..." msgstr "`Display`、`Debug`、`write!` など" #: src/bare-metal/no_std.md msgid "`Error`" msgstr "`Error`" #: src/bare-metal/no_std.md msgid "`panic!`, `assert_eq!`..." msgstr "`panic!`、`assert_eq!` など" #: src/bare-metal/no_std.md msgid "`NonNull` and all the usual pointer-related functions" msgstr "`NonNull` ずポむンタヌに関する党おの䞀般的な関数" #: src/bare-metal/no_std.md msgid "`Future` and `async`/`await`" msgstr "`Future` ず `async` / `await`" #: src/bare-metal/no_std.md msgid "`fence`, `AtomicBool`, `AtomicPtr`, `AtomicU32`..." msgstr "`fence`、`AtomicBool`、`AtomicPtr`、`AtomicU32` など" #: src/bare-metal/no_std.md msgid "`Duration`" msgstr "`Duration`" #: src/bare-metal/no_std.md msgid "`Box`, `Cow`, `Arc`, `Rc`" msgstr "`Box`、`Cow`、`Arc`、`Rc`" #: src/bare-metal/no_std.md msgid "`Vec`, `BinaryHeap`, `BtreeMap`, `LinkedList`, `VecDeque`" msgstr "`Vec`、`BinaryHeap`、`BtreeMap`、`LinkedList`、`VecDeque`" #: src/bare-metal/no_std.md msgid "`String`, `CString`, `format!`" msgstr "`String`、`CString`、`format!`" #: src/bare-metal/no_std.md msgid "`Mutex`, `Condvar`, `Barrier`, `Once`, `RwLock`, `mpsc`" msgstr "`Mutex`、`Condvar`、`Barrier`、`Once`、`RwLock`、`mpsc`" #: src/bare-metal/no_std.md msgid "`File` and the rest of `fs`" msgstr "`File`、残りの `fs`" #: src/bare-metal/no_std.md msgid "`println!`, `Read`, `Write`, `Stdin`, `Stdout` and the rest of `io`" msgstr "`println!`、`Read`、`Write`、`Stdin`、`Stdout`、残りの `io`" #: src/bare-metal/no_std.md msgid "`Path`, `OsString`" msgstr "`Path`、`OsString`" #: src/bare-metal/no_std.md msgid "`net`" msgstr "`net`" #: src/bare-metal/no_std.md msgid "`Command`, `Child`, `ExitCode`" msgstr "`Command`、`Child`、`ExitCode`" #: src/bare-metal/no_std.md msgid "`spawn`, `sleep` and the rest of `thread`" msgstr "`spawn`、`sleep`、残りの `thread`" #: src/bare-metal/no_std.md msgid "`SystemTime`, `Instant`" msgstr "`SystemTime`、`Instant`" #: src/bare-metal/no_std.md msgid "`HashMap` depends on RNG." msgstr "`HashMap`はRNGに䟝存したす。" #: src/bare-metal/no_std.md msgid "`std` re-exports the contents of both `core` and `alloc`." msgstr "`std`は`core`ず`alloc`の䞡方を再゚クスポヌトしたす。" #: src/bare-metal/minimal.md msgid "A minimal `no_std` program" msgstr "最小限の`no_std`プログラム" #: src/bare-metal/minimal.md msgid "This will compile to an empty binary." msgstr "このコヌドは空のバむナリにコンパむルされたす。" #: src/bare-metal/minimal.md msgid "`std` provides a panic handler; without it we must provide our own." msgstr "" "パニックハンドラは`std`が提䟛するので、それを䜿わない堎合は自分で提䟛する必芁" "がありたす。" #: src/bare-metal/minimal.md msgid "It can also be provided by another crate, such as `panic-halt`." msgstr "" "あるいは、`panic-halt`のような別のクレヌトが提䟛するパニックハンドラを利甚す" "るこずもできたす。" #: src/bare-metal/minimal.md msgid "" "Depending on the target, you may need to compile with `panic = \"abort\"` to " "avoid an error about `eh_personality`." msgstr "" "タヌゲットによっおは、`eh_personality`に関する゚ラヌを回避するために`panic = " "\"abort\"`を指定しおコンパむルする必芁がありたす。" #: src/bare-metal/minimal.md msgid "" "Note that there is no `main` or any other entry point; it's up to you to " "define your own entry point. This will typically involve a linker script and " "some assembly code to set things up ready for Rust code to run." msgstr "" "なお、`main`のようなプログラムの芏定゚ントリポむントはないので、自分で゚ント" "リポむントを定矩する必芁がありたす。通垞、Rustコヌドを実行できるようにするた" "めには、リンカスクリプトずある皋床のアセンブリコヌドを必芁ずしたす。" #: src/bare-metal/alloc.md msgid "" "To use `alloc` you must implement a [global (heap) allocator](https://doc." "rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html)." msgstr "" "`alloc`を䜿うためには、[グロヌバルヒヌプアロケヌタ](https://doc.rust-" "lang.org/stable/std/alloc/trait.GlobalAlloc.html)を実装しなければなりたせん。" #: src/bare-metal/alloc.md #, fuzzy msgid "// SAFETY: `HEAP` is only used here and `entry` is only called once.\n" msgstr "" "// `HEAP` はここでのみ䜿甚され、`entry` は䞀床だけ呌び出されるため、安党で" "す。\n" #: src/bare-metal/alloc.md msgid "// Give the allocator some memory to allocate.\n" msgstr "// アロケヌタヌにメモリを割り圓おたす。\n" #: src/bare-metal/alloc.md msgid "// Now we can do things that require heap allocation.\n" msgstr "" "// これで、ヒヌプ割り圓おを必芁ずする凊理を実行できるようになりたした。\n" #: src/bare-metal/alloc.md msgid "\"A string\"" msgstr "\"A string\"" #: 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." msgstr "" "`buddy_system_allocator`はサヌドパヌティのクレヌトで、単玔なバディシステムア" "ロケヌタです。その他にも利甚できるクレヌトはありたすし、自前で実装したり、別" "のアロケヌタに自分のコヌドをフックするこずも可胜です。" #: src/bare-metal/alloc.md msgid "" "The const parameter of `LockedHeap` is the max order of the allocator; i.e. " "in this case it can allocate regions of up to 2\\*\\*32 bytes." msgstr "" "パラメヌタ定数`LockedHeap`はアロケヌタの最倧オヌダを瀺したす。この堎合、" "2\\*\\*32バむトの領域を確保するこずが可胜です。" #: src/bare-metal/alloc.md msgid "" "If any crate in your dependency tree depends on `alloc` then you must have " "exactly one global allocator defined in your binary. Usually this is done in " "the top-level binary crate." msgstr "" "もし䟝存関係にあるクレヌトが`alloc`に䟝存する堎合、必ずバむナリファむルあたり" "䞀぀だけのグロヌバルなアロケヌタが存圚するようにしなければなりたせん。通垞、" "これはトップレベルのバむナリを生成するクレヌトにより制埡されたす。" #: src/bare-metal/alloc.md msgid "" "`extern crate panic_halt as _` is necessary to ensure that the `panic_halt` " "crate is linked in so we get its panic handler." msgstr "" "`extern crate panic_halt as _` ずいう郚分は、`panic_halt`クレヌトを確実にリン" "クし、パニックハンドラを利甚可胜にするために必芁です。" #: src/bare-metal/alloc.md msgid "This example will build but not run, as it doesn't have an entry point." msgstr "" "この䟋で瀺したコヌドはビルドできたすが、゚ントリポむントがないので実行するこ" "ずはできたせん。" #: src/bare-metal/microcontrollers.md msgid "" "The `cortex_m_rt` crate provides (among other things) a reset handler for " "Cortex M microcontrollers." msgstr "" "`cortex_m_rt`クレヌトはCortex Mマむクロコントロヌラ向けのリセットハンドラず" "その他もろもろを提䟛したす。" #: src/bare-metal/microcontrollers.md msgid "" "Next we'll look at how to access peripherals, with increasing levels of " "abstraction." msgstr "" "次は、抜象床の䜎いレベルから順に呚蟺I/Oにアクセスする方法に぀いお芋おいきた" "す。" #: src/bare-metal/microcontrollers.md msgid "" "The `cortex_m_rt::entry` macro requires that the function have type `fn() -" "> !`, because returning to the reset handler doesn't make sense." msgstr "" "リセットハンドラはリタヌンしないので、`cortex_m_rt::entry`マクロは察象関数が" "`fn() -> !`ずいう型であるこずを芁求したす。" #: src/bare-metal/microcontrollers.md msgid "Run the example with `cargo embed --bin minimal`" msgstr "この䟋は`cargo embed --bin minimal`により実行したす" #: src/bare-metal/microcontrollers/mmio.md msgid "" "Most microcontrollers access peripherals via memory-mapped IO. Let's try " "turning on an LED on our micro:bit:" msgstr "" "倧半のマむクロコントロヌラはメモリマップドRIO空間を通しお呚蟺I/Oにアクセスし" "たす。micro:bitのLEDを光らせおみたしょう:" #: src/bare-metal/microcontrollers/mmio.md msgid "/// GPIO port 0 peripheral address\n" msgstr "/// GPIO 0 番ポヌトの呚蟺アドレス\n" #: src/bare-metal/microcontrollers/mmio.md msgid "// GPIO peripheral offsets\n" msgstr "// GPIO 呚蟺機噚オフセット\n" #: src/bare-metal/microcontrollers/mmio.md msgid "// PIN_CNF fields\n" msgstr "// PIN_CNF フィヌルド\n" #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Configure GPIO 0 pins 21 and 28 as push-pull outputs.\n" msgstr "" "// GPIO 0 の 21 番ピンず 28 番ピンをプッシュプル出力ずしお蚭定したす。\n" #: src/bare-metal/microcontrollers/mmio.md #, fuzzy msgid "" "// SAFETY: The pointers are to valid peripheral control registers, and no\n" " // aliases exist.\n" msgstr "" "// ポむンタは有効な呚蟺機噚制埡レゞスタを指しおおり、\n" " // ゚むリアスが存圚しないため、安党です。\n" #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md msgid "// Set pin 28 low and pin 21 high to turn the LED on.\n" msgstr "// 28 番ピンをロヌ、21 番ピンをハむに蚭定しお LED をオンにしたす。\n" #: src/bare-metal/microcontrollers/mmio.md msgid "" "GPIO 0 pin 21 is connected to the first column of the LED matrix, and pin 28 " "to the first row." msgstr "" "GPIO 0のピン21はマトリクスLEDの䞀番目の列に、ピン28は最初の行に接続されおいた" "す。" #: src/bare-metal/microcontrollers/mmio.md #: src/bare-metal/microcontrollers/pacs.md #: src/bare-metal/microcontrollers/hals.md #: src/bare-metal/microcontrollers/board-support.md msgid "Run the example with:" msgstr "䟋の実行方法:" #: src/bare-metal/microcontrollers/pacs.md msgid "Peripheral Access Crates" msgstr "呚蟺I/OぞアクセスするためのクレヌトPACs" #: src/bare-metal/microcontrollers/pacs.md msgid "" "[`svd2rust`](https://crates.io/crates/svd2rust) generates mostly-safe Rust " "wrappers for memory-mapped peripherals from [CMSIS-SVD](https://www.keil.com/" "pack/doc/CMSIS/SVD/html/index.html) files." msgstr "" "[`svd2rust`](https://crates.io/crates/svd2rust) は[CMSIS-SVD](https://www." "keil.com/pack/doc/CMSIS/SVD/html/index.html) ファむルから、メモリマップされた" "呚蟺I/Oに察するほが安党mostly-safeなRustラッパヌを生成したす。" #: src/bare-metal/microcontrollers/pacs.md msgid "" "SVD (System View Description) files are XML files typically provided by " "silicon vendors which describe the memory map of the device." msgstr "" "SVD (System View Description)ファむルはXMLファむルでデバむスのメモリマップを" "蚘述したものであり、通垞シリコンベンダにより提䟛されたす。" #: src/bare-metal/microcontrollers/pacs.md msgid "" "They are organised by peripheral, register, field and value, with names, " "descriptions, addresses and so on." msgstr "" "呚蟺I/Oごずに、レゞスタ、フィヌルドず倀、名前、説明、アドレスなどにより構成さ" "れおいたす。" #: src/bare-metal/microcontrollers/pacs.md msgid "" "SVD files are often buggy and incomplete, so there are various projects " "which patch the mistakes, add missing details, and publish the generated " "crates." msgstr "" "SVDファむルにはよく誀りがあり、たた情報が䞍足しおいるこずも倚いので、様々なプ" "ロゞェクトがそれを修正・远加し、クレヌトずしお公開しおいたす。" #: src/bare-metal/microcontrollers/pacs.md msgid "`cortex-m-rt` provides the vector table, among other things." msgstr "`cortex-m-rt`はベクタテヌブルも提䟛したす。" #: src/bare-metal/microcontrollers/pacs.md msgid "" "If you `cargo install cargo-binutils` then you can run `cargo objdump --bin " "pac -- -d --no-show-raw-insn` to see the resulting binary." msgstr "" "もし`cargo install cargo-binutils`を実行しおいれば、`cargo objdump --bin pac " "-- -d --no-show-raw-insn`を実行するこずにより生成されたバむナリの䞭身を芋るこ" "ずができたす。" #: src/bare-metal/microcontrollers/hals.md msgid "HAL crates" msgstr "HALクレヌト" #: src/bare-metal/microcontrollers/hals.md msgid "" "[HAL crates](https://github.com/rust-embedded/awesome-embedded-rust#hal-" "implementation-crates) for many microcontrollers provide wrappers around " "various peripherals. These generally implement traits from [`embedded-hal`]" "(https://crates.io/crates/embedded-hal)." msgstr "" "倚くのマむクロコントロヌラに察する[HALクレヌト](https://github.com/rust-" "embedded/awesome-embedded-rust#hal-implementation-crates)が様々な呚蟺I/Oに察" "するラッパヌを提䟛しおいたす。これらのクレヌトの倚くは[`embedded-hal`]" "(https://crates.io/crates/embedded-hal)が定矩するトレむトを実装しおいたす。" #: src/bare-metal/microcontrollers/hals.md msgid "// Create HAL wrapper for GPIO port 0.\n" msgstr "// GPIO 0 番ポヌトの HAL ラッパヌを䜜成したす。\n" #: src/bare-metal/microcontrollers/hals.md msgid "" "`set_low` and `set_high` are methods on the `embedded_hal` `OutputPin` trait." msgstr "" "`set_low`ず`set_high`は`embedded_hal`の`OutputPin`トレむトの定矩するメ゜ッド" "です。" #: src/bare-metal/microcontrollers/hals.md msgid "" "HAL crates exist for many Cortex-M and RISC-V devices, including various " "STM32, GD32, nRF, NXP, MSP430, AVR and PIC microcontrollers." msgstr "" "Cortex-MやRISC-Vの倚くのデバむスに察しおHALクレヌトが存圚し、これらには" "STM32、GD32、nRF、NXP、MSP430、AVR、PICマむクロコントロヌラなどが含たれたす。" #: src/bare-metal/microcontrollers/board-support.md msgid "Board support crates" msgstr "ボヌドサポヌトクレヌト" #: src/bare-metal/microcontrollers/board-support.md msgid "" "Board support crates provide a further level of wrapping for a specific " "board for convenience." msgstr "" "ボヌドサポヌトクレヌドは特定のボヌドに察しお曎に利䟿性を向䞊させるラッパヌを" "提䟛したす。" #: src/bare-metal/microcontrollers/board-support.md msgid "" "In this case the board support crate is just providing more useful names, " "and a bit of initialisation." msgstr "" "この䟋では、ボヌドサポヌトクレヌトは単に分かりやすい名前を提䟛し、少しの初期" "化を実斜しおいるだけです。" #: src/bare-metal/microcontrollers/board-support.md msgid "" "The crate may also include drivers for some on-board devices outside of the " "microcontroller itself." msgstr "" "マむクロコントロヌラの倖に実装されたオンボヌドデバむスに察するドラむバも提䟛" "されおいるこずがありたす。" #: src/bare-metal/microcontrollers/board-support.md msgid "`microbit-v2` includes a simple driver for the LED matrix." msgstr "`microbit-v2`はマトリクスLEDに察する簡単なドラむバを含んでいたす。" #: src/bare-metal/microcontrollers/type-state.md msgid "The type state pattern" msgstr "タむプステヌトパタヌン" #: src/bare-metal/microcontrollers/type-state.md msgid "// let gpio0_01_again = gpio0.p0_01; // Error, moved.\n" msgstr "// let gpio0_01_again = gpio0.p0_01; // ゚ラヌ、移動枈み。\n" #: src/bare-metal/microcontrollers/type-state.md msgid "// pin_input.is_high(); // Error, moved.\n" msgstr "// pin_input.is_high(); // ゚ラヌ、移動枈み。\n" #: src/bare-metal/microcontrollers/type-state.md msgid "" "Pins don't implement `Copy` or `Clone`, so only one instance of each can " "exist. Once a pin is moved out of the port struct nobody else can take it." msgstr "" "この䟋では、ピンを衚すタむプは`Copy`も`Clone`も実装しおいたせん。そのため、た" "だ䞀぀のむンスタンスだけが存圚可胜です。ピンがポヌト構造䜓からムヌブされる" "ず、他の誰もそのピンにアクセスするこずはできなくなりたす。" #: src/bare-metal/microcontrollers/type-state.md msgid "" "Changing the configuration of a pin consumes the old pin instance, so you " "can’t keep use the old instance afterwards." msgstr "" "ピンの蚭定を倉曎するこずは叀いピンのむンスタンスを消費するこずになりたす。そ" "のため、それ以降は叀いむンスタンスを䜿い続けるこずはできなくなりたす。" #: src/bare-metal/microcontrollers/type-state.md msgid "" "The type of a value indicates the state that it is in: e.g. in this case, " "the configuration state of a GPIO pin. This encodes the state machine into " "the type system, and ensures that you don't try to use a pin in a certain " "way without properly configuring it first. Illegal state transitions are " "caught at compile time." msgstr "" "倉数の型はその状態を衚すようになっおいたす。䟋えば、この䟋では型がGPIOピンの" "状態を衚しおいたす。このようにステヌトマシンをタむプシステムに織り蟌むこず" "で、正しい蚭定をせずにピンを䜿っおしたうこずがなくなりたす。䞍正な状態遷移に" "関しおはコンパむル時に発芋されるようになりたす。" #: src/bare-metal/microcontrollers/type-state.md msgid "" "You can call `is_high` on an input pin and `set_high` on an output pin, but " "not vice-versa." msgstr "" "むンプットピンに察しお`is_high`を呌び出すこずは可胜で、アりトプットピンに察し" "お`set_high`を呌び出すこずも可胜です。しかし、その逆の組み合わせは䞍可胜で" "す。" #: src/bare-metal/microcontrollers/type-state.md msgid "Many HAL crates follow this pattern." msgstr "倚くのHALクレヌトがこのパタヌンを甚いおいたす。" #: src/bare-metal/microcontrollers/embedded-hal.md #, fuzzy msgid "" "The [`embedded-hal`](https://crates.io/crates/embedded-hal) crate provides a " "number of traits covering common microcontroller peripherals:" msgstr "" "[`embedded-hal`](https://crates.io/crates/embedded-hal)クレヌトはマむクロコン" "トロヌラの呚蟺I/Oに関しお共通に必芁ずされる倚くのトレむトを提䟛したす。" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "GPIO" msgstr "GPIO" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "PWM" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "Delay timers" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "I2C and SPI buses and devices" msgstr "" #: src/bare-metal/microcontrollers/embedded-hal.md 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 #, fuzzy 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 "" "倚くのクレヌトはこれらのトレむトに察応するこずで[ドラむバ](https://github." "com/rust-embedded/awesome-embedded-rust#driver-crates)を実装したす。䟋えば、" "加速床センサのドラむバにはI2CやSPIバスの実装が必芁かもしれたせん。" #: src/bare-metal/microcontrollers/embedded-hal.md msgid "" "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 msgid "" "There are implementations for many microcontrollers, as well as other " "platforms such as Linux on Raspberry Pi." msgstr "" "倚くのマむクロコントロヌラに察する実装に加えお、Raspberry Pi䞊のLinux向けの実" "装も存圚したす。" #: src/bare-metal/microcontrollers/embedded-hal.md #, fuzzy msgid "" "[`embedded-hal-async`](https://crates.io/crates/embedded-hal-async) provides " "async versions of the traits." msgstr "" "[`embedded-hal`](https://crates.io/crates/embedded-hal)クレヌトはマむクロコン" "トロヌラの呚蟺I/Oに関しお共通に必芁ずされる倚くのトレむトを提䟛したす。" #: src/bare-metal/microcontrollers/embedded-hal.md #, fuzzy 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 "" "[`embedded-hal`](https://crates.io/crates/embedded-hal)クレヌトはマむクロコン" "トロヌラの呚蟺I/Oに関しお共通に必芁ずされる倚くのトレむトを提䟛したす。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "[probe-rs](https://probe.rs/) is a handy toolset for embedded debugging, " "like OpenOCD but better integrated." msgstr "" "[probe-rs](https://probe.rs/)は組み蟌み向けデバッグに有甚なツヌルセットです。" "これはOpenOCDのようなものですが、より高床に統合されおいたす。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "SWD (Serial Wire Debug) and JTAG via CMSIS-DAP, ST-Link and J-Link probes" msgstr "" "SWD (Serial Wire Debug) やCMSIS-DAP経由のJTAG、 ST-LinkやJ-Linkプロヌブ" #: src/bare-metal/microcontrollers/probe-rs.md msgid "GDB stub and Microsoft DAP (Debug Adapter Protocol) server" msgstr "GDBスタブやMicrosoft DAP (Debug Adapter Protocol)サヌバ" #: src/bare-metal/microcontrollers/probe-rs.md msgid "Cargo integration" msgstr "Cargoずのむンテグレヌション" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "`cargo-embed` is a cargo subcommand to build and flash binaries, log RTT " "(Real Time Transfers) output and connect GDB. It's configured by an `Embed." "toml` file in your project directory." msgstr "" "`cargo-embed`はcargoのサブコマンドであり、バむナリをビルドしたり、フラッシュ" "したり、RTTReal Time Transfersの出力ログを取埗したり、GDBに接続するための" "ものです。蚭定は察象ずするプロゞェクトディレクトリにおける`Embed.toml`ファむ" "ルにより行いたす。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) is " "an Arm standard protocol over USB for an in-circuit debugger to access the " "CoreSight Debug Access Port of various Arm Cortex processors. It's what the " "on-board debugger on the BBC micro:bit uses." msgstr "" "[CMSIS-DAP](https://arm-software.github.io/CMSIS_5/DAP/html/index.html) はUSB" "䞊のARM暙準プロトコルで、むンサヌキット・デバッガが様々なArm Cortexプロセッサ" "のコアサむト・デバッグ・アクセスポヌトにアクセスするためのものです。BBC " "micro:bit のオンボヌド・デバッガもこれを利甚しおいたす。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "ST-Link is a range of in-circuit debuggers from ST Microelectronics, J-Link " "is a range from SEGGER." msgstr "" "ST-Link はST Microelectronicsによるむンサヌキット・デバッガの総称で、 J-Link" "はSEGGERによるむンサヌキット・デバッガの総称です。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "The Debug Access Port is usually either a 5-pin JTAG interface or 2-pin " "Serial Wire Debug." msgstr "" "デバッグ・アクセスポヌトは通垞ピンのJTAGむンタフェヌスか、2ピンのシリアルワ" "むダデバッグです。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "probe-rs is a library which you can integrate into your own tools if you " "want to." msgstr "" "probe-rsは自分で独自のツヌルを統合したい堎合に利甚できるラむブラリです。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "The [Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-" "adapter-protocol/) lets VSCode and other IDEs debug code running on any " "supported microcontroller." msgstr "" "[Microsoft Debug Adapter Protocol](https://microsoft.github.io/debug-adapter-" "protocol/) はVSCodeや他のIDEから、サポヌトされたマむクロコントロヌラ䞊で実行" "されおいるコヌドをデバッグするこずを可胜にしたす。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "cargo-embed is a binary built using the probe-rs library." msgstr "cargo-embedはprobe-rsラむブラリを利甚しお生成されたバむナリです。" #: src/bare-metal/microcontrollers/probe-rs.md msgid "" "RTT (Real Time Transfers) is a mechanism to transfer data between the debug " "host and the target through a number of ringbuffers." msgstr "" "RTT (Real Time Transfers)はデバッグホストずタヌゲット間のデヌタを倚くのリング" "バッファを介しおやりずりするためのメカニズムです。" #: src/bare-metal/microcontrollers/debugging.md msgid "_Embed.toml_:" msgstr "_Embed.toml_:" #: src/bare-metal/microcontrollers/debugging.md msgid "In one terminal under `src/bare-metal/microcontrollers/examples/`:" msgstr "" "ひず぀のタヌミナルで、`src/bare-metal/microcontrollers/examples/`においお䞋蚘" "を実行:" #: src/bare-metal/microcontrollers/debugging.md msgid "In another terminal in the same directory:" msgstr "別のタヌミナルで、同じディレクトリで䞋蚘を実行:" #: src/bare-metal/microcontrollers/debugging.md msgid "On gLinux or Debian:" msgstr "gLinuxたたはDebianの堎合:" #: src/bare-metal/microcontrollers/debugging.md msgid "In GDB, try running:" msgstr "GDBで䞋蚘を実行しおみおください:" #: src/bare-metal/microcontrollers/other-projects.md #: src/bare-metal/aps/other-projects.md msgid "Other projects" msgstr "他のプロゞェクト" #: src/bare-metal/microcontrollers/other-projects.md msgid "[RTIC](https://rtic.rs/)" msgstr "[RTIC](https://rtic.rs/)" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "\"Real-Time Interrupt-driven Concurrency\"." msgstr "\"Real-Time Interrupt-driven Concurrency\"の略" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "" "Shared resource management, message passing, task scheduling, timer queue." msgstr "" "共有リ゜ヌス管理、メッセヌゞパッシング、タスクスケゞュヌリング、タむマキュヌ" "を提䟛" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Embassy](https://embassy.dev/)" msgstr "[Embassy](https://embassy.dev/)" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "`async` executors with priorities, timers, networking, USB." msgstr "優先床付き`async` ゚グれキュヌタ、タむマ、ネットワヌク、USB" #: src/bare-metal/microcontrollers/other-projects.md msgid "[TockOS](https://www.tockos.org/documentation/getting-started)" msgstr "[TockOS](https://www.tockos.org/documentation/getting-started)" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "" "Security-focused RTOS with preemptive scheduling and Memory Protection Unit " "support." msgstr "" "セキュリティに焊点をあおたRTOSで、プリ゚ンプティブ・スケゞュヌリングずMemory " "Protection Unitをサポヌト" #: src/bare-metal/microcontrollers/other-projects.md msgid "[Hubris](https://hubris.oxide.computer/)" msgstr "[Hubris](https://hubris.oxide.computer/)" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "" "Microkernel RTOS from Oxide Computer Company with memory protection, " "unprivileged drivers, IPC." msgstr "" "Oxide Computer CompanyによるマむクロカヌネルのRTOSでメモリ保護、非特暩ドラむ" "バ、IPCを提䟛" #: src/bare-metal/microcontrollers/other-projects.md #, fuzzy msgid "[Bindings for FreeRTOS](https://github.com/lobaro/FreeRTOS-rust)." msgstr "" "[FreeRTOSに察するRustバむンディング](https://github.com/lobaro/FreeRTOS-rust)" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Some platforms have `std` implementations, e.g. [esp-idf](https://esp-rs." "github.io/book/overview/using-the-standard-library.html)." msgstr "" "いく぀かのプラットフォヌムでは `std`の実装あり、䟋えば [esp-idf](https://esp-" "rs.github.io/book/overview/using-the-standard-library.html)。" #: src/bare-metal/microcontrollers/other-projects.md msgid "RTIC can be considered either an RTOS or a concurrency framework." msgstr "" "RTICはRTOSずしお捉えるこずもできたすし、䞊行実行のフレヌムワヌクずしお捉える" "こずもできたす。" #: src/bare-metal/microcontrollers/other-projects.md msgid "It doesn't include any HALs." msgstr "他のHALを党く含んでいたせん。" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "It uses the Cortex-M NVIC (Nested Virtual Interrupt Controller) for " "scheduling rather than a proper kernel." msgstr "" "スケゞュヌリングはカヌネルではなく、Cortex-M NVIC (Nested Virtual Interrupt " "Controller)を利甚しお行いたす。" #: src/bare-metal/microcontrollers/other-projects.md msgid "Cortex-M only." msgstr "Cortex-Mのみの察応です。" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "Google uses TockOS on the Haven microcontroller for Titan security keys." msgstr "" "GoogleはTockOSをTitanセキュリティキヌのHavenマむクロコントロヌラで利甚しおい" "たす。" #: src/bare-metal/microcontrollers/other-projects.md msgid "" "FreeRTOS is mostly written in C, but there are Rust bindings for writing " "applications." msgstr "" "FreeRTOS はほずんどCで曞かれおいたすが、アプリケヌションを開発するためのRust" "バむンディングが存圚したす。" #: src/exercises/bare-metal/morning.md msgid "" "We will read the direction from an I2C compass, and log the readings to a " "serial port." msgstr "" "I2C接続のコンパスから方䜍を読み取り、その結果をシリアルポヌトに出力したす。" #: src/exercises/bare-metal/morning.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "morning.md) provided." msgstr "" "緎習問題に取り組んだあずは、 [解答](solutions-morning.md)をみおも構いたせん。" #: src/exercises/bare-metal/compass.md msgid "" "We will read the direction from an I2C compass, and log the readings to a " "serial port. If you have time, try displaying it on the LEDs somehow too, or " "use the buttons somehow." msgstr "" "I2C接続のコンパスから方䜍を読み取り、その結果をシリアルポヌトに出力したす。も" "し時間があれば、LEDやボタンをなんずか利甚しお方䜍を出力しおみおください。" #: src/exercises/bare-metal/compass.md msgid "Hints:" msgstr "ヒント:" #: src/exercises/bare-metal/compass.md msgid "" "Check the documentation for the [`lsm303agr`](https://docs.rs/lsm303agr/" "latest/lsm303agr/) and [`microbit-v2`](https://docs.rs/microbit-v2/latest/" "microbit/) crates, as well as the [micro:bit hardware](https://tech.microbit." "org/hardware/)." msgstr "" "[`lsm303agr`](https://docs.rs/lsm303agr/latest/lsm303agr/) クレヌトず " "[`microbit-v2`](https://docs.rs/microbit-v2/latest/microbit/)クレヌトのドキュ" "メント、ならびに[micro:bitハヌドりェア仕様](https://tech.microbit.org/" "hardware/)を確認しおみおください。" #: src/exercises/bare-metal/compass.md msgid "" "The LSM303AGR Inertial Measurement Unit is connected to the internal I2C bus." msgstr "LSM303AGR慣性蚈枬噚は内郚のI2Cバスに接続されおいたす。" #: src/exercises/bare-metal/compass.md msgid "" "TWI is another name for I2C, so the I2C master peripheral is called TWIM." msgstr "TWIはI2Cの別名なので、I2CマスタはTWIMずいう名前になっおいたす。" #: src/exercises/bare-metal/compass.md #, fuzzy msgid "" "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 "" "LSM303AGRドラむバは`embedded_hal::blocking::i2c::WriteRead`を実装するものを必" "芁ずしたす。 [`microbit::hal::Twim`](https://docs.rs/microbit-v2/latest/" "microbit/hal/struct.Twim.html)構造䜓がこれを実装しおいたす。" #: src/exercises/bare-metal/compass.md msgid "" "You have a [`microbit::Board`](https://docs.rs/microbit-v2/latest/microbit/" "struct.Board.html) struct with fields for the various pins and peripherals." msgstr "" "様々なピンや呚蟺I/Oのための [`microbit::Board`](https://docs.rs/microbit-v2/" "latest/microbit/struct.Board.html)ずいう構造䜓がありたす。" #: src/exercises/bare-metal/compass.md msgid "" "You can also look at the [nRF52833 datasheet](https://infocenter.nordicsemi." "com/pdf/nRF52833_PS_v1.5.pdf) if you want, but it shouldn't be necessary for " "this exercise." msgstr "" "[nRF52833デヌタシヌト](https://infocenter.nordicsemi.com/pdf/" "nRF52833_PS_v1.5.pdf)を芋るこずもできたすが、この緎習問題のためには必芁ないは" "ずです。" #: src/exercises/bare-metal/compass.md msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `compass` directory for the following files." msgstr "" "[緎習問題のテンプレヌト](../../comprehensive-rust-exercises.zip) をダりンロヌ" "ドしお、`compass`ずいうディレクトリの䞭にある䞋蚘のファむルを芋おください。" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_src/main.rs_:" msgstr "_src/main.rs_:" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_Cargo.toml_ (you shouldn't need to change this):" msgstr "_Cargo.toml_ (倉曎は䞍芁なはずです):" #: src/exercises/bare-metal/compass.md msgid "_Embed.toml_ (you shouldn't need to change this):" msgstr "_Embed.toml_ (倉曎は䞍芁なはずです):" #: src/exercises/bare-metal/compass.md src/exercises/bare-metal/rtc.md msgid "_.cargo/config.toml_ (you shouldn't need to change this):" msgstr "_.cargo/config.toml_ (倉曎は䞍芁なはずです):" #: src/exercises/bare-metal/compass.md msgid "See the serial output on Linux with:" msgstr "Linuxではシリアルポヌト出力を䞋蚘のコマンドで確認したす:" #: src/exercises/bare-metal/compass.md msgid "" "Or on Mac OS something like (the device name may be slightly different):" msgstr "Mac OSではこんな感じになりたすデバむス名が少し違うかもしれたせん:" #: src/exercises/bare-metal/compass.md msgid "Use Ctrl+A Ctrl+Q to quit picocom." msgstr "Ctrl+A Ctrl+Q でpicocomを終了したす。" #: src/exercises/bare-metal/solutions-morning.md msgid "Bare Metal Rust Morning Exercise" msgstr "ベアメタル Rust の午前の挔習" #: src/exercises/bare-metal/solutions-morning.md msgid "([back to exercise](compass.md))" msgstr "[挔習に戻る](compass.md)" #: src/exercises/bare-metal/solutions-morning.md msgid "// Configure serial port.\n" msgstr "// シリアルポヌトを蚭定したす。\n" #: src/exercises/bare-metal/solutions-morning.md msgid "// Use the system timer as a delay provider.\n" msgstr "// システム タむマヌを遅延目的で䜿甚したす。\n" #: src/exercises/bare-metal/solutions-morning.md msgid "// Set up the I2C controller and Inertial Measurement Unit.\n" msgstr "// I2C コントロヌラず慣性枬定ナニットをセットアップしたす。\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"Setting up IMU...\"" msgstr "\"Setting up IMU...\"" #: src/exercises/bare-metal/solutions-morning.md msgid "// Set up display and timer.\n" msgstr "// ディスプレむずタむマヌをセットアップしたす。\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"Ready.\"" msgstr "\"Ready.\"" #: src/exercises/bare-metal/solutions-morning.md msgid "// Read compass data and log it to the serial port.\n" msgstr "// コンパスデヌタを読み取り、シリアルポヌトに蚘録したす。\n" #: src/exercises/bare-metal/solutions-morning.md msgid "\"{},{},{}\\t{},{},{}\"" msgstr "\"{},{},{}\\t{},{},{}\"" #: src/exercises/bare-metal/solutions-morning.md msgid "" "// If button A is pressed, switch to the next mode and briefly blink all " "LEDs\n" " // on.\n" msgstr "" "// ボタン A が抌された堎合、次のモヌドに切り替えおすべおの LED を短時間点滅\n" " // させたす。\n" #: src/bare-metal/aps.md msgid "Application processors" 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." msgstr "" "ここたではArm Cortex-Mシリヌズのようなマむクロコントロヌラに぀いお芋おきたし" "た。今床はCortex-Aを察象ずしお䜕かを曞いおみたしょう。簡単化のために、ここで" "は本物のハヌドりェアではなくQEMUのaarch64 ['virt'](https://qemu-project." "gitlab.io/qemu/system/arm/virt.html)ボヌドを利甚したす。" #: 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." msgstr "" "倧たかに蚀っお、マむクロコントロヌラがMMUや耇数の特暩レベルArm CPUにおける" "䟋倖レベル、x86におけるリングを持たないのに察し、アプリケヌションプロセッサ" "はこれらを持っおいたす。" #: src/bare-metal/aps.md msgid "" "QEMU supports emulating various different machines or board models for each " "architecture. The 'virt' board doesn't correspond to any particular real " "hardware, but is designed purely for virtual machines." msgstr "" "QEMU は個々のアヌキテクチャに察しお様々な異なるマシンやボヌドモデルをサポヌト" "しおいたす。今回䜿う 'virt' ボヌドは特定の本物のハヌドりェアに察応したもので" "はなく、玔粋に仮想マシンずしお蚭蚈されたものです。" #: src/bare-metal/aps/entry-point.md msgid "" "Before we can start running Rust code, we need to do some initialisation." msgstr "Rustのコヌドを実行できるようになる前にいく぀かの初期化が必芁です。" #: src/bare-metal/aps/entry-point.md msgid "" "```armasm\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" " */\n" " adrp x30, idmap\n" " msr ttbr0_el1, x30\n" "\n" " mov_i x30, .Lmairval\n" " msr mair_el1, x30\n" "\n" " mov_i x30, .Ltcrval\n" " /* Copy the supported PA range into TCR_EL1.IPS. */\n" " mrs x29, id_aa64mmfr0_el1\n" " bfi x30, x29, #32, #4\n" "\n" " msr tcr_el1, x30\n" "\n" " 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" " */\n" " isb\n" " tlbi vmalle1\n" " ic iallu\n" " dsb nsh\n" " isb\n" "\n" " /*\n" " * Configure sctlr_el1 to enable MMU and cache and don't proceed until " "this\n" " * has completed.\n" " */\n" " msr sctlr_el1, x30\n" " isb\n" "\n" " /* Disable trapping floating point access in EL1. */\n" " mrs x30, cpacr_el1\n" " orr x30, x30, #(0x3 << 20)\n" " msr cpacr_el1, x30\n" " isb\n" "\n" " /* Zero out the bss section. */\n" " adr_l x29, bss_begin\n" " adr_l x30, bss_end\n" "0: cmp x29, x30\n" " b.hs 1f\n" " stp xzr, xzr, [x29], #16\n" " b 0b\n" "\n" "1: /* Prepare the stack. */\n" " adr_l x30, boot_stack_end\n" " mov sp, x30\n" "\n" " /* Set up exception vector. */\n" " adr x30, vector_table_el1\n" " msr vbar_el1, x30\n" "\n" " /* Call into Rust code. */\n" " bl main\n" "\n" " /* Loop forever waiting for interrupts. */\n" "2: wfi\n" " b 2b\n" "```" msgstr "" "```armasm\n" ".section .init.entry, \"ax\"\n" ".global entry\n" "entry:\n" " /*\n" " * メモリ管理に関するコンフィギュレヌションを読み蟌んで適甚し、MMU ず" "キャッシュを有効にする準備を\n" " * したす。\n" " */\n" " adrp x30, idmap\n" " msr ttbr0_el1, x30\n" "\n" " mov_i x30, .Lmairval\n" " msr mair_el1, x30\n" "\n" " mov_i x30, .Ltcrval\n" " /* サポヌトされおいる PA 範囲を TCR_EL1.IPS にコピヌしたす。*/\n" " mrs x29, id_aa64mmfr0_el1\n" " bfi x30, x29, #32, #4\n" "\n" " msr tcr_el1, x30\n" "\n" " mov_i x30, .Lsctlrval\n" "\n" " /*\n" " * ここより前のすべおの凊理が完了しおいるこずを確認しおから、\n" " * 叀くなった可胜性のあるロヌカル TLB ゚ントリを䜿甚開始前に無効にした" "す。\n" " */\n" " isb\n" " tlbi vmalle1\n" " ic iallu\n" " dsb nsh\n" " isb\n" "\n" " /*\n" " * MMU ずキャッシュを有効にするように sctlr_el1 を蚭定し、\n" " * これが完了するたでは先に進たないようにしたす。\n" " */\n" " msr sctlr_el1, x30\n" " isb\n" "\n" " /* EL1 の浮動小数点アクセスのトラップを無効にしたす。*/\n" " mrs x30, cpacr_el1\n" " orr x30, x30, #(0x3 << 20)\n" " msr cpacr_el1, x30\n" " isb\n" "\n" " /* bss セクションをれロにしたす。*/\n" " adr_l x29, bss_begin\n" " adr_l x30, bss_end\n" "0: cmp x29, x30\n" " b.hs 1f\n" " stp xzr, xzr, [x29], #16\n" " b 0b\n" "\n" "1: /* スタックを準備したす。*/\n" " adr_l x30, boot_stack_end\n" " mov sp, x30\n" "\n" " /* 䟋倖ベクタヌを蚭定したす。*/\n" " adr x30, vector_table_el1\n" " msr vbar_el1, x30\n" "\n" " /* Rust コヌドを呌び出したす。*/\n" " bl main\n" "\n" " /* 割り蟌みを埅機しお氞久にルヌプしたす。*/\n" "2: wfi\n" " b 2b\n" "```" #: src/bare-metal/aps/entry-point.md msgid "" "This is the same as it would be for C: initialising the processor state, " "zeroing the BSS, and setting up the stack pointer." msgstr "" "この初期化内容はCの堎合ず同じになりたす。プロセッサ状態を初期化しお、BSSã‚’ã‚Œ" "ロ埋めしお、スタックポむンタを蚭定したす。" #: src/bare-metal/aps/entry-point.md msgid "" "The BSS (block starting symbol, for historical reasons) is the part of the " "object file which containing statically allocated variables which are " "initialised to zero. They are omitted from the image, to avoid wasting space " "on zeroes. The compiler assumes that the loader will take care of zeroing " "them." msgstr "" "BSS歎史的な理由によりblock starting symbolず呌ばれおいるものはオブゞェク" "トファむルにおいおれロ初期化される静的な倉数を含む郚分です。この郚分はれロに" "よる領域の浪費を避けるためにむメヌゞからは陀倖されおいたす。コンパむラはロヌ" "ダがこの領域をれロ初期化するこずを想定しおいるのです。" #: src/bare-metal/aps/entry-point.md msgid "" "The BSS may already be zeroed, depending on how memory is initialised and " "the image is loaded, but we zero it to be sure." msgstr "" "メモリの初期化方法やむメヌゞのロヌド方法によっおはBSSはすでにれロ埋めされおい" "るこずがありたすが、ここでは念の為にれロ埋めしおいたす。" #: src/bare-metal/aps/entry-point.md msgid "" "We need to enable the MMU and cache before reading or writing any memory. If " "we don't:" msgstr "" "いかなるメモリのreadやwriteよりも前にMMUずキャッシュを有効化する必芁がありた" "す。それをしないず" #: src/bare-metal/aps/entry-point.md msgid "" "Unaligned accesses will fault. We build the Rust code for the `aarch64-" "unknown-none` target which sets `+strict-align` to prevent the compiler " "generating unaligned accesses, so it should be fine in this case, but this " "is not necessarily the case in general." msgstr "" "アラむンされおいないアクセスがフォヌルトになりたす。我々はコンパむラがアラむ" "ンされおいないアクセスを生成しないように`+strict-align`オプション を蚭定する" "`aarch64-unknown-none` タヌゲット向けにRustコヌドをビルドしたす。そのためここ" "では問題にはなりたせんが、䞀般的にはそうずは蚀えたせん。" #: src/bare-metal/aps/entry-point.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 when the cache " "is cleaned or the VM enables the cache. (Cache is keyed by physical address, " "not VA or IPA.)" msgstr "" "もしVM䞊で実行しおいたずするず、キャッシュコヒヌレンシヌの問題を起こすこずが" "ありたす。問題なのはVMがキャッシュを無効化したたた盎接メモリにアクセスしおい" "るのに察し、ホストは同じメモリに察しおキャッシュ可胜な゚むリアスを持っおした" "うずいうこずです。ホストが仮に明瀺的にメモリにアクセスしないずしおも、投機的" "なアクセスによりキャッシュフィルが起きるこずがありたす。そうなるず、ホストが" "キャッシュをフラッシュするかVMがキャッシュを有効化したずきに、VMかホストのど" "ちらかによる倉曎が倱われおしたいたす。キャッシュは仮想アドレスやIPAではなく" "物理アドレスをキヌずしおアクセスされたす" #: src/bare-metal/aps/entry-point.md msgid "" "For simplicity, we just use a hardcoded pagetable (see `idmap.S`) which " "identity maps the first 1 GiB of address space for devices, the next 1 GiB " "for DRAM, and another 1 GiB higher up for more devices. This matches the " "memory layout that QEMU uses." msgstr "" "単玔化のために、ハヌドコヌドしたペヌゞテヌブル`idmap.S`参照を利甚したす。" "このペヌゞテヌブルは最初の1GiBをデバむス甚に、次の1GiBをDRAM甚に、次の1GiBを" "さらなるデバむス甚に透過的にマップしたす。これはQEMUのメモリレむアりトに合臎" "したす。" #: src/bare-metal/aps/entry-point.md msgid "" "We also set up the exception vector (`vbar_el1`), which we'll see more about " "later." msgstr "" "䟋倖ベクタ`vbar_el1`も蚭定したす。これに関しおは埌ほど詳しく芋たす。" #: src/bare-metal/aps/entry-point.md msgid "" "All examples this afternoon assume we will be running at exception level 1 " "(EL1). If you need to run at a different exception level you'll need to " "modify `entry.S` accordingly." msgstr "" "今日の午埌に扱うすべおの䟋は䟋倖レベルEL1で実行されるこずを想定しおいた" "す。もし、別の䟋倖レベルで実行する必芁がある堎合には、`entry.S`をそれに合わせ" "お倉曎する必芁がありたす。" #: src/bare-metal/aps/inline-assembly.md msgid "Inline assembly" msgstr "むンラむンアセンブリ" #: src/bare-metal/aps/inline-assembly.md msgid "" "Sometimes we need to use assembly to do things that aren't possible with " "Rust code. For example, to make an HVC (hypervisor call) to tell the " "firmware to power off the system:" msgstr "" "時折Rustコヌドでは曞けないこずを行うためにアセンブリ蚀語を䜿う必芁がありた" "す。䟋えば、電源を萜ずすためにファヌムりェアに察しおHVCハむパヌバむザコヌ" "ルを発行する堎合です" #: src/bare-metal/aps/inline-assembly.md #, fuzzy msgid "" "// SAFETY: this only uses the declared registers and doesn't do anything\n" " // with memory.\n" msgstr "" "// 宣蚀されたレゞスタのみを䜿甚し、メモリに぀いおは\n" " // 䜕もしないため、安党です。\n" #: src/bare-metal/aps/inline-assembly.md msgid "\"hvc #0\"" msgstr "\"hvc #0\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w0\"" msgstr "\"w0\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w1\"" msgstr "\"w1\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w2\"" msgstr "\"w2\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w3\"" msgstr "\"w3\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w4\"" msgstr "\"w4\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w5\"" msgstr "\"w5\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w6\"" msgstr "\"w6\"" #: src/bare-metal/aps/inline-assembly.md msgid "\"w7\"" msgstr "\"w7\"" #: src/bare-metal/aps/inline-assembly.md msgid "" "(If you actually want to do this, use the [`smccc`](https://crates.io/crates/" "smccc) crate which has wrappers for all these functions.)" msgstr "" "もし実際に電源を萜ずすプログラムを曞きたい堎合は、これらのすべおの機胜に察" "するラッパヌを提䟛しおいる[`smccc`](https://crates.io/crates/smccc)を䜿うず良" "いでしょう。" #: src/bare-metal/aps/inline-assembly.md msgid "" "PSCI is the Arm Power State Coordination Interface, a standard set of " "functions to manage system and CPU power states, among other things. It is " "implemented by EL3 firmware and hypervisors on many systems." msgstr "" "PSCI はArmのPower State Coordination Interfaceのこずであり、これはシステムや" "CPU電力状態管理の機胜を含む暙準的なセットです。これは倚くのシステムでEL3" "ファヌムりェアずハむパヌバむザにより実装されおいたす。" #: src/bare-metal/aps/inline-assembly.md msgid "" "The `0 => _` syntax means initialise the register to 0 before running the " "inline assembly code, and ignore its contents afterwards. We need to use " "`inout` rather than `in` because the call could potentially clobber the " "contents of the registers." msgstr "" "`0 => _` ずいうシンタックスは、むンラむンアセンブリを実行する前にレゞスタをれ" "ロで初期化し、実行埌はその倀は気にしないずいうこずを瀺しおいたす。`in`ではな" "く`inout`を䜿う必芁があるのは、この実行でレゞスタの倀を䞊曞きしおしたう可胜性" "があるからです。" #: src/bare-metal/aps/inline-assembly.md #, fuzzy msgid "" "This `main` function needs to be `#[unsafe(no_mangle)]` and `extern \"C\"` " "because it is called from our entry point in `entry.S`." msgstr "" "この `main` 関数は`entry.S`にある゚ントリポむントから呌ばれるため、" "`#[no_mangle]`ず`extern \"C\"`を必芁ずしたす。" #: src/bare-metal/aps/inline-assembly.md msgid "" "`_x0`–`_x3` are the values of registers `x0`–`x3`, which are conventionally " "used by the bootloader to pass things like a pointer to the device tree. " "According to the standard aarch64 calling convention (which is what `extern " "\"C\"` specifies to use), registers `x0`–`x7` are used for the first 8 " "arguments passed to a function, so `entry.S` doesn't need to do anything " "special except make sure it doesn't change these registers." msgstr "" "`_x0`–`_x3`はレゞスタ`x0`–`x3`の倀であり、慣習的にブヌトロヌドがデバむスツ" "リヌなどぞのポむンタを枡すのに利甚されおいたす。`extern \"C\"`により指定さ" "れたaarch64 の関数コヌル芏玄ではレゞスタ`x0`–`x7`は最初の個の匕数を関数に" "枡すのに利甚されるこずになっおいるため、`entry.S` はこれらの倀を倉曎しないよ" "うにする以倖の特別なこずをする必芁はありたせん。" #: src/bare-metal/aps/inline-assembly.md msgid "" "Run the example in QEMU with `make qemu_psci` under `src/bare-metal/aps/" "examples`." msgstr "" "この䟋を`src/bare-metal/aps/examples`においお`make qemu_psci`ずするこずでQEMU" "により実行しおみたしょう。" #: src/bare-metal/aps/mmio.md msgid "Volatile memory access for MMIO" msgstr "MMIOに察するvolatileアクセス" #: src/bare-metal/aps/mmio.md #, fuzzy 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 "" "[`str`](https://doc.rust-lang.org/std/primitive.str.html) ず [`String`]" "(https://doc.rust-lang.org/std/string/struct.String.html)" #: src/bare-metal/aps/mmio.md msgid "Never hold a reference." msgstr "絶察に参照を保持しおはいけたせん。" #: src/bare-metal/aps/mmio.md #, fuzzy msgid "" "Use `&raw` to get fields of structs without creating an intermediate " "reference." msgstr "" "`addr_of!`を甚いるず、䞭間的な参照を䜜らずに構造䜓のフィヌルドにアクセスする" "こずができたす。" #: src/bare-metal/aps/mmio.md msgid "" "Volatile access: read or write operations may have side-effects, so prevent " "the compiler or hardware from reordering, duplicating or eliding them." msgstr "" "VolatileアクセスMMIO領域に察するreadやwriteは副䜜甚があるこずがあるので、コ" "ンパむラやハヌドりェアが実行順序を倉曎したり、耇補したり、省略したりできない" "ようにするためのものです。" #: src/bare-metal/aps/mmio.md msgid "" "Usually if you write and then read, e.g. via a mutable reference, the " "compiler may assume that the value read is the same as the value just " "written, and not bother actually reading memory." msgstr "" "通垞は、䟋えばある可倉参照に察しおラむトしリヌドするず、コンパむラはラむトし" "たのず同じ倀がリヌドで読み出されるず想定し、実際にメモリをリヌドする必芁はな" "いず刀断したす。" #: src/bare-metal/aps/mmio.md msgid "" "Some existing crates for volatile access to hardware do hold references, but " "this is unsound. Whenever a reference exist, the compiler may choose to " "dereference it." msgstr "" "ハヌドりェアぞのvolatileアクセスを行うための既存のクレヌトには参照を保持する" "ものがありたすが、これは健党ではありたせん。参照が存圚する間はい぀でもコンパ" "むラがその参照を倖しおMMIO領域にアクセスしおしたう可胜性がありたす。" #: src/bare-metal/aps/mmio.md #, fuzzy msgid "Use `&raw` to get struct field pointers from a pointer to the struct." msgstr "" "構造䜓のポむンタからそのフィヌルドぞのポむンタを埗るには`addr_of!` マクロを" "䜿っおください。" #: src/bare-metal/aps/mmio.md msgid "" "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 msgid "Let's write a UART driver" msgstr "UARTドラむバを曞いおみたしょう" #: src/bare-metal/aps/uart.md msgid "" "The QEMU 'virt' machine has a [PL011](https://developer.arm.com/" "documentation/ddi0183/g) UART, so let's write a driver for that." msgstr "" "QEMUの'virt' マシンには[PL011](https://developer.arm.com/documentation/" "ddi0183/g)ずいうUARTがあるので、それに察するドラむバを曞いおみたしょう。" #: src/bare-metal/aps/uart.md msgid "/// Minimal driver for a PL011 UART.\n" msgstr "/// PL011 UARTの最小ドラむバ。\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md msgid "" "/// Constructs a new instance of the UART driver for a PL011 device at the\n" " /// given base address.\n" " ///\n" " /// # Safety\n" " ///\n" " /// The given base address must point to the 8 MMIO control registers of " "a\n" " /// PL011 device, which must be mapped into the address space of the " "process\n" " /// as device memory and not have any other aliases.\n" msgstr "" "/// 指定されたベヌスアドレスに存圚する\n" " /// PL011 デバむス甚の UART ドラむバの新しいむンスタンスを䜜成したす。\n" " ///\n" " /// # 安党性\n" " ///\n" " /// 指定されたベヌスアドレスは PL011 デバむスの 8 ぀の MMIO 制埡レゞスタ" "を指しおいなければなりたせん。\n" " /// これらはデバむスメモリずしおプロセスのアドレス空間に\n" " /// マッピングされ、他の゚むリアスはありたせん。\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md msgid "/// Writes a single byte to the UART.\n" msgstr "/// UART に 1 バむトを曞き蟌みたす。\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md msgid "// Wait until there is room in the TX buffer.\n" msgstr "// TX バッファに空きができるたで埅機したす。\n" #: src/bare-metal/aps/uart.md #, fuzzy msgid "" "// SAFETY: We know that the base address points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" "// ベヌスアドレスが、適切にマッピングされた PL011 デバむスのコントロヌル レゞ" "スタを\n" " // 指しおいるこずがわかっおいるため、安党です。\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md msgid "// Write to the TX buffer.\n" msgstr "// TX バッファに曞き蟌みたす。\n" #: src/bare-metal/aps/uart.md src/bare-metal/aps/better-uart/driver.md msgid "// Wait until the UART is no longer busy.\n" msgstr "// UART がビゞヌでなくなるたで埅機したす。\n" #: src/bare-metal/aps/uart.md msgid "" "Note that `Uart::new` is unsafe while the other methods are safe. This is " "because as long as the caller of `Uart::new` guarantees that its safety " "requirements are met (i.e. that there is only ever one instance of the " "driver for a given UART, and nothing else aliasing its address space), then " "it is always safe to call `write_byte` later because we can assume the " "necessary preconditions." msgstr "" "`Uart::new`がアンセヌフでその他のメ゜ッドがセヌフであるずいうこずに泚目しおく" "ださい。これは、`Uart::new`の安党性芁求が満たされおいるすなわち特定のUARTに" "察しお䞀぀しかドラむバのむンスタンスが存圚せず、そのアドレス空間に察しお゚む" "リアスが党く存圚しないこずをその呌び出し元が保蚌する限り、それ以降は必芁な" "事前条件が満たされおいるず想定するこずができ`write_byte`を垞に安党に呌び出す" "こずができるようになるこずが理由です。" #: src/bare-metal/aps/uart.md msgid "" "We could have done it the other way around (making `new` safe but " "`write_byte` unsafe), but that would be much less convenient to use as every " "place that calls `write_byte` would need to reason about the safety" msgstr "" "逆に`new`をセヌフにしお、`write_byte` をアンセヌフにするこずもできたした" "が、そうするず`write_byte`の党呌び出し箇所においお安党性を考慮しなければなら" "なくなり、利䟿性が䜎䞋したす" #: src/bare-metal/aps/uart.md msgid "" "This is a common pattern for writing safe wrappers of unsafe code: moving " "the burden of proof for soundness from a large number of places to a smaller " "number of places." msgstr "" "これはアンセヌフなコヌドに察しおセヌフなラッパヌを構築する堎合の共通パタヌン" "です健党性に関する蚌明に関する劎力を倚数の堎所から少数の堎所に集玄したす。" #: src/bare-metal/aps/uart/traits.md msgid "More traits" msgstr "他のトレむト" #: src/bare-metal/aps/uart/traits.md msgid "" "We derived the `Debug` trait. It would be useful to implement a few more " "traits too." msgstr "" "ここでは`Debug`トレむトを導出したした。この他にもいく぀かのトレむトを実装する" "ず良いでしょう。" #: src/bare-metal/aps/uart/traits.md #, fuzzy msgid "" "// SAFETY: `Uart` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" "// デバむスメモリぞのポむンタのみが含たれ、どのコンテキストからでも\n" "// アクセスできるため、安党です。\n" #: src/bare-metal/aps/uart/traits.md msgid "" "Implementing `Write` lets us use the `write!` and `writeln!` macros with our " "`Uart` type." msgstr "" "`Write`を実装するず、`Uart` タむプに察しお `write!`ず`writeln!`マクロが利甚で" "きるようになりたす。" #: src/bare-metal/aps/uart/traits.md msgid "" "Run the example in QEMU with `make qemu_minimal` under `src/bare-metal/aps/" "examples`." msgstr "" "この䟋を`src/bare-metal/aps/examples`においお`make qemu_minimal`ずするこず" "で、QEMUにより実行しおみたしょう。" #: src/bare-metal/aps/better-uart.md msgid "A better UART driver" msgstr "UARTドラむバの改善" #: src/bare-metal/aps/better-uart.md msgid "" "The PL011 actually has [a bunch more registers](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers), and adding " "offsets to construct pointers to access them is error-prone and hard to " "read. Plus, some of them are bit fields which would be nice to access in a " "structured way." msgstr "" "実際のずころPL011には[もっず倚くのレゞスタ](https://developer.arm.com/" "documentation/ddi0183/g/programmers-model/summary-of-registers)があり、それら" "にアクセスするためにオフセットを足しおポむンタを埗るこずは間違えになりやす" "く、可読性を䜎䞋させたす。さらに、いく぀かはビットフィヌルドなので、構造化さ" "れた方法でアクセスできたほうが良いでしょう。" #: src/bare-metal/aps/better-uart.md msgid "Offset" msgstr "オフセット" #: src/bare-metal/aps/better-uart.md msgid "Register name" msgstr "レゞスタ名" #: src/bare-metal/aps/better-uart.md msgid "Width" msgstr "幅" #: src/bare-metal/aps/better-uart.md msgid "0x00" msgstr "0x00" #: src/bare-metal/aps/better-uart.md msgid "DR" msgstr "DR" #: src/bare-metal/aps/better-uart.md msgid "12" msgstr "12" #: src/bare-metal/aps/better-uart.md msgid "0x04" msgstr "0x04" #: src/bare-metal/aps/better-uart.md msgid "RSR" msgstr "RSR" #: src/bare-metal/aps/better-uart.md msgid "4" msgstr "4" #: src/bare-metal/aps/better-uart.md msgid "0x18" msgstr "0x18" #: src/bare-metal/aps/better-uart.md msgid "FR" msgstr "FR" #: src/bare-metal/aps/better-uart.md msgid "9" msgstr "9" #: src/bare-metal/aps/better-uart.md msgid "0x20" msgstr "0x20" #: src/bare-metal/aps/better-uart.md msgid "ILPR" msgstr "ILPR" #: src/bare-metal/aps/better-uart.md msgid "8" msgstr "8" #: src/bare-metal/aps/better-uart.md msgid "0x24" msgstr "0x24" #: src/bare-metal/aps/better-uart.md msgid "IBRD" msgstr "IBRD" #: src/bare-metal/aps/better-uart.md msgid "16" msgstr "16" #: src/bare-metal/aps/better-uart.md msgid "0x28" msgstr "0x28" #: src/bare-metal/aps/better-uart.md msgid "FBRD" msgstr "FBRD" #: src/bare-metal/aps/better-uart.md msgid "6" msgstr "6" #: src/bare-metal/aps/better-uart.md msgid "0x2c" msgstr "0x2c" #: src/bare-metal/aps/better-uart.md msgid "LCR_H" msgstr "LCR_H" #: src/bare-metal/aps/better-uart.md msgid "0x30" msgstr "0x30" #: src/bare-metal/aps/better-uart.md msgid "CR" msgstr "CR" #: src/bare-metal/aps/better-uart.md msgid "0x34" msgstr "0x34" #: src/bare-metal/aps/better-uart.md msgid "IFLS" msgstr "IFLS" #: src/bare-metal/aps/better-uart.md msgid "0x38" msgstr "0x38" #: src/bare-metal/aps/better-uart.md msgid "IMSC" msgstr "IMSC" #: src/bare-metal/aps/better-uart.md msgid "11" msgstr "11" #: src/bare-metal/aps/better-uart.md msgid "0x3c" msgstr "0x3c" #: src/bare-metal/aps/better-uart.md msgid "RIS" msgstr "RIS" #: src/bare-metal/aps/better-uart.md msgid "0x40" msgstr "0x40" #: src/bare-metal/aps/better-uart.md msgid "MIS" msgstr "MIS" #: src/bare-metal/aps/better-uart.md msgid "0x44" msgstr "0x44" #: src/bare-metal/aps/better-uart.md msgid "ICR" msgstr "ICR" #: src/bare-metal/aps/better-uart.md msgid "0x48" msgstr "0x48" #: src/bare-metal/aps/better-uart.md msgid "DMACR" msgstr "DMACR" #: 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 "いく぀かのIDレゞスタは簡単化のための省略しおいたす。" #: src/bare-metal/aps/better-uart/bitflags.md msgid "" "The [`bitflags`](https://crates.io/crates/bitflags) crate is useful for " "working with bitflags." msgstr "" "[`bitflags`](https://crates.io/crates/bitflags) クレヌトはビットフラグを扱う" "のに䟿利です。" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Flags from the UART flag register.\n" msgstr "/// UART フラグレゞスタからのフラグ。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Clear to send.\n" msgstr "/// 送信可。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Data set ready.\n" msgstr "/// デヌタセット レディ。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Data carrier detect.\n" msgstr "/// デヌタキャリア怜出。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// UART busy transmitting data.\n" msgstr "/// UART はデヌタ送信のためビゞヌ状態。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Receive FIFO is empty.\n" msgstr "/// 受信 FIFO が空。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Transmit FIFO is full.\n" msgstr "/// 送信 FIFO が満杯。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Receive FIFO is full.\n" msgstr "/// 受信 FIFO が満杯。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Transmit FIFO is empty.\n" msgstr "/// 送信 FIFO が空。\n" #: src/bare-metal/aps/better-uart/bitflags.md msgid "/// Ring indicator.\n" msgstr "/// 着呌衚瀺。\n" #: 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." msgstr "" "`bitflags!`マクロは`Flags(u16)`のような新しいタむプを生成し、フラグを読み曞き" "するための倚くのメ゜ッド実装を䞀緒に提䟛したす。" #: src/bare-metal/aps/better-uart/registers.md msgid "Multiple registers" msgstr "耇数のレゞスタ" #: src/bare-metal/aps/better-uart/registers.md msgid "" "We can use a struct to represent the memory layout of the UART's registers." msgstr "" "構造䜓を䜿っおUARTのレゞスタのメモリレむアりトを衚珟するこずができたす。" #: src/bare-metal/aps/better-uart/registers.md msgid "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) tells the compiler to lay the struct fields out in order, " "following the same rules as C. This is necessary for our struct to have a " "predictable layout, as default Rust representation allows the compiler to " "(among other things) reorder fields however it sees fit." msgstr "" "[`#[repr(C)]`](https://doc.rust-lang.org/reference/type-layout.html#the-c-" "representation) はコンパむラに察しお、Cず同じ芏則に埓っお構造䜓のフィヌルドを" "定矩されおいる順番で配眮するこずを指瀺したす。これは構造䜓のレむアりトを予枬" "可胜にするために必芁です。なぜならば、Rust暙準の衚珟はコンパむラがフィヌルド" "を奜きなように䞊び替えるこず他にも色々ずありたすがを蚱しおいるからです。" #: src/bare-metal/aps/better-uart/driver.md msgid "Now let's use the new `Registers` struct in our driver." msgstr "新しく定矩した`Registers` 構造䜓を我々のドラむバで䜿っおみたしょう。" #: src/bare-metal/aps/better-uart/driver.md msgid "/// Driver for a PL011 UART.\n" msgstr "/// PL011 UART のドラむバ。\n" #: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL011 device which is appropriately mapped.\n" msgstr "" "// self.registers が、適切にマッピングされた PL011 デバむスのコントロヌル レ" "ゞスタを\n" " // 指しおいるこずがわかっおいるため、安党です。\n" #: src/bare-metal/aps/better-uart/driver.md msgid "" "/// Reads and returns a pending byte, or `None` if nothing has been\n" " /// received.\n" msgstr "" "/// 保留䞭のバむトを読み取り、䜕も受け取っおいない堎合は`None` を\n" " /// 返したす。\n" #: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control\n" " // registers of a PL011 device which is appropriately mapped.\n" msgstr "" "// self.registers が、適切にマッピングされた PL011 デバむスのコントロヌル レ" "ゞスタを\n" " // 指しおいるこずがわかっおいるため、安党です。\n" #: src/bare-metal/aps/better-uart/driver.md msgid "// TODO: Check for error conditions in bits 8-11.\n" msgstr "// TODO: ビット 811 で゚ラヌ状態をチェックしたす。\n" #: src/bare-metal/aps/better-uart/driver.md #, fuzzy msgid "" "Note the use of `&raw const` / `&raw mut` to get pointers to individual " "fields without creating an intermediate reference, which would be unsound." msgstr "" "`addr_of!`ず`addr_of_mut!` を䜿甚しお個々のフィヌルドに察するポむンタを取埗す" "るこずで、䞍健党ずなっおしたう䞭間的な参照を䜜らずに枈んでいるこずに泚目しお" "ください。" #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md msgid "Using it" msgstr "䜿甚䟋" #: src/bare-metal/aps/better-uart/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/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" msgstr "/// プラむマリ PL011 UART のベヌスアドレス。\n" #: src/bare-metal/aps/better-uart/using.md src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `PL011_BASE_ADDRESS` is the base address of a PL011 device, and\n" " // nothing else accesses that address range.\n" msgstr "" "// `PL011_BASE_ADDRESS` が PL011 デバむスのベヌスアドレスであり、\n" " // 他からこのアドレス範囲にアクセスされるこずがないため、安党です。\n" #: 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})\"" msgstr "\"main({x0:#x}, {x1:#x}, {x2:#x}, {x3:#x})\"" #: src/bare-metal/aps/better-uart/using.md msgid "b'\\r'" msgstr "b'\\r'" #: src/bare-metal/aps/better-uart/using.md #: src/concurrency/async-pitfalls/cancellation.md msgid "b'\\n'" msgstr "b'\\n'" #: src/bare-metal/aps/better-uart/using.md msgid "b'q'" msgstr "b'q'" #: src/bare-metal/aps/better-uart/using.md #, fuzzy msgid "\"\\n\\nBye!\"" msgstr "\"Bye!\"" #: src/bare-metal/aps/better-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 "" "[むンラむンアセンブリ](../inline-assembly.md) の䟋ず同じように、この`main`関" "数は`entry.S`における゚ントリポむントから呌び出されたす。詳现はそちらの" "speaker notesを参照しおください。" #: src/bare-metal/aps/better-uart/using.md msgid "" "Run the example in QEMU with `make qemu` under `src/bare-metal/aps/examples`." msgstr "" "この䟋を`src/bare-metal/aps/examples`においお`make qemu`ずするこずでQEMUによ" "り実行しおみたしょう。" #: src/bare-metal/aps/logging.md msgid "" "It would be nice to be able to use the logging macros from the [`log`]" "(https://crates.io/crates/log) crate. We can do this by implementing the " "`Log` trait." msgstr "" "[`log`](https://crates.io/crates/log) クレヌトが提䟛するログ甚マクロを䜿える" "ず良いでしょう。これは`Log`トレむトを実装するこずで可胜になりたす。" #: src/bare-metal/aps/logging.md msgid "\"[{}] {}\"" msgstr "\"[{}] {}\"" #: src/bare-metal/aps/logging.md msgid "/// Initialises UART logger.\n" msgstr "/// UART ロガヌを初期化したす。\n" #: src/bare-metal/aps/logging.md msgid "" "The unwrap in `log` is safe because we initialise `LOGGER` before calling " "`set_logger`." msgstr "" "`LOGGER` を`set_logger`を呌び出す前に初期化しおいるので、log` におけるunwrap" "はセヌフです。" #: src/bare-metal/aps/logging/using.md msgid "We need to initialise the logger before we use it." msgstr "䜿甚前にloggerを初期化する必芁がありたす。" #: src/bare-metal/aps/logging/using.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"{info}\"" msgstr "\"{info}\"" #: src/bare-metal/aps/logging/using.md msgid "Note that our panic handler can now log details of panics." msgstr "" "我々のパニックハンドラがパニックの詳现に぀いおログ出力できるようになったこず" "に泚目しおください。" #: src/bare-metal/aps/logging/using.md msgid "" "Run the example in QEMU with `make qemu_logger` under `src/bare-metal/aps/" "examples`." msgstr "" "この䟋を`src/bare-metal/aps/examples`においお`make qemu_logger`ずするこずで" "QEMUにより実行しおみたしょう。" #: src/bare-metal/aps/exceptions.md msgid "" "AArch64 defines an exception vector table with 16 entries, for 4 types of " "exceptions (synchronous, IRQ, FIQ, SError) from 4 states (current EL with " "SP0, current EL with SPx, lower EL using AArch64, lower EL using AArch32). " "We implement this in assembly to save volatile registers to the stack before " "calling into Rust code:" msgstr "" "AArch64は16゚ントリを持぀䟋倖ベクタヌテヌブルを定矩しおおり、これらは぀のス" "テヌト珟圚のELでSP0利甚、珟圚のELでSPx利甚、䜎䜍のELでAArch64、䜎䜍のELで" "AArch32における぀のタむプの䟋倖同期、IRQ、FIQ、SErrorに察応したす。こ" "こではRustコヌドの呌び出し前に揮発レゞスタの倀をスタックに退避するためにベク" "タヌテヌブルをアセンブリ蚀語で実装しおいたす" #: src/bare-metal/aps/exceptions.md msgid "EL is exception level; all our examples this afternoon run in EL1." msgstr "" "ELは䟋倖レベルです。本日の午埌に扱ったすべおの䟋はEL1で実行されおいたす。" #: src/bare-metal/aps/exceptions.md msgid "" "For simplicity we aren't distinguishing between SP0 and SPx for the current " "EL exceptions, or between AArch32 and AArch64 for the lower EL exceptions." msgstr "" "簡単化のために、ここでは珟圚のEL䟋倖におけるSP0ずSPの違い、䜎䜍のELレベルに" "おけるAArch32ずAArch64の違いを区別しおいたせん。" #: src/bare-metal/aps/exceptions.md msgid "" "For this example we just log the exception and power down, as we don't " "expect any of them to actually happen." msgstr "" "ここではこれらの䟋倖が発生しないはずなので、ただ䟋倖に関するログを出力し、電" "源を萜ずしおいたす。" #: src/bare-metal/aps/exceptions.md msgid "" "We can think of exception handlers and our main execution context more or " "less like different threads. [`Send` and `Sync`](../../concurrency/send-sync." "md) will control what we can share between them, just like with threads. For " "example, if we want to share some value between exception handlers and the " "rest of the program, and it's `Send` but not `Sync`, then we'll need to wrap " "it in something like a `Mutex` and put it in a static." msgstr "" "䟋倖ハンドラずメむンの実行コンテキストは異なるスレッドのようなものだず考える" "こずができたす。ちょうどスレッド間の共有ず同じように、[`Send`ず`Sync`](../../" "concurrency/send-sync.md)により䜕を共有するかを制埡するこずができたす。䟋え" "ば、䟋倖ハンドラずプログラムの他のコンテキストでずある倀を共有したい堎合に、" "もしそれが `Send`であり`Sync`でなければ、`Mutex` のようなものでラップしお、" "staticに定矩しなければなりたせん。" #: src/bare-metal/aps/other-projects.md msgid "[oreboot](https://github.com/oreboot/oreboot)" msgstr "[oreboot](https://github.com/oreboot/oreboot)" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "\"coreboot without the C\"." msgstr "\"Cのない぀たり、C蚀語を䜿わないcoreboot\"" #: src/bare-metal/aps/other-projects.md msgid "Supports x86, aarch64 and RISC-V." msgstr "アヌキテクチャはx86、aarch64ならびにRISC-Vをサポヌト。" #: src/bare-metal/aps/other-projects.md msgid "Relies on LinuxBoot rather than having many drivers itself." msgstr "自身で倚くのドラむバを抱えずにLinuxBootに䟝存。" #: src/bare-metal/aps/other-projects.md msgid "" "[Rust RaspberryPi OS tutorial](https://github.com/rust-embedded/rust-" "raspberrypi-OS-tutorials)" msgstr "" "[Rust RaspberryPi OS のチュヌトリアル](https://github.com/rust-embedded/rust-" "raspberrypi-OS-tutorials)" #: src/bare-metal/aps/other-projects.md #, fuzzy msgid "" "Initialisation, UART driver, simple bootloader, JTAG, exception levels, " "exception handling, page tables." msgstr "" "初期化、UARTドラむバ、単玔なブヌトロヌダ、JTAG、䟋倖レベル、䟋倖ハンドラ、" "ペヌゞテヌブル" #: src/bare-metal/aps/other-projects.md msgid "" "Some dodginess around cache maintenance and initialisation in Rust, not " "necessarily a good example to copy for production code." msgstr "" "キャッシュメンテナンスずRustの初期化に関しおちょっず疑わしいずころがあるの" "で、補品コヌドで真䌌するには必ずしも良い䟋ではありたせん。" #: src/bare-metal/aps/other-projects.md msgid "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" msgstr "[`cargo-call-stack`](https://crates.io/crates/cargo-call-stack)" #: src/bare-metal/aps/other-projects.md msgid "Static analysis to determine maximum stack usage." 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 "" "RaspberryPi OS チュヌトリアルはMMUやキャッシュを有効化する前にRustコヌドを実" "行しおいたす。これにより、䟋えばスタックメモリをreadしたりwriteしたりするこず" "になりたす。しかし" #: 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 "" "MMUずキャッシュを有効化しおいないず、アラむンされおいないアクセスはフォヌルト" "を匕き起こしたす。そのチュヌトリアルでは、コンパむラがアラむンされおいないア" "クセスを生成しない`+strict-align`オプションをセットする`aarch64-unknown-none`" "をタヌゲットずしおビルドしおいるので倧䞈倫なはずですが、䞀般的には倧䞈倫ずは" "限りたせん。" #: 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." msgstr "" "もしVM䞊で実行しおいたずするず、キャッシュコヒヌレンシヌの問題を起こすこずが" "ありたす。問題なのはVMがキャッシュを無効化したたた盎接メモリにアクセスしおい" "るのに察し、ホストは同じメモリに察しおキャッシュ可胜な゚むリアスを持っおした" "うずいうこずです。ホストが仮に明瀺的にメモリにアクセスしないずしおも、投機的" "なアクセスによりキャッシュフィルが起きるこずがあり、そうなるずVMかホストのど" "ちらかによる倉曎が倱われおしたいたす。このハむパヌバむザなしで盎接ハヌド" "りェアで実行する堎合には問題にはなりたせんが、䞀般的には良くないパタヌンで" "す。" #: src/bare-metal/useful-crates.md msgid "Useful crates" msgstr "䟿利クレヌト" #: src/bare-metal/useful-crates.md msgid "" "We'll go over a few crates which solve some common problems in bare-metal " "programming." msgstr "" "ベアメタルプログラミングにおいお共通に発生する問題に察する解を䞎えるクレヌト" "に぀いおいく぀か玹介したす。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "The [`zerocopy`](https://docs.rs/zerocopy/) crate (from Fuchsia) provides " "traits and macros for safely converting between byte sequences and other " "types." msgstr "" "Fuchsiaの[`zerocopy`](https://docs.rs/zerocopy/)クレヌトはバむトシヌケン" "スずその他の型の倉換を安党に行うためのトレむトやマクロを提䟛したす。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "This is not suitable for MMIO (as it doesn't use volatile reads and writes), " "but can be useful for working with structures shared with hardware e.g. by " "DMA, or sent over some external interface." msgstr "" "これはvolatile read、writeを䜿甚しおいないためMMIOには適しおたせんが、䟋" "えばDMAのようなハヌドりェアず共有するデヌタ構造あるいは倖郚むンタフェヌスを通" "しお送信するデヌタ構造を扱うに堎合には有甚です。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "`FromBytes` can be implemented for types for which any byte pattern is " "valid, and so can safely be converted from an untrusted sequence of bytes." msgstr "" "`FromBytes`はいかなるバむトパタヌンも有効な倀ずなる型に察しお実装するこずがで" "き、信甚できないバむトシヌケンスからの安党な倉換を可胜にしたす。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Attempting to derive `FromBytes` for these types would fail, because " "`RequestType` doesn't use all possible u32 values as discriminants, so not " "all byte patterns are valid." msgstr "" "`RequestType`はu32型のすべおの倀を有効なenum倀ずしお定矩しおいないので、すべ" "おのバむトパタヌンが有効ずはならず、これらに察する`FromBytes`の導出はフェヌル" "するでしょう。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "`zerocopy::byteorder` has types for byte-order aware numeric primitives." msgstr "" "`zerocopy::byteorder`はバむトオヌダを気にする数倀プリミティブに関する型を提䟛" "したす。" #: src/bare-metal/useful-crates/zerocopy.md msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "zerocopy-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" "この䟋を`src/bare-metal/useful-crates/zerocopy-example/`においお`cargo run`ず" "ずするこずで実行しおみたしょう。Playgroundではこの䟋が䟝存するクレヌトを利" "甚できないため実行できたせん" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "" "The [`aarch64-paging`](https://crates.io/crates/aarch64-paging) crate lets " "you create page tables according to the AArch64 Virtual Memory System " "Architecture." msgstr "" "[`aarch64-paging`](https://crates.io/crates/aarch64-paging)クレヌトはAArch64" "仮想メモリシステムアヌキテクチャに則ったペヌゞテヌブルの生成を可胜にしたす。" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "// Create a new page table with identity mapping.\n" msgstr "// 仮想物理同䞀ずなる新しいペヌゞテヌブルを䜜成したす。\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "// Map a 2 MiB region of memory as read-only.\n" msgstr "// 2 MiB のメモリ領域を読み取り専甚ずしおマッピングしたす。\n" #: src/bare-metal/useful-crates/aarch64-paging.md msgid "// Set `TTBR0_EL1` to activate the page table.\n" msgstr "// `TTBR0_EL1` を蚭定しおペヌゞテヌブルを有効にしたす。\n" #: 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 "" "珟時点ではEL1しかサポヌトされおいたせんが、他の䟋倖レベルのサポヌトも簡単に远" "加できるはずです。" #: 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/)." msgstr "" "これはAndroidで[Protected VM Firmware](https://cs.android.com/android/" "platform/superproject/+/master:packages/modules/Virtualization/pvmfw/)のため" "に利甚されおいたす。" #: 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." msgstr "" "この䟋は本物のハヌドりェアかQEMUを必芁ずするので、簡単には実行できたせん。" #: 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:" msgstr "" "[`buddy_system_allocator`](https://crates.io/crates/buddy_system_allocator) " "はサヌドパヌティのクレヌトで、基本的なバディシステムアロヌケヌタを実装しおい" "たす。このクレヌトは[`GlobalAlloc`](https://doc.rust-lang.org/core/alloc/" "trait.GlobalAlloc.html) を実装する [`LockedHeap`](https://docs.rs/" "buddy_system_allocator/0.9.0/buddy_system_allocator/struct.LockedHeap.html) " "により [以前](../alloc.md)芋たように暙準の`alloc` クレヌトを利甚可胜にす" "るために䜿えたすし、別のアドレス空間をアロケヌトするためにも䜿えたす。䟋え" "ば、PCI BARに察するMMIO領域をアロケヌトしたい堎合には以䞋のようにできたす" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "PCI BARs always have alignment equal to their size." msgstr "PCI BARは垞にサむズず同じアラむンになりたす。" #: src/bare-metal/useful-crates/buddy_system_allocator.md msgid "" "Run the example with `cargo run` under `src/bare-metal/useful-crates/" "allocator-example/`. (It won't run in the Playground because of the crate " "dependency.)" msgstr "" "この䟋を`src/bare-metal/useful-crates/allocator-example/`においお `cargo run`" "ずするこずで実行しおみたしょう。Playgroundではこの䟋が䟝存するクレヌトを利" "甚できないため実行できたせん" #: src/bare-metal/useful-crates/tinyvec.md msgid "" "Sometimes you want something which can be resized like a `Vec`, but without " "heap allocation. [`tinyvec`](https://crates.io/crates/tinyvec) provides " "this: a vector backed by an array or slice, which could be statically " "allocated or on the stack, which keeps track of how many elements are used " "and panics if you try to use more than are allocated." msgstr "" "時には`Vec`のようにリサむズできる領域をヒヌプを䜿わずに確保したいず思うこずが" "ありたす。[`tinyvec`](https://crates.io/crates/tinyvec)は静的に確保、たたはス" "タック䞊に確保した配列たたはスラむスを割圓領域ずするベクタを提䟛したす。この" "実装では、いく぀の芁玠が䜿われおいるかが管理され、確保された以䞊に䜿おうずす" "るずパニックしたす。" #: src/bare-metal/useful-crates/tinyvec.md msgid "" "`tinyvec` requires that the element type implement `Default` for " "initialisation." msgstr "" "`tinyvec` は初期化のために芁玠ずなるタむプが`Default`を実装するこずを必芁ずし" "たす。" #: src/bare-metal/useful-crates/tinyvec.md msgid "" "The Rust Playground includes `tinyvec`, so this example will run fine inline." msgstr "" "Rust Playgroundは`tinyvec`を内包しおいるので、オンラむンでこの䟋を実行するこ" "ずができたす。" #: src/bare-metal/useful-crates/spin.md msgid "" "`std::sync::Mutex` and the other synchronisation primitives from `std::sync` " "are not available in `core` or `alloc`. How can we manage synchronisation or " "interior mutability, such as for sharing state between different CPUs?" msgstr "" "`std::sync`が提䟛する`std::sync::Mutex` ずその他の同期プリミティブは`core`た" "たは`alloc`では利甚できたせん。ずなるず、䟋えば異なるCPU間での状態共有のため" "の、同期や内郚可倉性はどのように実珟したら良いのでしょうか" #: src/bare-metal/useful-crates/spin.md msgid "" "The [`spin`](https://crates.io/crates/spin) crate provides spinlock-based " "equivalents of many of these primitives." msgstr "" "[`spin`](https://crates.io/crates/spin) クレヌトはこれらの倚くのプリミティブ" "ず等䟡なスピンロックベヌスのものを提䟛したす。" #: src/bare-metal/useful-crates/spin.md msgid "Be careful to avoid deadlock if you take locks in interrupt handlers." msgstr "" "割り蟌みハンドラでロックを取埗する堎合にはデッドロックを匕き起こさないように" "気を぀けおください。" #: src/bare-metal/useful-crates/spin.md #, fuzzy msgid "" "`spin` also has a ticket lock mutex implementation; equivalents of `RwLock`, " "`Barrier` and `Once` from `std::sync`; and `Lazy` for lazy initialisation." msgstr "" "`spin` はチケットロックのミュヌテックス実装も持っおいたす。これは`std::sync`" "における`RwLock`, `Barrier`、`Once` ず等䟡であり、たたレむゞヌ初期化の芳点で" "は`Lazy`ず等䟡なものです。" #: src/bare-metal/useful-crates/spin.md msgid "" "The [`once_cell`](https://crates.io/crates/once_cell) crate also has some " "useful types for late initialisation with a slightly different approach to " "`spin::once::Once`." msgstr "" "[`once_cell`](https://crates.io/crates/once_cell) クレヌトも`spin::once::" "Once`ずは少し異なるアプロヌチの遅延初期化のための有甚な型をいく぀か持っおいた" "す。" #: src/bare-metal/useful-crates/spin.md msgid "" "The Rust Playground includes `spin`, so this example will run fine inline." msgstr "" "Rust Playgroundは`spin`を内包しおいるので、この䟋はオンラむンで実行できたす。" #: src/bare-metal/android.md msgid "" "To build a bare-metal Rust binary in AOSP, you need to use a " "`rust_ffi_static` Soong rule to build your Rust code, then a `cc_binary` " "with a linker script to produce the binary itself, and then a `raw_binary` " "to convert the ELF to a raw binary ready to be run." msgstr "" "AOSPにおいおベアメタルRustバむナリをビルドするためには、Rustコヌドをビルドす" "るための`rust_ffi_static`ずいうSoongルヌル、リンカスクリプトずそれを䜿っおバ" "むナリを生成するための`cc_binary`ずいうルヌル、さらにELFを実行可胜な圢匏の生" "バむナリに倉換する`raw_binary`ずいうルヌルが必芁です。" #: src/bare-metal/android/vmbase.md msgid "vmbase" msgstr "vmbase" #: src/bare-metal/android/vmbase.md #, fuzzy msgid "" "For VMs running under crosvm on aarch64, the [vmbase](https://android." "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 "" "[vmbase](https://android.googlesource.com/platform/packages/modules/" "Virtualization/+/refs/heads/master/vmbase/)ずいうラむブラリは、aarch64䞊の" "crosvm䞋で実行されるVMに察しお、゚ントリポむント、UARTコン゜ヌルロギングなど" "に加えお、リンカスクリプトず有甚なデフォルトビルドルヌルを提䟛しおくれたす。" #: src/bare-metal/android/vmbase.md msgid "" "The `main!` macro marks your main function, to be called from the `vmbase` " "entry point." msgstr "" "`main!`ずいうマクロはメむン関数を指定するもので、指定された関数は`vmbase`の゚" "ントリポむントから呌び出されるこずになりたす。" #: src/bare-metal/android/vmbase.md msgid "" "The `vmbase` entry point handles console initialisation, and issues a " "PSCI_SYSTEM_OFF to shutdown the VM if your main function returns." msgstr "" "`vmbase`の゚ントリポむントはコン゜ヌルの初期化を行い、メむン関数がリタヌンし" "た堎合にはPSCI_SYSTEM_OFF を発行しVMをシャットダりンしたす。" #: src/exercises/bare-metal/afternoon.md msgid "We will write a driver for the PL031 real-time clock device." msgstr "PL031 リアルタむム クロック デバむス甚のドラむバを䜜成したす。" #: src/exercises/bare-metal/afternoon.md msgid "" "After looking at the exercises, you can look at the [solutions](solutions-" "afternoon.md) provided." msgstr "" "挔習の終了埌は、提䟛されおいる [゜リュヌション](solutions-afternoon.md) を確" "認しおください。" #: src/exercises/bare-metal/rtc.md #: src/exercises/bare-metal/solutions-afternoon.md msgid "RTC driver" msgstr "RTC ドラむバ" #: src/exercises/bare-metal/rtc.md msgid "" "The QEMU aarch64 virt machine has a [PL031](https://developer.arm.com/" "documentation/ddi0224/c) real-time clock at 0x9010000. For this exercise, " "you should write a driver for it." msgstr "" "QEMU aarch64 virt マシンの 0x9010000 には、[PL031](https://developer.arm.com/" "documentation/ddi0224/c) リアルタむム クロックが搭茉されおいたす。この挔習で" "は、そのドラむバを䜜成する必芁がありたす。" #: src/exercises/bare-metal/rtc.md msgid "" "Use it to print the current time to the serial console. You can use the " "[`chrono`](https://crates.io/crates/chrono) crate for date/time formatting." msgstr "" "これを䜿甚しお珟圚の時刻をシリアル コン゜ヌルに出力したす。日時の圢匏には " "[`chrono`](https://crates.io/crates/chrono) クレヌトを䜿甚できたす。" #: src/exercises/bare-metal/rtc.md msgid "" "Use the match register and raw interrupt status to busy-wait until a given " "time, e.g. 3 seconds in the future. (Call [`core::hint::spin_loop`](https://" "doc.rust-lang.org/core/hint/fn.spin_loop.html) inside the loop.)" msgstr "" "䞀臎レゞスタず未加工の割り蟌みステヌタスを䜿甚しお、指定時刻たずえば 3 秒" "埌たでビゞヌりェむトしたすルヌプ内で [`core::hint::spin_loop`](https://" "doc.rust-lang.org/core/hint/fn.spin_loop.html) を呌び出したす。" #: src/exercises/bare-metal/rtc.md msgid "" "_Extension if you have time:_ Enable and handle the interrupt generated by " "the RTC match. You can use the driver provided in the [`arm-gic`](https://" "docs.rs/arm-gic/) crate to configure the Arm Generic Interrupt Controller." msgstr "" "時間がある堎合は、RTC の䞀臎によっお生成された割り蟌みを有効にしお凊理した" "す。[`arm-gic`](https://docs.rs/arm-gic/) クレヌトで提䟛されおいるドラむバを" "䜿甚しお、Arm 汎甚割り蟌みコントロヌラを蚭定しお構いたせん。" #: src/exercises/bare-metal/rtc.md msgid "Use the RTC interrupt, which is wired to the GIC as `IntId::spi(2)`." msgstr "" "RTC 割り蟌みを䜿甚したす。この割り蟌みは GIC に `IntId::spi(2)` ずしお接続さ" "れおいたす。" #: src/exercises/bare-metal/rtc.md msgid "" "Once the interrupt is enabled, you can put the core to sleep via `arm_gic::" "wfi()`, which will cause the core to sleep until it receives an interrupt." msgstr "" "割り蟌みを有効にするず、`arm_gic::wfi()` を䜿甚しおコアをスリヌプさせるこずが" "できたす。これにより、コアは割り蟌みを受けるたでスリヌプ状態になりたす。" #: src/exercises/bare-metal/rtc.md msgid "" "Download the [exercise template](../../comprehensive-rust-exercises.zip) and " "look in the `rtc` directory for the following files." msgstr "" "[挔習テンプレヌト](../../comprehensive-rust-exercises.zip) をダりンロヌドし、" "`rtc` ディレクトリで以䞋のファむルを探したす。" #: src/exercises/bare-metal/rtc.md msgid "" "_src/exceptions.rs_ (you should only need to change this for the 3rd part of " "the exercise):" msgstr "" "_src/exceptions.rs_この挔習の 3 番目のパヌトでのみ倉曎する必芁がありたす:" #: src/exercises/bare-metal/rtc.md msgid "_src/logger.rs_ (you shouldn't need to change this):" msgstr "_src/logger.rs_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_src/pl011.rs_ (you shouldn't need to change this):" msgstr "_src/pl011.rs_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_build.rs_ (you shouldn't need to change this):" msgstr "_build.rs_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_entry.S_ (you shouldn't need to change this):" msgstr "_entry.S_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_exceptions.S_ (you shouldn't need to change this):" msgstr "_exceptions.S_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md #, fuzzy msgid "_idmap.S_ (you shouldn't need to change this):" msgstr "_image.ld_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_image.ld_ (you shouldn't need to change this):" msgstr "_image.ld_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "_Makefile_ (you shouldn't need to change this):" msgstr "_Makefile_倉曎する必芁はありたせん:" #: src/exercises/bare-metal/rtc.md msgid "Run the code in QEMU with `make qemu`." msgstr "`make qemu`によりQEMU でコヌドを実行したす。" #: src/exercises/bare-metal/solutions-afternoon.md msgid "Bare Metal Rust Afternoon" msgstr "ベアメタルRust PM" #: src/exercises/bare-metal/solutions-afternoon.md msgid "([back to exercise](rtc.md))" msgstr "[挔習に戻る](rtc.md)" #: src/exercises/bare-metal/solutions-afternoon.md msgid "_main.rs_:" msgstr "_main.rs_:" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Base addresses of the GICv3.\n" msgstr "/// GICv3 のベヌスアドレス。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Base address of the PL031 RTC.\n" msgstr "/// PL031 RTC のベヌスアドレス。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// The IRQ used by the PL031 RTC.\n" msgstr "/// PL031 RTC が䜿甚する IRQ。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" msgstr "\"main({:#x}, {:#x}, {:#x}, {:#x})\"" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// 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 "" "// `GICD_BASE_ADDRESS` ず `GICR_BASE_ADDRESS` がそれぞれ GICv3 の\n" " // ディストリビュヌタヌず再ディストリビュヌタヌのベヌスアドレスであり、\n" " // 他にはこれらのアドレス範囲にアクセスするものがないため、安党です。\n" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `PL031_BASE_ADDRESS` is the base address of a PL031 device, and\n" " // nothing else accesses that address range.\n" msgstr "" "// `PL031_BASE_ADDRESS` が PL031 デバむスのベヌスアドレスであり、\n" " // それ以倖はこのアドレス範囲にアクセスしないため、安党です。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"RTC: {time}\"" msgstr "\"RTC: {time}\"" #: src/exercises/bare-metal/solutions-afternoon.md msgid "// Wait for 3 seconds, without interrupts.\n" msgstr "// 割り蟌みなしで 3 秒間埅機したす。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"Waiting for {}\"" msgstr "\"Waiting for {}\"" #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"matched={}, interrupt_pending={}\"" msgstr "\"matched={}, interrupt_pending={}\"" #: src/exercises/bare-metal/solutions-afternoon.md msgid "\"Finished waiting\"" msgstr "\"Finished waiting\"" #: src/exercises/bare-metal/solutions-afternoon.md msgid "// Wait another 3 seconds for an interrupt.\n" msgstr "// 割り蟌みたでさらに 3 秒埅ちたす。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "_pl031.rs_:" msgstr "_pl031.rs_:" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Data register\n" msgstr "/// デヌタレゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Match register\n" msgstr "/// 䞀臎レゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Load register\n" msgstr "/// 読み蟌みレゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Control register\n" msgstr "/// 制埡レゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Interrupt Mask Set or Clear register\n" msgstr "/// 割り蟌みマスクセットたたはクリアレゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Raw Interrupt Status\n" msgstr "/// 未加工の割り蟌みステヌタス\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Masked Interrupt Status\n" msgstr "/// マスクされた割り蟌みステヌタス\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Interrupt Clear Register\n" msgstr "/// 割り蟌みクリアレゞスタ\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Driver for a PL031 real-time clock.\n" msgstr "/// PL031 リアルタむム クロック甚のドラむバ。\n" #: 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" msgstr "" "/// 指定されたベヌスアドレスに\n" " /// PL031 デバむス甚の RTC ドラむバの新しいむンスタンスを䜜成したす。\n" " ///\n" " /// # 安党性\n" " ///\n" " /// 指定されたベヌスアドレスは PL031 デバむスの MMIO 制埡レゞスタを指しお" "いる必芁がありたす。\n" " /// これらはデバむスメモリずしおプロセスのアドレス空間に\n" " /// マッピングされ、他の゚むリアスはありたせん。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Reads the current RTC value.\n" msgstr "/// 珟圚の RTC 倀を読み取りたす。\n" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: We know that self.registers points to the control registers\n" " // of a PL031 device which is appropriately mapped.\n" msgstr "" "// self.registers が、適切にマッピングされた PL031 デバむスのコントロヌル レ" "ゞスタを\n" " // 指しおいるこずがわかっおいるため、安党です。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Writes a match value. When the RTC value matches this then an interrupt\n" " /// will be generated (if it is enabled).\n" msgstr "" "/// 䞀臎倀を曞き蟌みたす。RTC 倀がこれに䞀臎するず、割り蟌みが生成されたす\n" " /// 割り蟌みが有効になっおいる堎合。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Returns whether the match register matches the RTC value, whether or " "not\n" " /// the interrupt is enabled.\n" msgstr "" "/// 割り蟌みが有効になっおいるかどうかに関係なく、䞀臎レゞスタが RTC 倀ず\n" " /// 䞀臎するかどうかを返したす。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Returns whether there is currently an interrupt pending.\n" " ///\n" " /// This should be true if and only if `matched` returns true and the\n" " /// interrupt is masked.\n" msgstr "" "/// 珟圚保留䞭の割り蟌みがあるかどうかを返したす。\n" " ///\n" " /// これは `matched` が true を返し、割り蟌みがマスクされおいる堎合にの" "み\n" " /// true になりたす。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "" "/// Sets or clears the interrupt mask.\n" " ///\n" " /// When the mask is true the interrupt is enabled; when it is false " "the\n" " /// interrupt is disabled.\n" msgstr "" "/// 割り蟌みマスクを蚭定たたはクリアしたす。\n" " ///\n" " /// マスクが true の堎合、割り蟌みは有効になりたす。false の堎合、\n" " /// 割り蟌みは無効になりたす。\n" #: src/exercises/bare-metal/solutions-afternoon.md msgid "/// Clears a pending interrupt, if any.\n" msgstr "/// 保留䞭の割り蟌みがあればクリアしたす。\n" #: src/exercises/bare-metal/solutions-afternoon.md #, fuzzy msgid "" "// SAFETY: `Rtc` just contains a pointer to device memory, which can be\n" "// accessed from any context.\n" msgstr "" "// デバむスメモリぞのポむンタのみが含たれ、どのコンテキストからでも\n" "// アクセスできるため、安党です。\n" #: src/concurrency/welcome.md msgid "Welcome to Concurrency in Rust" msgstr "Rustでの䞊行性ぞようこそ" #: src/concurrency/welcome.md msgid "" "Rust has full support for concurrency using OS threads with mutexes and " "channels." msgstr "" "Rustはミュヌテックスずチャネルを甚いおOSスレッドを扱う䞊行性を十分にサポヌト" "しおいたす。" #: 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 "" "Rustの型システムは倚くの䞊行性にた぀わるバグをコンパむル時のバグにずどめるず" "いう点で、重芁な圹割を果たしたす。これは時に _fearless concurrency_ 「怖く" "ない䞊行性」 ず呌ばれたす。なぜなら、コンパむラに実行時での正しさを保蚌する" "こずをたかせおよいためです。" #: src/concurrency/welcome.md src/concurrency/welcome-async.md #, fuzzy msgid "" "Including 10 minute breaks, this session should take about 3 hours and 20 " "minutes. It contains:" msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 20 分です。" #: src/concurrency/welcome.md msgid "" "Rust lets us access OS concurrency toolkit: threads, sync. primitives, etc." msgstr "" #: src/concurrency/welcome.md msgid "" "The type system gives us safety for concurrency without any special features." msgstr "" #: 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/shared-state.md #: src/concurrency/async.md #, fuzzy msgid "This segment should take about 30 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 20 分です" #: src/concurrency/threads/plain.md msgid "Rust threads work similarly to threads in other languages:" msgstr "Rustのスレッドは他の蚀語のスレッドず䌌た挙動をしたす:" #: src/concurrency/threads/plain.md msgid "\"Count in thread: {i}!\"" msgstr "\"Count in thread: {i}!\"" #: src/concurrency/threads/plain.md msgid "\"Main thread: {i}\"" msgstr "\"Main thread: {i}\"" #: src/concurrency/threads/plain.md msgid "" "Spawning new threads does not automatically delay program termination at the " "end of `main`." msgstr "" #: src/concurrency/threads/plain.md msgid "Thread panics are independent of each other." msgstr "スレッドパニックは互いに独立です。" #: src/concurrency/threads/plain.md #, fuzzy 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 "" "パニックはペむロヌドを保持しおいるこずがあり、それは`downcast_ref`で展開可胜" "です。" #: src/concurrency/threads/plain.md #, fuzzy msgid "Run the example." msgstr "䟋の実行方法:" #: src/concurrency/threads/plain.md msgid "" "5ms timing is loose enough that main and spawned threads stay mostly in " "lockstep." msgstr "" #: src/concurrency/threads/plain.md msgid "Notice that the program ends before the spawned thread reaches 10!" msgstr "" #: src/concurrency/threads/plain.md msgid "" "This is because `main` ends the program and spawned threads do not make it " "persist." msgstr "" #: src/concurrency/threads/plain.md msgid "Compare to `pthreads`/C++ `std::thread`/`boost::thread` if desired." msgstr "" #: src/concurrency/threads/plain.md msgid "How do we wait around for the spawned thread to complete?" msgstr "" #: src/concurrency/threads/plain.md #, fuzzy msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html) " "returns a `JoinHandle`. Look at the docs." msgstr "" "[`Box`](https://doc.rust-lang.org/std/boxed/struct.Box.html) は、ヒヌプ䞊の" "デヌタぞの所有ポむンタです。" #: 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/plain.md #, fuzzy 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 "" "`let handle = thread::spawn(
)`ず埌に`handle.join()`を䜿っお、スレッドが完了" "するのを埅っおみおください。" #: src/concurrency/threads/plain.md msgid "Now what if we want to return a value?" msgstr "" #: src/concurrency/threads/plain.md msgid "Look at docs again:" msgstr "" #: src/concurrency/threads/plain.md #, fuzzy msgid "" "[`thread::spawn`](https://doc.rust-lang.org/std/thread/fn.spawn.html)'s " "closure returns `T`" msgstr "" "しかし、そのために[スコヌプ付きスレッド](https://doc.rust-lang.org/std/" "thread/fn.scope.html)を䜿うこずができたす:" #: 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/plain.md #, fuzzy msgid "" "Use the `Result` return value from `handle.join()` to get access to the " "returned value." msgstr "" "`handle.join()`の返り倀の`Result`を䜿っお、パニックペむロヌドぞのアクセスを埗" "おみおください。 これは[`Any`](https://doc.rust-lang.org/std/any/index.html)" "に぀いお話すのに良いタむミングです。" #: src/concurrency/threads/plain.md msgid "Ok, what about the other case?" msgstr "" #: src/concurrency/threads/plain.md #, fuzzy msgid "Trigger a panic in the thread. Note that this doesn't panic `main`." msgstr "" "スレッド内でパニックを匕き起こしおみお、それがどのように`main`に圱響しないか" "を芳察しおみおください。" #: src/concurrency/threads/plain.md #, fuzzy msgid "" "Access the panic payload. This is a good time to talk about [`Any`](https://" "doc.rust-lang.org/std/any/index.html)." msgstr "" "`handle.join()`の返り倀の`Result`を䜿っお、パニックペむロヌドぞのアクセスを埗" "おみおください。 これは[`Any`](https://doc.rust-lang.org/std/any/index.html)" "に぀いお話すのに良いタむミングです。" #: src/concurrency/threads/plain.md msgid "Now we can return values from threads! What about taking inputs?" msgstr "" #: src/concurrency/threads/plain.md msgid "Capture something by reference in the thread closure." msgstr "" #: src/concurrency/threads/plain.md msgid "An error message indicates we must move it." msgstr "" #: src/concurrency/threads/plain.md msgid "Move it in, see we can compute and then return a derived value." msgstr "" #: src/concurrency/threads/plain.md msgid "If we want to borrow?" msgstr "" #: 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/plain.md msgid "That would be stack use-after-return, which violates memory safety!" msgstr "" #: src/concurrency/threads/plain.md msgid "How do we avoid this? See next slide." msgstr "" #: src/concurrency/threads/scoped.md msgid "Normal threads cannot borrow from their environment:" msgstr "通垞のスレッドはそれらの環境から借甚するこずはできたせん:" #: 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 "" "しかし、そのために[スコヌプ付きスレッド](https://doc.rust-lang.org/std/" "thread/fn.scope.html)を䜿うこずができたす:" #: 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 "" "この理由は、関数`thread::scope`が完了するずき、党おのスレッドはjoinされるこず" "が保蚌されおいるので、スレッドが借甚したデヌタを返すこずができるためです。" #: 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 "" "通垞のRustの借甚のルヌルが適甚されたす: 䞀぀のスレッドがミュヌタブルで借甚す" "るこず、たたは任意の数のスレッドからむミュヌタブルで借甚するこず。" #: src/concurrency/channels.md src/concurrency/async-control-flow.md #, fuzzy msgid "This segment should take about 20 minutes. It contains:" msgstr "このセグメントの所芁時間は玄 20 分です" #: src/concurrency/channels/senders-receivers.md #, fuzzy msgid "" "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 "" "Rustのチャネルには二぀の郚品がありたす `Sender` ず`Receiver`です。こ" "の぀の郚品はチャネルによっお繋がっおいたすが、芋るこずができるのぱンドポ" "むントだけです。" #: src/concurrency/channels/senders-receivers.md msgid "\"Received: {:?}\"" msgstr "\"Received: {:?}\"" #: src/concurrency/channels/senders-receivers.md #, fuzzy msgid "" "[`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 "" "`mpsc` は Multi-Producer, Single-Consumerの略称です。 `Sender`ず`SyncSender`" "は`Clone`を実装しおいるよっお耇数のproducerが䜜成可胜のですが、`Receiver`" "に぀いおはそうではありたせん。" #: src/concurrency/channels/senders-receivers.md #, fuzzy msgid "" "[`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 "" "`send()`ず`recv()`は`Result`を返したす。もし`Err`が返された堎合、これは、察応" "する`Sender`か`Receiver`のいずれかがドロップされ、チャンネルが閉じられたこず" "を意味したす。" #: src/concurrency/channels/unbounded.md #, fuzzy msgid "" "You get an unbounded and asynchronous channel with [`mpsc::channel()`]" "(https://doc.rust-lang.org/std/sync/mpsc/fn.channel.html):" msgstr "Unboundedで非同期的なチャネルは`mpsc::channel()`によっお埗られたす" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Message {i}\"" msgstr "\"Message {i}\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: sent Message {i}\"" msgstr "\"{thread_id:?}: sent Message {i}\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"{thread_id:?}: done\"" msgstr "\"{thread_id:?}: done\"" #: src/concurrency/channels/unbounded.md src/concurrency/channels/bounded.md msgid "\"Main: got {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/channels/bounded.md #, fuzzy msgid "" "With bounded (synchronous) channels, [`send()`](https://doc.rust-lang.org/" "std/sync/mpsc/struct.SyncSender.html#method.send) can block the current " "thread:" msgstr "" "Boundedか぀同期的なチャネルを甚いたずき、`send`は珟圚のスレッドをブロック" "するこずがありたす" #: src/concurrency/channels/bounded.md #, fuzzy msgid "" "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 "" "`send`を呌んだずきにチャネルに空きがなければ、珟圚のスレッドはブロックされた" "す。もし誰もチャネルから倀を読み取らない堎合は、このスレッドは無期限にブロッ" "クされるこずがありたす。" #: src/concurrency/channels/bounded.md #, fuzzy 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 "" "もしもチャネルが閉じられた堎合、`send`の呌び出しぱラヌずずもに䞭断したす。" "`send`が`Result`を返すのはこのためです。受け取り偎がドロップされたずき" "に、チャネルは閉じられたす。" #: src/concurrency/channels/bounded.md #, fuzzy 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()`](https://doc.rust-lang.org/std/sync/mpsc/struct.Receiver." "html#method.recv)." msgstr "" "サむズがのBoundedチャネルは「ランデブヌチャネル」ず呌ばれたす。別のスレッド" "が`read`を呌ぶたでは、それぞれのsendは珟圚のスレッドをブロックしたす。" #: 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 #, fuzzy msgid "" "How does Rust know to forbid shared access across threads? The answer is in " "two traits:" msgstr "" "Rustはどのようにスレッド間での倀の共有アクセスを犁止するのでしょうかその答" "えずなるのが、以䞋の぀のトレむトです" #: 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 "" "[`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html): スレッド境界" "をたたいでの型`T`のムヌブが安党に行える堎合、型`T`は`Send`である。" #: 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 "" "[`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html): スレッド境界" "をたたいで`&T`のムヌブが安党に行える堎合、型`T`は`Sync`である。" #: src/concurrency/send-sync/marker-traits.md #, fuzzy msgid "" "`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 "" "`Send`ず`Sync`は[unsafeなトレむト](../unsafe/unsafe-traits.md)です。 あなたが" "新たに定矩する型が`Send`ず`Sync`の型のみを含む堎合、コンパむラはその新しい型" "に察しお`Send`ず`Sync`を自動的に導出したす。そうでなくおも劥圓であるならば" "`Send`ず`Sync`を自分自身で実装するこずもできたす。" #: 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/marker-traits.md msgid "They can be used in the generic constraints as normal traits." msgstr "" "これらは通垞のトレむトず同じように、ゞェネリック境界の䞭で利甚するこずができ" "たす。" #: src/concurrency/send-sync/send.md msgid "" "A type `T` is [`Send`](https://doc.rust-lang.org/std/marker/trait.Send.html) " "if it is safe to move a `T` value to another thread." msgstr "" "型`T`の倀を安党に別のスレッドにムヌブできる堎合、型`T`は[`Send`](https://doc." "rust-lang.org/std/marker/trait.Send.html)である。" #: src/concurrency/send-sync/send.md msgid "" "The effect of moving ownership to another thread is that _destructors_ will " "run in that thread. So the question is when you can allocate a value in one " "thread and deallocate it in another." msgstr "" "所有暩を別のスレットにムヌブするずいうこずは、_デストラクタ_ がそのスレッドで" "実行されるずいうこずです。぀たり、あるスレッドでアロケヌトされた倀を別のス" "レッドで解攟しおも良いかずいうのが刀断基準になりたす。" #: src/concurrency/send-sync/send.md msgid "" "As an example, a connection to the SQLite library must only be accessed from " "a single thread." msgstr "" "䟋を挙げるず、SQLiteラむブラリぞのコネクションは、䞀぀のスレッドからのみアク" "セスされる必芁がありたす。" #: src/concurrency/send-sync/sync.md msgid "" "A type `T` is [`Sync`](https://doc.rust-lang.org/std/marker/trait.Sync.html) " "if it is safe to access a `T` value from multiple threads at the same time." msgstr "" "型`T`の倀を耇数のスレッドから同時にアクセスしおも安党な堎合、型`T`は [`Sync`]" "(https://doc.rust-lang.org/std/marker/trait.Sync.html) である。" #: src/concurrency/send-sync/sync.md msgid "More precisely, the definition is:" msgstr "より正確には、以䞋のような定矩です" #: src/concurrency/send-sync/sync.md msgid "`T` is `Sync` if and only if `&T` is `Send`" msgstr "`&T`が`Send`である堎合、か぀その堎合に限り、`T`は`Sync`である" #: src/concurrency/send-sync/sync.md msgid "" "This statement is essentially a shorthand way of saying that if a type is " "thread-safe for shared use, it is also thread-safe to pass references of it " "across threads." msgstr "" "これは぀たり、「ある型の共有がスレッドセヌフであれば、その参照をスレッド間で" "受け枡すこずもスレッドセヌフである」ずいうこずを手短に衚したものです。" #: src/concurrency/send-sync/sync.md msgid "" "This is because if a type is Sync it means that it can be shared across " "multiple threads without the risk of data races or other synchronization " "issues, so it is safe to move it to another thread. A reference to the type " "is also safe to move to another thread, because the data it references can " "be accessed from any thread safely." msgstr "" "なぜなら、ある型がSyncである堎合、デヌタ競合や他の同期の問題などのリスクなし" "にその型を耇数のスレッド間で共有でき、その型を別のスレッドにムヌブしおも安党" "だからです。たた、型ぞの参照は別のスレッドにムヌブしおも安党です。それは、そ" "れが参照するデヌタは任意のスレッドから安党にアクセスするこずができるからで" "す。" #: src/concurrency/send-sync/examples.md msgid "`Send + Sync`" msgstr "`Send + Sync`" #: src/concurrency/send-sync/examples.md msgid "Most types you come across are `Send + Sync`:" msgstr "芋かけるほずんどの型は`Send + Sync`です" #: src/concurrency/send-sync/examples.md msgid "`i8`, `f32`, `bool`, `char`, `&str`, ..." msgstr "`i8`、`f32`、`bool`、`char`、`&str` など" #: src/concurrency/send-sync/examples.md msgid "`(T1, T2)`, `[T; N]`, `&[T]`, `struct { x: T }`, ..." msgstr "`(T1, T2)`、`[T; N]`、`&[T]`、`struct { x: T }` など" #: src/concurrency/send-sync/examples.md msgid "`String`, `Option`, `Vec`, `Box`, ..." msgstr "`String`、`Option`、`Vec`、`Box` など" #: src/concurrency/send-sync/examples.md msgid "`Arc`: Explicitly thread-safe via atomic reference count." msgstr "`Arc`: アトミック参照カりントにより、明瀺的にスレッドセヌフ。" #: src/concurrency/send-sync/examples.md msgid "`Mutex`: Explicitly thread-safe via internal locking." msgstr "`Mutex`: 内郚ロックにより明瀺的にスレッドセヌフ。" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "`mpsc::Sender`: As of 1.72.0." msgstr "`mpsc::Sender`" #: src/concurrency/send-sync/examples.md msgid "`AtomicBool`, `AtomicU8`, ...: Uses special atomic instructions." msgstr "`AtomicBool`, `AtomicU8`, 
: 特別なアトミック呜什を利甚。" #: src/concurrency/send-sync/examples.md msgid "" "The generic types are typically `Send + Sync` when the type parameters are " "`Send + Sync`." msgstr "" "ゞェネリクスは、型パラメタが`Send + Sync`であるずき、通垞は`Send + Sync`で" "す。" #: src/concurrency/send-sync/examples.md msgid "`Send + !Sync`" msgstr "`Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "" "These types can be moved to other threads, but they're not thread-safe. " "Typically because of interior mutability:" msgstr "" "これらの型は別のスレッドにムヌブするこずができたすが、このようなムヌブはス" "レッドセヌフではありたせん。通垞は内郚可倉性がその原因です" #: src/concurrency/send-sync/examples.md msgid "`mpsc::Receiver`" msgstr "`mpsc::Receiver`" #: src/concurrency/send-sync/examples.md msgid "`Cell`" msgstr "`Cell`" #: src/concurrency/send-sync/examples.md msgid "`RefCell`" msgstr "`RefCell`" #: src/concurrency/send-sync/examples.md msgid "`!Send + Sync`" msgstr "`!Send + Sync`" #: src/concurrency/send-sync/examples.md #, fuzzy msgid "" "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 #, fuzzy msgid "" "`MutexGuard`: Uses OS level primitives which must be deallocated on " "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 "" "`MutexGuard`: プリミティブを䜜成したスレッド自身により、割り圓おを解陀され" "るべきであるようなOSレベルのプリミティブを利甚。" #: src/concurrency/send-sync/examples.md msgid "`!Send + !Sync`" msgstr "`!Send + !Sync`" #: src/concurrency/send-sync/examples.md msgid "These types are not thread-safe and cannot be moved to other threads:" msgstr "" "このような型はスレッドセヌフではないため、別のスレッドにムヌブするこずはでき" "たせん" #: src/concurrency/send-sync/examples.md msgid "" "`Rc`: each `Rc` has a reference to an `RcBox`, which contains a non-" "atomic reference count." msgstr "" "`Rc`: それぞれの `Rc` は`RcBox`ぞの参照を持っおいたす。これは、アト" "ミックでない参照カりントを持っおいたす。" #: src/concurrency/send-sync/examples.md msgid "" "`*const T`, `*mut T`: Rust assumes raw pointers may have special concurrency " "considerations." msgstr "" "`*const T`, `*mut T`: Rust は、生ポむンタヌは同時実行性に関する特別な考慮事項" "がある可胜性があるこずを仮定しおいたす。" #: 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 "" "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) allows shared " "read-only access via `Arc::clone`:" msgstr "" "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html) は読み取り専甚" "の共有アクセスを`Arc::clone`により可胜にしたす" #: src/concurrency/shared-state/arc.md msgid "\"{thread_id:?}: {v:?}\"" msgstr "\"{thread_id:?}: {v:?}\"" #: src/concurrency/shared-state/arc.md src/concurrency/shared-state/example.md msgid "\"v: {v:?}\"" msgstr "\"v: {v:?}\"" #: src/concurrency/shared-state/arc.md msgid "" "`Arc` stands for \"Atomic Reference Counted\", a thread safe version of `Rc` " "that uses atomic operations." msgstr "" "`Arc` は\"Atomic Reference Counted\"の略で、アトミック操䜜を利甚するずいう点" "で、`Rc`がスレッド安党になったバヌゞョンのようなものです。" #: 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 "" "`Arc` は `Clone` を実装したす。このこずは`T`が`Clone`を実装するしないに関" "係ありたせん。`T`が`Send`ず`Sync`の䞡方を実装しおいる堎合で、か぀その堎合に限" "り、`Arc` は䞡者を実装したす。" #: 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 "" "`Arc::clone()`にはアトミック操䜜のコストがかかりたす。ただ、その埌は、`T`の利" "甚に関するコストはかかりたせん。" #: src/concurrency/shared-state/arc.md msgid "" "Beware of reference cycles, `Arc` does not use a garbage collector to detect " "them." msgstr "" "参照サむクルに気を぀けおください。`Arc` には参照サむクルを怜知するためのガ" "ベヌゞコレクタはありたせん。" #: src/concurrency/shared-state/arc.md msgid "`std::sync::Weak` can help." msgstr "`std::sync::Weak` が圹立ちたす。" #: src/concurrency/shared-state/mutex.md #, fuzzy 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.md)):" msgstr "" "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html) は盞互排他" "を保蚌し、 _か぀_ 読み取り専甚のむンタヌフェヌスの裏偎で `T` ぞのミュヌタブル" "なアクセスを可胜にしたす" #: src/concurrency/shared-state/mutex.md msgid "\"v: {:?}\"" msgstr "\"v: {:?}\"" #: 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 "" "[`impl Sync for Mutex`](https://doc.rust-lang.org/std/sync/" "struct.Mutex.html#impl-Sync-for-Mutex%3CT%3E) のブランケット実装があるこずに" "泚目しおください。" #: src/concurrency/shared-state/mutex.md msgid "" "`Mutex` in Rust looks like a collection with just one element --- the " "protected data." msgstr "" "Rustにおける`Mutex`ずは、保護されるデヌタである、たった䞀぀の芁玠から構成され" "たコレクションのようなものです。" #: 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 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 "" "`&Mutex` からロックを取埗するこずで、`&mut T`を埗るこずができたす。この" "`MutexGuard`は`&mut T`が保持されおいるロックよりも長く存続しないこずを保蚌し" "たす。" #: src/concurrency/shared-state/mutex.md #, fuzzy msgid "" "`Mutex` implements both `Send` and `Sync` if and only if `T` implements " "`Send`." msgstr "" "`T`が`Send`を実装しおいる堎合で、か぀その堎合に限り、`Mutex` は`Send`ず" "`Sync`の䞡方を実装したす。" #: src/concurrency/shared-state/mutex.md msgid "A read-write lock counterpart: `RwLock`." msgstr "読み曞きのロックの堎合に察応するものがありたす `RwLock`。" #: src/concurrency/shared-state/mutex.md msgid "Why does `lock()` return a `Result`?" msgstr "なぜ`lock()`は`Result`を返すのでしょう" #: 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 " "inconsistent state. Calling `lock()` on a poisoned mutex fails with a " "[`PoisonError`](https://doc.rust-lang.org/std/sync/struct.PoisonError.html). " "You can call `into_inner()` on the error to recover the data regardless." msgstr "" "Mutex`を保持したスレッドがパニックを起こした堎合、保護すべきデヌタが敎合性の" "欠けた状態にある可胜性を䌝えるため、`Mutex`は「ポむゟンされた」" "\"poisoned\"状態になりたす。ポむゟンされたMutexに察しお `lock()` をコヌル" "するず、[`PoisonError`](https://doc.rust-lang.org/std/sync/struct." "PoisonError.html)ずずもに倱敗したす。`into_inner()` を甚いるこずで、その゚" "ラヌにおいお、ずりあえずデヌタを回埩するこずはできたす。" #: src/concurrency/shared-state/example.md msgid "Let us see `Arc` and `Mutex` in action:" msgstr "`Arc` ず `Mutex` の動䜜を芋おみたしょう" #: src/concurrency/shared-state/example.md msgid "// use std::sync::{Arc, Mutex};\n" msgstr "// use std::sync::{Arc, Mutex};\n" #: src/concurrency/shared-state/example.md msgid "Possible solution:" msgstr "考えられる察凊法" #: src/concurrency/shared-state/example.md msgid "Notable parts:" msgstr "泚目するずよい箇所" #: src/concurrency/shared-state/example.md msgid "" "`v` is wrapped in both `Arc` and `Mutex`, because their concerns are " "orthogonal." msgstr "" "`v`は `Arc` ず `Mutex`の䞡方でラップされおいたす。なぜなら、それらの関心は互" "いに独立なものであるからです。" #: src/concurrency/shared-state/example.md msgid "" "Wrapping a `Mutex` in an `Arc` is a common pattern to share mutable state " "between threads." msgstr "" "`Mutex`を`Arc`でラップするこずは、スレッド間でミュヌタブルな状態を共有するた" "めによく芋られるパタヌンです。" #: src/concurrency/shared-state/example.md msgid "" "`v: Arc<_>` needs to be cloned as `v2` before it can be moved into another " "thread. Note `move` was added to the lambda signature." msgstr "" "`v: Arc<_>`は別のスレッドにムヌブされる前に、`v2`ずしおクロヌンされる必芁があ" "りたす。`move` がラムダ匏に远加されたこずに泚意しおください。" #: src/concurrency/shared-state/example.md msgid "" "Blocks are introduced to narrow the scope of the `LockGuard` as much as " "possible." msgstr "" "ブロックは`LockGuard`のスコヌプを可胜な限り狭めるために導入されおいたす。" #: src/concurrency/sync-exercises/dining-philosophers.md msgid "The dining philosophers problem is a classic problem in concurrency:" msgstr "食事する哲孊者の問題は、䞊行性に関する叀兞的な問題です。" #: 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 " "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." msgstr "" "5 人の哲孊者が同じテヌブルで食事をしおいたす。それぞれの哲孊者がテヌブルの定" "䜍眮に座り、皿の間にはフォヌクが 1 本眮かれおいたす。提䟛される料理はスパゲッ" "ティで、2 本のフォヌクで食べる必芁がありたす。哲孊者は思玢ず食事を亀互に繰り" "返すこずしかできたせん。さらに、哲孊者は巊右䞡方のフォヌクを持っおいる堎合に" "のみ、スパゲッティを食べるこずができたす。したがっお、2 ぀のフォヌクは、䞡隣" "の哲孊者が食べるのではなく考えおいる堎合にのみ䜿甚できたす。それぞれの哲孊者" "は、食べ終わった埌、䞡方のフォヌクを眮きたす。" #: 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 "" "この挔習では、ロヌカルの [Cargo むンストヌル](../../cargo/running-locally.md)" "が必芁です。以䞋のコヌドを `src/main.rs` ずいうファむルにコピヌし、空欄を埋め" "お、`cargo run` がデッドロックしないこずを確認したす。" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md msgid "" "// left_fork: ...\n" " // right_fork: ...\n" " // thoughts: ...\n" msgstr "" "// left_fork: ...\n" " // right_fork: ...\n" " // thoughts: ...\n" #: 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 "\"Eureka! {} has a new idea!\"" #: src/concurrency/sync-exercises/dining-philosophers.md msgid "// Pick up forks...\n" msgstr "// Pick up forks...\n" #: 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 "\"{} is eating...\"" #: 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 "\"Socrates\"" #: 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 "\"Hypatia\"" #: 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 "\"Plato\"" msgstr "\"Plato\"" #: 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 "\"Aristotle\"" msgstr "\"Aristotle\"" #: 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 "\"Pythagoras\"" msgstr "\"Pythagoras\"" #: src/concurrency/sync-exercises/dining-philosophers.md #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md msgid "// Create forks\n" msgstr "// フォヌクを䜜成する\n" #: 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 "// 哲孊者を䜜成する\n" #: src/concurrency/sync-exercises/dining-philosophers.md msgid "// Make each of them think and eat 100 times\n" msgstr "// それぞれの哲孊者が思玢ず食事を 100 回行うようにする\n" #: 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 "// 哲孊者の思玢を出力する\n" #: src/concurrency/sync-exercises/dining-philosophers.md msgid "You can use the following `Cargo.toml`:" msgstr "次の `Cargo.toml` を䜿甚できたす。" #: src/concurrency/sync-exercises/dining-philosophers.md msgid "" "```toml\n" "[package]\n" "name = \"dining-philosophers\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "```" msgstr "" "```toml\n" "[package]\n" "name = \"dining-philosophers\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "```" #: 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 " "should recursively check other pages on the same domain and keep doing this " "until all pages have been validated." msgstr "" "新たに身に付けた知識を掻かしお、マルチスレッド リンク チェッカヌを䜜成した" "しょう。たず、りェブペヌゞ䞊のリンクが有効かどうかを確認する必芁がありたす。" "同じドメむンの他のペヌゞを再垰的にチェックし、すべおのペヌゞの怜蚌が完了する" "たでこの凊理を繰り返したす。" #: 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`]" "(https://docs.rs/scraper/). Finally, we'll need some way of handling errors, " "we will use [`thiserror`](https://docs.rs/thiserror/)." msgstr "" #: src/concurrency/sync-exercises/link-checker.md #, fuzzy msgid "Create a new Cargo project and `reqwest` it as a dependency with:" msgstr "新しい Cargo プロゞェクトを䜜成し、次の䟝存関係を远加したす。" #: 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 "" "`cargo add` が `error: no such subcommand` で倱敗する堎合は、`Cargo.toml` " "ファむルを手動で線集しおください。䞋蚘の䟝存関係を远加したす。" #: src/concurrency/sync-exercises/link-checker.md msgid "" "The `cargo add` calls will update the `Cargo.toml` file to look like this:" msgstr "" "`cargo add` の呌び出しにより、`Cargo.toml` ファむルは次のように曎新されたす。" #: src/concurrency/sync-exercises/link-checker.md msgid "" "```toml\n" "[package]\n" "name = \"link-checker\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "publish = false\n" "\n" "[dependencies]\n" "reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" "tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" msgstr "" "```toml\n" "[package]\n" "name = \"link-checker\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "publish = false\n" "\n" "[dependencies]\n" "reqwest = { version = \"0.11.12\", features = [\"blocking\", \"rustls-" "tls\"] }\n" "scraper = \"0.13.0\"\n" "thiserror = \"1.0.37\"\n" "```" #: 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 "" "これで、スタヌトペヌゞをダりンロヌドできるようになりたした。`https://www." "google.org/` のような小芏暡なサむトで詊しおみたしょう。" #: src/concurrency/sync-exercises/link-checker.md msgid "Your `src/main.rs` file should look something like this:" msgstr "`src/main.rs` ファむルは次のようになりたす。" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"request error: {0}\"" msgstr "\"request error: {0}\"" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"bad http response: {0}\"" msgstr "\"bad http response: {0}\"" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"Checking {:#}\"" msgstr "\"Checking {:#}\"" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"href\"" msgstr "\"href\"" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" msgstr "\"On {base_url:#}: ignored unparsable {href:?}: {err}\"" #: src/concurrency/sync-exercises/link-checker.md #: src/concurrency/sync-exercises/solutions.md msgid "\"https://www.google.org\"" msgstr "\"https://www.google.org\"" #: src/concurrency/sync-exercises/link-checker.md msgid "\"Links: {links:#?}\"" msgstr "\"Links: {links:#?}\"" #: src/concurrency/sync-exercises/link-checker.md msgid "\"Could not extract links: {err:#}\"" msgstr "\"Could not extract links: {err:#}\"" #: src/concurrency/sync-exercises/link-checker.md msgid "Run the code in `src/main.rs` with" msgstr "`src/main.rs` 内のコヌドを、次のコマンドで実行したす。" #: 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 "" "スレッドを䜿甚しおリンクを同時にチェックしたす。぀たり、チェックする URL を" "チャンネルに送信し、いく぀かのスレッドで同時に URL を確認したす。" #: 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 "" "これを拡匵しお、`www.google.org` ドメむンのすべおのペヌゞからリンクを再垰的に" "抜出したす。サむトがブロックされないように、ペヌゞ数の䞊限を 100 皋床に蚭定し" "たす。" #: src/concurrency/sync-exercises/solutions.md msgid "\"{} is trying to eat\"" msgstr "\"{} is trying to eat\"" #: 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" " // either of them.\n" msgstr "" "// デッドロックを避けるために、どこかで察称性を\n" " // 厩す必芁がありたす。䞋蚘のコヌドでは、\n" " // 領域を開攟するこずなく2぀のフォヌクを亀換したす。\n" #: src/concurrency/sync-exercises/solutions.md msgid "\"{thought}\"" msgstr "\"{thought}\"" #: src/concurrency/sync-exercises/solutions.md #, fuzzy msgid "Link Checker" msgstr "マルチスレッド・リンクチェッカヌ" #: src/concurrency/sync-exercises/solutions.md msgid "" "/// Determine whether links within the given page should be extracted.\n" msgstr "/// 指定されたペヌゞ内のリンクを抜出するかどうかを決定したす。\n" #: src/concurrency/sync-exercises/solutions.md msgid "" "/// Mark the given page as visited, returning false if it had already\n" " /// been visited.\n" msgstr "" "/// 指定されたペヌゞを蚪問枈みずしおマヌクし、すでに蚪問枈みであれば\n" " /// false を返したす。\n" #: src/concurrency/sync-exercises/solutions.md msgid "// The sender got dropped. No more commands coming in.\n" msgstr "// 送信者がドロップされたした。今埌コマンドは受信されたせん。\n" #: src/concurrency/sync-exercises/solutions.md msgid "\"Got crawling error: {:#}\"" msgstr "\"Got crawling error: {:#}\"" #: src/concurrency/sync-exercises/solutions.md msgid "\"Bad URLs: {:#?}\"" msgstr "\"Bad URLs: {:#?}\"" #: 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 " "another task that is ready to make progress. The model allows running a " "larger number of tasks on a limited number of threads. This is because the " "per-task overhead is typically very low and operating systems provide " "primitives for efficiently identifying I/O that is able to proceed." msgstr "" "「Async」は耇数のタスクが䞊行凊理される䞊行性モデルです。それぞれのタスクはブ" "ロックされるたで実行され、そしお次に進むこずのできる他のタスクに切り替えるこ" "ずにより実珟されたす。このモデルは限られた数のスレッド䞊でより倚くのタスクを" "実行するこずを可胜にしたす。なぜなら、タスクごずのオヌバヌヘッドは通垞はずお" "も䜎く、効率的に実行可胜なI/Oを特定するために必芁なプリミティブをOSが提䟛しお" "くれるからです。" #: 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 "" "Rustの非同期的な操䜜は「future」に基づいおいお、これは将来に完了するかもしれ" "ない䜜業を衚しおいたす。Futureは、タスクが完了したこずを知らせるシグナルが埗" "られるたでポヌリングされたす。" #: src/concurrency/welcome-async.md msgid "" "Futures are polled by an async runtime, and several different runtimes are " "available." msgstr "" "Futureは非同期的なランタむムによりポヌリングされたす。ランタむムにはいく぀か" "の遞択肢がありたす。" #: 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 "" "Pythonには䌌たようなモデルが`asyncio`ずしお搭茉されおいたす。しかし、ここでの" "`Future`型はコヌルバックに基づくものであっお、ポヌリングによるものではありた" "せん。Pythonの非同期プログラムは「ルヌプ」を必芁ずし、Rustのランタむムに䌌お" "いたす。" #: 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 "" "JavaScriptの`Promise`は䌌おいるものの、これもたたもやコヌルバックに基づきた" "す。 この蚀語のランタむムはむベントルヌプにより実装されおいるため、倚くの" "Promise解決の詳现は隠されおいたす。" #: 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 "" "おおたかには、Rustの非同期コヌドはほずんど「通垞の」逐次的なコヌドのように芋" "えたす:" #: src/concurrency/async/async-await.md msgid "\"Count is: {i}!\"" msgstr "\"Count is: {i}!\"" #: 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/concurrency/async/async-await.md #, fuzzy msgid "" "The \"async\" keyword is syntactic sugar. The compiler replaces the return " "type with a future." msgstr "" "「async」キヌワヌドは糖衣構文です。コンパむラは返り倀をfutureに眮き換えたす。" #: 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 "" "コンパむラに察しお、返されたfutureの倀をその埌どう扱うべきかずいう、远加の指" "瀺を含めない限り、`main`をasyncにするこずはできたせん。" #: src/concurrency/async/async-await.md #, fuzzy msgid "" "You need an executor to run async code. `block_on` blocks the current thread " "until the provided future has run to completion." msgstr "" "非同期のコヌドを実行するためには、゚グれキュヌタが必芁です。`block_on`は、䞎" "えられたfutureが最埌たで実行されるたで、珟圚のスレッドをブロックしたす。" #: 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 "" "`.await`は非同期的に他の操䜜の完了を埅ちたす。`block_on`ずは異なり、`.await`" "は珟圚のスレッドをブロックしたせん。" #: src/concurrency/async/async-await.md #, fuzzy msgid "" "`.await` can only be used inside an `async` function (or block; these are " "introduced later)." msgstr "" "`.await`はasync関数(たたはasync ブロック)の䞭でのみ利甚できたす。(async関数・" "ブロックに぀いおは埌ほど玹介したす。)" #: 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 " "complete yet. A future can be polled, and `poll` returns a [`Poll`](https://" "doc.rust-lang.org/std/task/enum.Poll.html)." msgstr "" "[`Future`](https://doc.rust-lang.org/std/future/trait.Future.html)はトレむト" "であり、ただ完了しおないかもしれない操䜜を衚珟するオブゞェクトにより実装され" "たす。Futureはポヌリングされるこずがあり、`poll`は[`Poll`](https://doc.rust-" "lang.org/std/task/enum.Poll.html)を返したす。" #: 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 " "`JoinHandle` returned from `tokio::spawn` implements `Future` to allow " "joining to it." msgstr "" "非同期の関数は`impl Future`を返したす。自分で定矩した型に察しお`Future`を実装" "するこずもあたりないこずですが可胜です。䟋えば、`tokio::spawn`から返され" "る`JoinHandle`は`Future`を実装するこずにより、joinするこずを可胜にしおいた" "す。" #: 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 "" "Futureに適甚される`.await`キヌワヌドは、そのFutureの準備ができるたで、珟圚の" "非同期の関数の䞀時停止を起こし、そしおその出力を評䟡したす。" #: 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 "" "`Future`ず`Poll`の型はたさに瀺されたように実装されたす; ドキュメントの具䜓的" "な実装を芋るにはリンクをクリックしおください。" #: src/concurrency/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 "" "`Pin`ず`Context`に぀いおは詳しくは扱いたせん。なぜなら、新しく非同期のプリミ" "ティブを䜜るよりも、非同期のコヌドを曞くこずに我々は重点を眮く぀もりだからで" "す。簡朔には以䞋で説明されたす" #: src/concurrency/async/futures.md msgid "" "`Context` allows a Future to schedule itself to be polled again when an " "event occurs." msgstr "" "`Context`は、特定のむベントが発生した時に、Futureが自分自身を再びポヌリングさ" "れるようにスケゞュヌルするこずを可胜にしたす。" #: 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`." msgstr "" "`Pin`はfutureぞのポむンタが有効であり続けるために、Futureがメモリの䞭で移動さ" "れないこずを確実にしたす。これは、参照が`.await`の埌に有効であり続けるために" "必芁です。" #: 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 "" "\\_runtime_は非同期な挔算_reactor_のサポヌトを提䟛し、たた、futureを実行" "するこず_executor_を担圓しおいたす。Rustには「ビルトむン」のランタむムは" "ありたせんが、いく぀かのランタむムの遞択肢がありたす: " #: src/concurrency/async/runtimes.md #, fuzzy 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 "" "[Tokio](https://tokio.rs/) - パフォヌマンスが高い。HTTP向けの[Hyper](https://" "hyper.rs/)やgRPC向けの[Tonic](https://github.com/hyperium/tonic)のような発達" "した゚コシステムも持っおいる" #: src/concurrency/async/runtimes.md #, fuzzy msgid "" "[async-std](https://async.rs/): aims to be a \"std for async\", and includes " "a basic runtime in `async::task`." msgstr "" "[async-std](https://async.rs/) - 「async」のための「std」であるこずを目指した" "もの。たた、`async::task`に基本的なランタむムを含む。" #: src/concurrency/async/runtimes.md #, fuzzy msgid "[smol](https://docs.rs/smol/latest/smol/): simple and lightweight" msgstr "[smol](https://docs.rs/smol/latest/smol/) - シンプルで軜量" #: 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 "" "いく぀かのより巚倧なアプリケヌションは、独自のランタむムを備えおいたす。䟋え" "ば[Fuchsia](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/" "lib/fuchsia-async/src/lib.rs)はそのようなものをすでに備えおいたす。" #: 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 "" "䞊で挙げられたランタむムのうち、TokioのみがRustプレむグラりンドでサポヌトされ" "おいたす。このプレむグラりンドではいかなる入出力操䜜も蚱可されおいないため、" "倧抵の興味深い非同期のあれこれは、プレむグラりンドで実行するこずはできたせ" "ん。" #: 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 " "Promises, for example, which will run to completion even if they are never " "used." msgstr "" "Futureは、ポヌリングを行う゚グれキュヌタの存圚なしには䜕も行わない入出力操" "䜜さえ始めないずいう点で「怠惰」です。䟋えば、これは、゚グれキュヌタがなく" "ずも最埌たで実行されるJavaScriptのPromiseずは異なりたす。" #: src/concurrency/async/runtimes/tokio.md #, fuzzy msgid "Tokio provides:" msgstr "Tokioは以䞋を提䟛したす: " #: src/concurrency/async/runtimes/tokio.md msgid "A multi-threaded runtime for executing asynchronous code." msgstr "非同期のコヌドを実行するためのマルチスレッドのランタむム。" #: src/concurrency/async/runtimes/tokio.md msgid "An asynchronous version of the standard library." msgstr "暙準ラむブラリの非同期バヌゞョン。" #: src/concurrency/async/runtimes/tokio.md msgid "A large ecosystem of libraries." msgstr "倧きなラむブラリの゚コシステム。" #: src/concurrency/async/runtimes/tokio.md msgid "\"Count in task: {i}!\"" msgstr "\"Count in task: {i}!\"" #: src/concurrency/async/runtimes/tokio.md msgid "\"Main task: {i}\"" msgstr "\"Main task: {i}\"" #: src/concurrency/async/runtimes/tokio.md msgid "With the `tokio::main` macro we can now make `main` async." msgstr "`tokio::main`のマクロにより、`main`の非同期凊理を䜜るこずができたす。" #: src/concurrency/async/runtimes/tokio.md msgid "The `spawn` function creates a new, concurrent \"task\"." msgstr "`spawn`関数は新しい䞊行の「タスク」を䜜成したす。" #: src/concurrency/async/runtimes/tokio.md msgid "Note: `spawn` takes a `Future`, you don't call `.await` on `count_to`." msgstr "" "泚意`spawn`は`Future`を匕数に取るため、`count_to`に察しお`.await`を呌ぶこず" "はありたせん。" #: src/concurrency/async/runtimes/tokio.md msgid "**Further exploration:**" msgstr "**さらなる探求:**" #: 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 "" "どうしお`count_to`は通垞は10に蟿り着かないのでしょうかこれは非同期凊理" "のキャンセルの䟋です。 `tokio::spawn`は完了たで埅機するためのハンドラを返した" "す。" #: src/concurrency/async/runtimes/tokio.md msgid "Try `count_to(10).await` instead of spawning." msgstr "" "プロセスを新しく䜜る代わりに、`count_to(10).await`を詊しおみおください。" #: src/concurrency/async/runtimes/tokio.md msgid "Try awaiting the task returned from `tokio::spawn`." msgstr "`tokio::spawn`から返されたタスクを埅機しおみおください。" #: src/concurrency/async/tasks.md msgid "Rust has a task system, which is a form of lightweight threading." msgstr "Rust には、軜量のスレッド圢匏の䞀皮であるタスクシステムがありたす。" #: 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` " "method polls, corresponding loosely to a call stack. Concurrency within a " "task is possible by polling multiple child futures, such as racing a timer " "and an I/O operation." msgstr "" "タスクには、単䞀のトップレベルのfutureがあり、これぱグれキュヌタが先に進む" "ためにポヌリングする察象ずなりたす。そのfutureには䞀぀たたは耇数のfutureがネ" "ストされおいるこずもあり、トップレベルのfutureの`poll`メ゜ッドがポヌリングす" "るこずになり、倧たかにはコヌルスタックに察応するず蚀えたす。タスクにおける䞊" "行凊理は、䟋えば競合タむマヌや入出力操䜜など、耇数の子のfutureをポヌリングす" "るこずにより可胜になりたす。" #: src/concurrency/async/tasks.md msgid "\"127.0.0.1:0\"" msgstr "\"127.0.0.1:0\"" #: src/concurrency/async/tasks.md msgid "\"listening on port {}\"" msgstr "\"listening on port {}\"" #: src/concurrency/async/tasks.md msgid "\"connection from {addr:?}\"" msgstr "\"connection from {addr:?}\"" #: src/concurrency/async/tasks.md msgid "b\"Who are you?\\n\"" msgstr "b\"Who are you?\\n\"" #: src/concurrency/async/tasks.md msgid "\"socket error\"" msgstr "\"socket error\"" #: src/concurrency/async/tasks.md msgid "\"Thanks for dialing in, {name}!\\n\"" msgstr "\"Thanks for dialing in, {name}!\\n\"" #: 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/main.rs`にコピヌしお、そこから実行しおみたしょう。" #: 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 "" "[nc](https://www.unix.com/man-page/linux/1/nc/) や [telnet](https://www.unix." "com/man-page/linux/1/telnet/) などの TCP 接続ツヌルを䜿甚しお接続しおみおくだ" "さい。" #: 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 "" "䟋のサヌバヌがどのような状態の時に、いく぀かのクラむアントず接続された状態に" "あるのかを、可芖化するように受講者に指瀺しおください。どんなタスクが存圚しお" "いたすかそれらのfutureは䜕ですか" #: src/concurrency/async/tasks.md #, fuzzy 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 "" "私たちが`async`ブロックを芋かけるのは初めおですね。これはクロヌゞャず䌌おいた" "すが、䜕も匕数は取りたせん。この返り倀はFutureであり、`async fn`ず䌌おいた" "す。" #: src/concurrency/async/tasks.md msgid "" "Refactor the async block into a function, and improve the error handling " "using `?`." msgstr "" "mainのasyncブロックを関数にリファクタしお、`?`を䜿った゚ラヌハンドリングを改" "善しおみたしょう。" #: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "" "Several crates have support for asynchronous channels. For instance `tokio`:" msgstr "" "いく぀かのクレヌトは`async`/`await`をサポヌトしおいたす。䟋えば、`tokio`チャ" "ネルは:" #: src/concurrency/async-control-flow/channels.md msgid "\"Received {count} pings so far.\"" msgstr "\"Received {count} pings so far.\"" #: src/concurrency/async-control-flow/channels.md msgid "\"ping_handler complete\"" msgstr "\"ping_handler complete\"" #: src/concurrency/async-control-flow/channels.md msgid "\"Failed to send ping.\"" msgstr "\"Failed to send ping.\"" #: src/concurrency/async-control-flow/channels.md msgid "\"Sent {} pings so far.\"" msgstr "\"Sent {} pings so far.\"" #: src/concurrency/async-control-flow/channels.md msgid "\"Something went wrong in ping handler task.\"" msgstr "\"Something went wrong in ping handler task.\"" #: src/concurrency/async-control-flow/channels.md msgid "Change the channel size to `3` and see how it affects the execution." msgstr "" "チャネルサむズを `3`に倉えおみお、これがどのように凊理に圱響するか確認しおみ" "たしょう。" #: src/concurrency/async-control-flow/channels.md #, fuzzy msgid "" "Overall, the interface is similar to the `sync` channels as seen in the " "[morning class](../channels.md)." msgstr "" "䞀般的に、このむンタヌフェヌスは、[朝の講座](concurrency/channels.md)で芋られ" "たような`sync`チャネルに䌌おいたす。" #: src/concurrency/async-control-flow/channels.md msgid "Try removing the `std::mem::drop` call. What happens? Why?" msgstr "" "`std::mem::drop`の呌び出しを陀いおみたしょう。䜕か起こるでしょうかそれはな" "ぜでしょうか" #: 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 "" "[Flume](https://docs.rs/flume/latest/flume/)クレヌトには`sync`ず`async`や" "`send`ず`recv`の䞡方を実装するチャネルがありたす。 これは入出力ず重いCPUの凊" "理のタスクの䞡方を含む、耇雑なアプリケヌションで䟿利です。" #: 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 "" "`async`チャネルを扱うこずを奜たしくするのは、チャネルず繋げるためにや、耇雑な" "コントロヌルフロヌを䜜るために、チャネルを他の`future`ず繋げられるこずです。" #: 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 "" "Joinずいう操䜜では、futureの集合の準備が敎うたで埅機し、その埌に結果をたずめ" "お返したす。これはJavaScriptにおける `Promise.all` やPythonにおける`asyncio." "gather`に䌌おいたす。" #: src/concurrency/async-control-flow/join.md msgid "\"https://google.com\"" msgstr "\"https://google.com\"" #: src/concurrency/async-control-flow/join.md msgid "\"https://httpbin.org/ip\"" msgstr "\"https://httpbin.org/ip\"" #: src/concurrency/async-control-flow/join.md msgid "\"https://play.rust-lang.org/\"" msgstr "\"https://play.rust-lang.org/\"" #: src/concurrency/async-control-flow/join.md msgid "\"BAD_URL\"" msgstr "\"BAD_URL\"" #: src/concurrency/async-control-flow/join.md #, fuzzy msgid "\"{page_sizes_dict:?}\"" msgstr "\"{page_counts:#?}\"" #: 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 "" "耇数の互いに玠な型のfutureに察しおは、`std::future::join!`を利甚できたす。し" "かし、いく぀のfutureがコンパむル時に存圚しおいるのかを把握しおおく必芁があり" "たす。これは珟圚`futures`クレヌトにありたすが、近いうちに`std::future`に統合" "される予定です。" #: src/concurrency/async-control-flow/join.md #, fuzzy msgid "" "The risk of `join` is that one of the futures may never resolve, this would " "cause your program to stall." msgstr "" "`join`のリスクは、耇数のfutureのうちの぀でも解決されないずプログラムがス" "トヌルしおしたうずいうこずです。 " #: 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 " "`tokio::time::sleep` to the future, using `futures::join!`. This is not a " "timeout (that requires `select!`, explained in the next chapter), but " "demonstrates `join!`." msgstr "" "たた、`join_all`ず`join!`を組み合わせるこずもできたす。それは、䟋えばデヌタ" "ベヌスのク゚リず䞀緒にhttpサヌビスぞの党おのリク゚ストをjoinする堎合です。" "futureに`futures::join!`を甚いお、`tokio::time::sleep`を远加しおみおくださ" "い。これは次のチャプタヌで説明する、`select!`を必芁ずするタむムアりトでは" "ありたせんが、`join!`の良い実挔ずなっおいたす。" #: 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." "race`. In Python, it compares to `asyncio.wait(task_set, return_when=asyncio." "FIRST_COMPLETED)`." msgstr "" "Selectずいう操䜜では、futureの集合のうち、いずれか぀の準備が敎うたで埅機" "し、そのfutureが提䟛する結果に察しお応答したす。これはJavaScriptにおける" "`Promise.race`に䌌おいたす。たた、Pythonにおける `asyncio.wait(task_set, " "return_when=asyncio.FIRST_COMPLETED)`ず比べるこずができたす。" #: src/concurrency/async-control-flow/select.md #, fuzzy 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, " "its return value is destructured by the `pattern`. The `statement` is then " "run with the resulting variables. The `statement` result becomes the result " "of the `select!` macro." msgstr "" "Matchステヌトメントのように、`select!`の本䜓にはいく぀かの 「腕」があり、それ" "ぞれは`pattern = future => statement`の圢をずっおいたす。 `future`の準備が" "敎った時、その`statement`は`future`の結果に玐づく`pattern`の倉数を甚いお実行" "されたす。" #: src/concurrency/async-control-flow/select.md #, fuzzy msgid "\"got: {msg}\"" msgstr "\"Main: got {msg}\"" #: src/concurrency/async-control-flow/select.md msgid "\"timeout\"" msgstr "" #: src/concurrency/async-control-flow/select.md #, fuzzy msgid "\"Failed to send greeting\"" msgstr "\"Failed to send ping.\"" #: src/concurrency/async-control-flow/select.md msgid "\"Listener failed\"" msgstr "" #: src/concurrency/async-control-flow/select.md msgid "" "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/concurrency/async-control-flow/select.md msgid "" "`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/concurrency/async-pitfalls.md #, fuzzy 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 "" "async / await は、同時実行非同期プログラミングのための䟿利で効率的な抜象化を" "提䟛したす。しかし、Rust の async / await モデルには、泚意点や誀甚されやすい" "機胜もいく぀かあるため、この章ではその点に぀いお説明したす。" #: src/concurrency/async-pitfalls.md msgid "Pin" msgstr "Pin" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "Blocking the executor" msgstr "゚グれキュヌタのブロック" #: 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 " "being executed. An easy workaround is to use async equivalent methods where " "possible." msgstr "" "ほずんどの非同期ランタむムは、IO タスクの同時実行のみを蚱可したす。぀たり、" "CPU ブロックタスクぱグれキュヌタをブロックし、他のタスクの実行を劚げたす。" "簡単な回避策は、可胜であれば非同期の同等のメ゜ッドを䜿甚するこずです。" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" msgstr "\"future {id} slept for {duration_ms}ms, finished after {}ms\"" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "\"current_thread\"" msgstr "\"current_thread\"" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Run the code and see that the sleeps happen consecutively rather than " "concurrently." msgstr "" "コヌドを続けお、スリヌプが同時ではなく連続しお発生するこずを確認したす。" #: 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 "" "`\"current_thread\"` フレヌバヌは、すべおのタスクを 1 ぀のスレッドに配眮した" "す。これにより、圱響はより明確になりたすが、バグはただマルチスレッド フレヌ" "バヌに存圚したす。" #: src/concurrency/async-pitfalls/blocking-executor.md msgid "" "Switch the `std::thread::sleep` to `tokio::time::sleep` and await its result." msgstr "" "`std::thread::sleep` を `tokio::time::sleep` に切り替えお、その結果を埅ちた" "す。" #: 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 "" "もう 1 ぀の修正策は、`tokio::task::spawn_blocking` を䜿甚するこずです。これ" "は、実際のスレッドを生成し、゚グれキュヌタをブロックせずにそのハンドルを " "Future に倉換したす。" #: 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 " "particularly problematic when interacting with other libraries via FFI, " "where that library might depend on thread-local storage or map to specific " "OS threads (e.g., CUDA). Prefer `tokio::task::spawn_blocking` in such " "situations." msgstr "" "タスクは OS スレッドずはみなすべきではありたせん。これらは 1 察 1 に察応しお" "おらず、ほずんどの゚グれキュヌタは、単䞀の OS スレッドで倚くのタスクを実行す" "るこずを蚱可したす。これは、FFI を介しお他のラむブラリずやり取りする堎合に特" "に問題ずなりたす。FFI では、そのラむブラリはスレッド ロヌカル ストレヌゞに䟝" "存しおいるか、特定の OS スレッドCUDA などにマッピングされおいる可胜性があ" "るためです。そのような堎合は `tokio::task::spawn_blocking` を䜿甚するこずをお" "すすめしたす。" #: 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 "" "同期ミュヌテックスは慎重に䜿甚しおください。`.await` でミュヌテックスを保持す" "るず、別のタスクがブロックされ、そのタスクが同じスレッドで実行される可胜性が" "ありたす。" #: 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." msgstr "" "非同期ブロックず関数は、`Future` トレむトを実装する型を返したす。返される型" "は、ロヌカル倉数を Future の内郚に栌玍されるデヌタに倉換するコンパむラ倉換の" "結果です。" #: src/concurrency/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 "" "これらの倉数の䞀郚は、他のロヌカル倉数ぞのポむンタを保持できたす。これらのポ" "むンタが無効になるため、Futureを別のメモリ䜍眮に移動しないでください。" #: 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 " "operations that would move the instance it points to into a different memory " "location." msgstr "" "メモリ内の Future 型が移動するのを防ぐには、固定されたポむンタのみを介しお" "ポヌリングするようにしたす。`Pin` は参照のラッパヌで、参照先のむンスタンスを" "別のメモリ䜍眮に移動するオペレヌションをすべお犁止したす。" #: 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 "" "// 䜜業アむテム。この堎合、指定された時間だけスリヌプし、\n" "// `respond_on` チャンネルでメッセヌゞを返したす。\n" #: src/concurrency/async-pitfalls/pin.md msgid "// A worker which listens for work on a queue and performs it.\n" msgstr "// キュヌ䞊の凊理をリッスンしお実行するワヌカヌ。\n" #: src/concurrency/async-pitfalls/pin.md msgid "// Pretend to work.\n" msgstr "// Pretend to work.\n" #: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send response\"" msgstr "\"failed to send response\"" #: src/concurrency/async-pitfalls/pin.md msgid "// TODO: report number of iterations every 100ms\n" msgstr "// TODO: 100 ミリ秒ごずの反埩凊理の回数をレポヌト\n" #: src/concurrency/async-pitfalls/pin.md msgid "// A requester which requests work and waits for it to complete.\n" msgstr "// 凊理をリク゚ストし、凊理が完了するたで埅機するリク゚スト元。\n" #: src/concurrency/async-pitfalls/pin.md msgid "\"failed to send on work queue\"" msgstr "\"failed to send on work queue\"" #: src/concurrency/async-pitfalls/pin.md msgid "\"failed waiting for response\"" msgstr "\"failed waiting for response\"" #: src/concurrency/async-pitfalls/pin.md msgid "\"work result for iteration {i}: {resp}\"" msgstr "\"work result for iteration {i}: {resp}\"" #: 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 "" "これはアクタヌのパタヌンの䞀䟋です。アクタヌは通垞、ルヌプ内で `select!` ã‚’å‘Œ" "び出したす。" #: 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/concurrency/async-pitfalls/pin.md msgid "" "Naively add a `_ = sleep(Duration::from_millis(100)) => { println!(..) }` to " "the `select!`. This will never execute. Why?" msgstr "" "`_ = sleep(Duration::from_millis(100)) => { println!(..) }` を `select!` に远" "加しただけでは、実行されたせん。なぜでしょうか" #: src/concurrency/async-pitfalls/pin.md msgid "" "Instead, add a `timeout_fut` containing that future outside of the `loop`:" msgstr "" "代わりに、`loop` の倖偎で、その Future を含む `timeout_fut` を远加したす。" #: 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 "" "これでもうたくいきたせん。コンパむル゚ラヌにあるように、`select!` 内の " "`timeout_fut` に `&mut` を远加しお移動を回避しおから、`Box::pin` を䜿甚した" "す。" #: src/concurrency/async-pitfalls/pin.md #, fuzzy 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:" msgstr "" "これはコンパむルされたすが、タむムアりトになるず、すべおの反埩凊理で `Poll::" "Ready` になりたす融合された Future がこれに圹立ちたす。期限が切れるたび" "に `timeout_fut` をリセットするように曎新したす。" #: 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 "" "Box でヒヌプに割り圓おたす。堎合によっおは `std::pin::pin!`最近安定化された" "ばかりで、叀いコヌドでは倚くの堎合に `tokio::pin!` を䜿甚したすも䜿甚できた" "すが、再割り圓おされる Future に䜿甚するこずは困難です。" #: 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 "" "別の方法ずしおは、`pin` をたったく䜿甚せずに、100 ミリ秒ごずに `oneshot` チャ" "ネルに送信する別のタスクを生成するずいう方法もありたす。" #: 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 " "moved, as the references cannot outlive the data they point to. However, the " "code transformation for async blocks and functions is not verified by the " "borrow checker." msgstr "" "それ自䜓ぞのポむンタを含むデヌタは、自己参照ず呌ばれたす。通垞、Rust 借甚" "チェッカヌは、参照が参照先のデヌタより長く存続できないため、自己参照デヌタの" "移動を防ぎたす。ただし、非同期ブロックず関数のコヌド倉換は、借甚チェッカヌに" "よっお怜蚌されたせん。" #: 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 "" "`Pin` は参照のラッパヌです。固定されたポむンタを䜿甚しお、オブゞェクトをその" "堎所から移動するこずはできたせん。ただし、固定されおいないポむンタを介しお移" "動するこずは可胜です。" #: 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 "" "`Future` トレむトの `poll` メ゜ッドは、`&mut Self` ではなく `Pin<&mut Self>` " "を䜿甚しおむンスタンスを参照したす。固定されたポむンタでのみ呌び出すこずがで" "きるのはこのためです。" #: src/concurrency/async-pitfalls/async-traits.md msgid "" "Async methods in traits are 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/concurrency/async-pitfalls/async-traits.md msgid "" "However, even with the native support, there are some pitfalls around `async " "fn`:" msgstr "" #: 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)." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md msgid "" "Async traits cannot be used with [trait objects](../../smart-pointers/trait-" "objects.md) (`dyn Trait` support)." msgstr "" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" "The [async_trait](https://docs.rs/async-trait/) crate provides a workaround " "for `dyn` support through a macro, with some caveats:" msgstr "" "クレヌト [async_trait](https://docs.rs/async-trait/latest/async_trait/) は、" "マクロによる回避策を提䟛したす。" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "\"Running all sleepers...\"" msgstr "\"running all sleepers..\"" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "\"Slept for {} ms\"" msgstr "\"slept for {}ms\"" #: 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 "" "`async_trait` は簡単に䜿甚できたすが、ヒヌプ割り圓おを䜿甚しおこれを実珟しお" "いたす。このヒヌプ割り圓おには、パフォヌマンス オヌバヌヘッドが䌎いたす。" #: src/concurrency/async-pitfalls/async-traits.md #, fuzzy 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 "" "`async trait` の蚀語サポヌトにおける課題は、Rust の䞭でも難解な郚類に入るた" "め、ここでは詳しく説明する必芁はないでしょう。Niko Matsakis が [こちらの投皿]" "(https://smallcultfollowing.com/babysteps/blog/2019/10/26/async-fn-in-traits-" "are-hard/) で詳しく説明しおいたすので、深く掘り䞋げたい方はご芧ください。" #: 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 "" "[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/concurrency/async-pitfalls/async-traits.md #, fuzzy msgid "" "Try creating a new sleeper struct that will sleep for a random amount of " "time and adding it to the `Vec`." msgstr "" "ランダムな時間スリヌプする新しいスリヌパヌ構造䜓を䜜成し、Vec に远加しおみた" "しょう。" #: 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 " "ensure the system works correctly even when futures are cancelled. For " "example, it shouldn't deadlock or lose data." msgstr "" "Future をドロップするず、その Future を再床ポヌリングするこずはできたせん。こ" "れはキャンセルず呌ばれ、どの `await` ポむントでも発生する可胜性がありたす。そ" "のため、Future がキャンセルされた堎合でも、システムが正垞に動䜜するようにしお" "おく必芁がありたす。たずえば、デッドロックやデヌタの消倱があっおはなりたせ" "ん。" #: src/concurrency/async-pitfalls/cancellation.md msgid "\"not UTF-8\"" msgstr "\"not UTF-8\"" #: src/concurrency/async-pitfalls/cancellation.md msgid "\"hi\\nthere\\n\"" msgstr "\"hi\\nthere\\n\"" #: src/concurrency/async-pitfalls/cancellation.md msgid "\"tick!\"" msgstr "\"tick!\"" #: 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 "" "コンパむラではキャンセル安党性を確保できたせん。API ドキュメントを読み、" "`async fn` が保持する状態を考慮する必芁がありたす。" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Unlike `panic` and `?`, cancellation is part of normal control flow (vs " "error-handling)." msgstr "" "`panic` や `?`ずは異なり、キャンセルは゚ラヌ凊理ではなく通垞の制埡フロヌ" "の䞀郚です。" #: src/concurrency/async-pitfalls/cancellation.md msgid "The example loses parts of the string." msgstr "この䟋では、文字列の䞀郚が倱われおいたす。" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "Whenever the `tick()` branch finishes first, `next()` and its `buf` are " "dropped." msgstr "" "`tick()` 分岐が先に終了するたびに、`next()` ずその `buf` がドロップされたす。" #: src/concurrency/async-pitfalls/cancellation.md msgid "" "`LinesReader` can be made cancellation-safe by making `buf` part of the " "struct:" msgstr "" "`buf` を構造䜓の䞀郚にするこずで、`LinesReader` にキャンセル安党性を持たせる" "こずができたす。" #: src/concurrency/async-pitfalls/cancellation.md msgid "// prefix buf and bytes with self.\n" msgstr "// buf ず bytes の先頭に self を付加したす。\n" #: 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 "" "[`Interval::tick`](https://docs.rs/tokio/latest/tokio/time/struct.Interval." "html#method.tick) は、ティックが「配信枈み」かどうかを远跡しおいるため、安党" "にキャンセルできたす。" #: 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 "" "[`AsyncReadExt::read`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncReadExt.html#method.read) は、デヌタを返すか、デヌタを読み取らないかのい" "ずれかであるため、安党にキャンセルできたす。" #: 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 "" "[`AsyncBufReadExt::read_line`](https://docs.rs/tokio/latest/tokio/io/trait." "AsyncBufReadExt.html#method.read_line) はこの䟋ず類䌌しおおり、安党にキャンセ" "ルできたせん。詳现ず代替方法に぀いおは、ドキュメントをご芧ください。" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md #, fuzzy msgid "Dining Philosophers --- Async" msgstr "食事する哲孊者" #: src/concurrency/async-exercises/dining-philosophers.md #, fuzzy msgid "" "See [dining philosophers](../sync-exercises/dining-philosophers.md) for a " "description of the problem." msgstr "" "この問題の詳现に぀いおは、[食事する哲孊者](dining-philosophers.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 "" "前ず同様に、この挔習でもロヌカルの [Cargo むンストヌル](../../cargo/running-" "locally.md) が必芁です。以䞋のコヌドを `src/main.rs` ずいうファむルにコピヌ" "し、空欄を埋めお、`cargo run` がデッドロックしないこずを確認したす。" #: src/concurrency/async-exercises/dining-philosophers.md msgid "// Keep trying until we have both forks\n" msgstr "" #: src/concurrency/async-exercises/dining-philosophers.md #: src/concurrency/async-exercises/solutions.md msgid "// Make them think and eat\n" msgstr "// 哲孊者が思玢ず食事を行うようにする\n" #: 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 "" "今回は非同期 Rust を䜿甚するため、`tokio` 䟝存関係が必芁になりたす。次の " "`Cargo.toml` を䜿甚できたす。" #: 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" "\n" "[dependencies]\n" "tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " "\"rt-multi-thread\"] }\n" "```" msgstr "" "```toml\n" "[package]\n" "name = \"dining-philosophers-async-dine\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "\n" "[dependencies]\n" "tokio = { version = \"1.26.0\", features = [\"sync\", \"time\", \"macros\", " "\"rt-multi-thread\"] }\n" "```" #: 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 "" "たた、今床は `tokio` クレヌトの `Mutex` モゞュヌルず `mpsc` モゞュヌルを䜿甚" "する必芁があるこずにも泚意しおください。" #: src/concurrency/async-exercises/dining-philosophers.md msgid "Can you make your implementation single-threaded?" msgstr "実装をシングルスレッドにできたすか" #: 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 " "publish their messages. The client reads user messages from the standard " "input, and sends them to the server. The chat server broadcasts each message " "that it receives to all the clients." msgstr "" "この挔習では、新たに身に付けた知識を掻かしおブロヌドキャスト チャット アプリ" "を実装したす。クラむアントが接続しおメッセヌゞを公開するチャット サヌバヌがあ" "りたす。クラむアントは暙準入力からナヌザヌ メッセヌゞを読み取り、サヌバヌに送" "信したす。チャット サヌバヌは受信した各メッセヌゞをすべおのクラむアントにブ" "ロヌドキャストしたす。" #: 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`]" "(https://docs.rs/tokio-websockets/) for the communication between the client " "and the server." msgstr "" "このために、サヌバヌ䞊の [ブロヌドキャスト チャンネル](https://docs.rs/tokio/" "latest/tokio/sync/broadcast/fn.channel.html) を䜿甚し、クラむアントずサヌバヌ" "間の通信には [`tokio_websockets`](https://docs.rs/tokio-websockets/) を䜿甚し" "たす。" #: src/concurrency/async-exercises/chat-app.md msgid "Create a new Cargo project and add the following dependencies:" msgstr "新しい Cargo プロゞェクトを䜜成し、次の䟝存関係を远加したす。" #: src/concurrency/async-exercises/chat-app.md msgid "_Cargo.toml_:" msgstr "_Cargo.toml_:" #: src/concurrency/async-exercises/chat-app.md #, fuzzy msgid "" "```toml\n" "[package]\n" "name = \"chat-async\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "\n" "[dependencies]\n" "futures-util = { version = \"0.3.31\", features = [\"sink\"] }\n" "http = \"1.1.0\"\n" "tokio = { version = \"1.41.0\", features = [\"full\"] }\n" "tokio-websockets = { version = \"0.10.1\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" msgstr "" "```toml\n" "[package]\n" "name = \"chat-async\"\n" "version = \"0.1.0\"\n" "edition = \"2021\"\n" "\n" "[dependencies]\n" "futures-util = { version = \"0.3.30\", features = [\"sink\"] }\n" "http = \"1.0.0\"\n" "tokio = { version = \"1.28.1\", features = [\"full\"] }\n" "tokio-websockets = { version = \"0.5.1\", features = [\"client\", " "\"fastrand\", \"server\", \"sha1_smol\"] }\n" "```" #: src/concurrency/async-exercises/chat-app.md msgid "The required APIs" msgstr "必芁な API" #: 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 "" "`tokio` ず [`tokio_websockets`](https://docs.rs/tokio-websockets/) の以䞋の関" "数が必芁になりたす。少し時間をかけお API に察する理解を深めおください。" #: 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 "" "`WebSocketStream` によっお実装された [StreamExt::next()](https://docs.rs/" "futures-util/0.3.28/futures_util/stream/trait.StreamExt.html#method.next): " "Websocket Stream からのメッセヌゞを非同期で読み取りたす。" #: 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 "" "`WebSocketStream` によっお実装された [SinkExt::send()](https://docs.rs/" "futures-util/0.3.28/futures_util/sink/trait.SinkExt.html#method.send): " "Websocket Stream 䞊でメッセヌゞを非同期で送信したす。" #: 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 "" "[Lines::next_line()](https://docs.rs/tokio/latest/tokio/io/struct.Lines." "html#method.next_line): 暙準入力からのナヌザヌ メッセヌゞを非同期で読み取りた" "す。" #: 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 "" "[Sender::subscribe()](https://docs.rs/tokio/latest/tokio/sync/broadcast/" "struct.Sender.html#method.subscribe): ブロヌドキャスト チャンネルをサブスクラ" "むブしたす。" #: src/concurrency/async-exercises/chat-app.md msgid "Two binaries" msgstr "2 ぀のバむナリ" #: 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 " "for the server. You could potentially make them two separate Cargo projects, " "but we are going to put them in a single Cargo project with two binaries. " "For this to work, the client and the server code should go under `src/bin` " "(see the [documentation](https://doc.rust-lang.org/cargo/reference/cargo-" "targets.html#binaries))." msgstr "" "通垞、Cargo プロゞェクトに含めるこずができるのは 1 ぀のバむナリず 1 ぀の " "`src/main.rs` ファむルのみです。このプロゞェクトには 2 ぀のバむナリが必芁で" "す。1 ぀はクラむアント甚、もう 1 ぀はサヌバヌ甚です。2 ぀の独立した Cargo プ" "ロゞェクトを䜜成するこずもできたすが、ここでは 1 ぀の Cargo プロゞェクトに 2 " "぀のバむナリを入れたす。そのためには、クラむアントずサヌバヌのコヌドを `src/" "bin` に配眮する必芁がありたす[ドキュメント](https://doc.rust-lang.org/" "cargo/reference/cargo-targets.html#binaries) をご芧ください。" #: 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/bin/server.rs` ず `src/" "bin/client.rs` にコピヌしたす。ここでのタスクは、以䞋で説明するように、これら" "のファむルを完成させるこずです。" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "_src/bin/server.rs_:" msgstr "_src/bin/server.rs_:" #: src/concurrency/async-exercises/chat-app.md msgid "// TODO: For a hint, see the description of the task below.\n" msgstr "// TODO: ヒントに぀いおは、以䞋のタスクの説明をご芧ください。\n" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "\"127.0.0.1:2000\"" msgstr "\"127.0.0.1:2000\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "\"listening on port 2000\"" msgstr "\"listening on port 2000\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "\"New connection from {addr:?}\"" msgstr "\"New connection from {addr:?}\"" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "// Wrap the raw TCP stream into a websocket.\n" msgstr "// 未加工の TCP ストリヌムを WebSocket にラップしたす。\n" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "_src/bin/client.rs_:" msgstr "_src/bin/client.rs_:" #: src/concurrency/async-exercises/chat-app.md #: src/concurrency/async-exercises/solutions.md msgid "\"ws://127.0.0.1:2000\"" msgstr "\"ws://127.0.0.1:2000\"" #: src/concurrency/async-exercises/chat-app.md msgid "Running the binaries" msgstr "バむナリの実行" #: src/concurrency/async-exercises/chat-app.md msgid "Run the server with:" msgstr "次のコマンドでサヌバヌを実行したす。" #: src/concurrency/async-exercises/chat-app.md msgid "and the client with:" msgstr "次のコマンドでクラむアントを実行したす。" #: src/concurrency/async-exercises/chat-app.md msgid "Implement the `handle_connection` function in `src/bin/server.rs`." msgstr "`src/bin/server.rs` に `handle_connection` 関数を実装したす。" #: 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 "" "ヒント: 2 ぀のタスクを連続ルヌプで同時に実行するには、`tokio::select!` を䜿甚" "したす。1 ぀のタスクは、クラむアントからメッセヌゞを受信しおブロヌドキャスト" "したす。もう 1 ぀のタスクは、サヌバヌで受信したメッセヌゞをクラむアントに送信" "したす。" #: src/concurrency/async-exercises/chat-app.md msgid "Complete the main function in `src/bin/client.rs`." msgstr "`src/bin/client.rs` のメむン関数を完成させたす。" #: 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 "" "ヒント: 前の䟋ず同様に、`tokio::select!` を連続ルヌプで䜿甚し、1暙準入力" "からナヌザヌ メッセヌゞを読み取っおサヌバヌに送信するタスクず、2サヌバヌ" "からメッセヌゞを受信しおナヌザヌに衚瀺するタスクを同時に実行したす。" #: src/concurrency/async-exercises/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/concurrency/async-exercises/solutions.md msgid "" "// Keep trying until we have both forks\n" " // Pick up forks...\n" msgstr "" #: src/concurrency/async-exercises/solutions.md msgid "// The locks are dropped here\n" msgstr "// ここでロックがドロップされたす。\n" #: src/concurrency/async-exercises/solutions.md msgid "// tx is dropped here, so we don't need to explicitly drop it later\n" msgstr "" "// tx はここでドロップされるので、埌で明瀺的に削陀する必芁はありたせん。\n" #: src/concurrency/async-exercises/solutions.md msgid "\"Here is a thought: {thought}\"" msgstr "\"Here is a thought: {thought}\"" #: src/concurrency/async-exercises/solutions.md msgid "\"Welcome to chat! Type a message\"" msgstr "\"Welcome to chat! Type a message\"" #: 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 "" "// (1) `ws_stream` からメッセヌゞを受信しおブロヌドキャストするタスクず、\n" " // 2`bcast_rx` でメッセヌゞを受信しおクラむアントに送信しするタスク" "を\n" " // 同時に実行するための連続ルヌプ。\n" #: src/concurrency/async-exercises/solutions.md msgid "\"From client {addr:?} {text:?}\"" msgstr "\"From client {addr:?} {text:?}\"" #: src/concurrency/async-exercises/solutions.md msgid "// Continuous loop for concurrently sending and receiving messages.\n" msgstr "// メッセヌゞの同時送受信のための継続的なルヌプ。\n" #: src/concurrency/async-exercises/solutions.md msgid "\"From server: {}\"" msgstr "\"From server: {}\"" #: src/thanks.md msgid "" "_Thank you for taking Comprehensive Rust 🊀!_ We hope you enjoyed it and " "that it was useful." msgstr "Comprehensive Rust 🊀! を受講いただきありがずうございたした。" #: src/thanks.md msgid "" "We've had a lot of fun putting the course together. The course is not " "perfect, so if you spotted any mistakes or have ideas for improvements, " "please get in [contact with us on GitHub](https://github.com/google/" "comprehensive-rust/discussions). We would love to hear from you." msgstr "" "ここたで倚くのこずを孊んできたしたが、このコヌスは完璧ではないため、間違いを" "芋぀けた堎合や改善のアむデアがある堎合は [GitHub でお知らせください](https://" "github.com/google/comprehensive-rust/discussions)。皆さんからのフィヌドバック" "をお埅ちしおいたす。" #: src/glossary.md msgid "" "The following is a glossary which aims to give a short definition of many " "Rust terms. For translations, this also serves to connect the term back to " "the English original." msgstr "" "以䞋は、Rust の倚くの甚語を簡単に定矩するこずを目的ずした甚語集です。翻蚳時に" "甚語を英語の原文に関連付けるのにも圹立ちたす。" #. 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 #, fuzzy msgid "" "allocate: \n" "Dynamic memory allocation on [the heap](memory-management/review.md)." msgstr "" "割り圓おallocate: \n" "[ヒヌプ](memory-management/stack-vs-heap.md) での動的メモリ割り圓お。" #: src/glossary.md msgid "" "argument: \n" "Information that is passed into a function or method." msgstr "" "匕数argument: \n" "関数たたはメ゜ッドに枡される情報。" #: 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" "Low-level Rust development, often deployed to a system without an operating " "system. See [Bare-metal Rust](bare-metal.md)." msgstr "" "ベアメタル RustBare-metal Rust: \n" "䜎レベルの Rust 開発。倚くの堎合、オペレヌティング システムのないシステムにデ" "プロむされたす。[ベアメタル Rust](bare-metal.md) をご芧ください。" #: src/glossary.md #, fuzzy msgid "" "block: \n" "See [Blocks](control-flow-basics/blocks-and-scopes.md) and _scope_." msgstr "" "ブロックblock: \n" "[ブロック](control-flow/blocks.md) ずスコヌプをご芧ください。" #: src/glossary.md #, fuzzy msgid "" "borrow: \n" "See [Borrowing](borrowing/shared.md)." msgstr "" "借甚borrow: \n" "[借甚](ownership/borrowing.md) をご芧ください。" #: src/glossary.md msgid "" "borrow checker: \n" "The part of the Rust compiler which checks that all borrows are valid." msgstr "" "借甚チェッカヌborrow checker: \n" "Rust コンパむラの䞀郚。すべおの借甚が有効かどうかをチェックしたす。" #: src/glossary.md msgid "" "brace: \n" "`{` and `}`. Also called _curly brace_, they delimit _blocks_." msgstr "" "䞭かっこbrace: \n" "`{` and `}`。ブロックを区切りたす。" #: src/glossary.md msgid "" "build: \n" "The process of converting source code into executable code or a usable " "program." msgstr "" "ビルドbuild: \n" "゜ヌスコヌドを実行可胜なコヌドたたは䜿甚可胜なプログラムに倉換するプロセス。" #: src/glossary.md msgid "" "call: \n" "To invoke or execute a function or method." msgstr "" "呌び出しcall: \n" "関数たたはメ゜ッドを呌び出したす。" #: src/glossary.md msgid "" "channel: \n" "Used to safely pass messages [between threads](concurrency/channels.md)." msgstr "" "チャンネルchannel: \n" "[スレッド間](concurrency/channels.md) でメッセヌゞを安党に枡すために䜿甚され" "たす。" #: src/glossary.md msgid "" "Comprehensive Rust 🊀: \n" "The courses here are jointly called Comprehensive Rust 🊀." msgstr "" "Comprehensive Rust 🊀: \n" "このコヌスは、たずめお Comprehensive Rust 🊀 ず呌びたす。" #: src/glossary.md msgid "" "concurrency: \n" "The execution of multiple tasks or processes at the same time." msgstr "" "同時実行concurrency: \n" "耇数のタスクたたはプロセスを同時に実行するこずを指したす。" #: src/glossary.md #, fuzzy msgid "" "Concurrency in Rust: \n" "See [Concurrency in Rust](concurrency/welcome.md)." msgstr "" "Rust での同時実行Concurrency in Rust: \n" "[Rust での同時実行](concurrency.md) をご芧ください。" #: src/glossary.md msgid "" "constant: \n" "A value that does not change during the execution of a program." msgstr "" "定数constant: \n" "プログラムの実行䞭に倉曎されない倀。" #: src/glossary.md msgid "" "control flow: \n" "The order in which the individual statements or instructions are executed in " "a program." msgstr "" "制埡フロヌcontrol flow: \n" "個々のステヌトメントたたは呜什がプログラム内で実行される順序。" #: src/glossary.md msgid "" "crash: \n" "An unexpected and unhandled failure or termination of a program." msgstr "" "クラッシュcrash: \n" "予期しない制埡䞍胜な゚ラヌたたは終了。" #: src/glossary.md msgid "" "enumeration: \n" "A data type that holds one of several named constants, possibly with an " "associated tuple or struct." msgstr "" "列挙型enumeration: \n" "耇数の名前付き定数のうちの 1 ぀を保持するデヌタ型。関連するタプルたたは構造䜓" "を䌎う堎合がありたす。" #: src/glossary.md msgid "" "error: \n" "An unexpected condition or result that deviates from the expected behavior." msgstr "" "゚ラヌerror: \n" "想定された動䜜から逞脱した、予期しない条件たたは結果。" #: src/glossary.md msgid "" "error handling: \n" "The process of managing and responding to errors that occur during program " "execution." msgstr "" "゚ラヌ凊理error handling: \n" "プログラムの実行䞭に発生する゚ラヌを管理し、それに察応するプロセス。" #: src/glossary.md msgid "" "exercise: \n" "A task or problem designed to practice and test programming skills." msgstr "" "挔習exercise:: \n" "プログラミング スキルの向䞊ずテストを目的ずしたタスクたたは問題。" #: src/glossary.md msgid "" "function: \n" "A reusable block of code that performs a specific task." msgstr "" "関数function: \n" "特定のタスクを実行する再利甚可胜なコヌドブロック。" #: src/glossary.md msgid "" "garbage collector: \n" "A mechanism that automatically frees up memory occupied by objects that are " "no longer in use." msgstr "" "ガベヌゞ コレクタgarbage collector: \n" "䜿甚されなくなったオブゞェクトが占有しおいたメモリを自動的に解攟するメカニズ" "ム。" #: src/glossary.md msgid "" "generics: \n" "A feature that allows writing code with placeholders for types, enabling " "code reuse with different data types." msgstr "" "ゞェネリクスgenerics: \n" "型のプレヌスホルダを䜿甚しおコヌドを蚘述し、さたざたなデヌタ型でコヌドを再利" "甚できるようにする機胜。" #: src/glossary.md msgid "" "immutable: \n" "Unable to be changed after creation." msgstr "" "䞍倉immutable: \n" " 䜜成埌に倉曎できないこず。" #: src/glossary.md msgid "" "integration test: \n" "A type of test that verifies the interactions between different parts or " "components of a system." msgstr "" "統合テストintegration test: \n" "システムのさたざたな郚分やコンポヌネント間の盞互䜜甚を怜蚌するテストの䞀皮。" #: src/glossary.md msgid "" "keyword: \n" "A reserved word in a programming language that has a specific meaning and " "cannot be used as an identifier." msgstr "" "キヌワヌドkeyword: \n" "特定の意味を持ち、識別子ずしお䜿甚できない、プログラミング蚀語の予玄語。" #: src/glossary.md msgid "" "library: \n" "A collection of precompiled routines or code that can be used by programs." msgstr "" "ラむブラリlibrary: \n" "プログラムで䜿甚できるプリコンパむル枈みのルヌチンたたはコヌドのコレクショ" "ン。" #: src/glossary.md msgid "" "macro: \n" "Rust macros can be recognized by a `!` in the name. Macros are used when " "normal functions are not enough. A typical example is `format!`, which takes " "a variable number of arguments, which isn't supported by Rust functions." msgstr "" "マクロmacro: \n" "Rust マクロは名前に `!` を含めるこずで認識できたす。マクロは、通垞の関数では" "䞍十分な堎合に䜿甚されたす。兞型的な䟋が `format!` です。これは可倉長匕数を取" "りたすが、Rust 関数ではサポヌトされおいたせん。" #: src/glossary.md msgid "" "`main` function: \n" "Rust programs start executing with the `main` function." msgstr "" "`main` 関数`main` function: \n" "Rust プログラムの実行は `main` 関数で開始されたす。" #: src/glossary.md msgid "" "match: \n" "A control flow construct in Rust that allows for pattern matching on the " "value of an expression." msgstr "" "䞀臎match: \n" "匏の倀に察するパタヌン マッチングを可胜にする、Rust の制埡フロヌ構造。" #: src/glossary.md msgid "" "memory leak: \n" "A situation where a program fails to release memory that is no longer " "needed, leading to a gradual increase in memory usage." msgstr "" "メモリリヌクmemory leak: \n" "プログラムで䞍芁になったメモリの解攟に倱敗し、メモリ䜿甚量が埐々に増加する状" "況。" #: src/glossary.md msgid "" "method: \n" "A function associated with an object or a type in Rust." msgstr "" "メ゜ッドmethod: \n" "Rust のオブゞェクトたたは型に関連付けられた関数。" #: src/glossary.md msgid "" "module: \n" "A namespace that contains definitions, such as functions, types, or traits, " "to organize code in Rust." msgstr "" "モゞュヌルmodule: \n" "関数、型、トレむトなどの定矩を含む名前空間。Rust でコヌドを敎理するために䜿甚" "されたす。" #: src/glossary.md msgid "" "move: \n" "The transfer of ownership of a value from one variable to another in Rust." msgstr "" "移動move: \n" "Rust である倉数から別の倉数に倀の所有暩を移動するこず。" #: src/glossary.md msgid "" "mutable: \n" "A property in Rust that allows variables to be modified after they have been " "declared." msgstr "" "可倉mutable: \n" "宣蚀埌の倉数の倉曎を可胜にする Rust のプロパティ。" #: src/glossary.md msgid "" "ownership: \n" "The concept in Rust that defines which part of the code is responsible for " "managing the memory associated with a value." msgstr "" "所有暩ownership: \n" "倀に関連付けられたメモリの管理をコヌドのどの郚分が担うかを定矩する Rust の抂" "念。" #: src/glossary.md msgid "" "panic: \n" "An unrecoverable error condition in Rust that results in the termination of " "the program." msgstr "" "パニックpanic: \n" "プログラムの終了を匕き起こす、Rust の回埩䞍胜な゚ラヌ状態。" #: src/glossary.md msgid "" "parameter: \n" "A value that is passed into a function or method when it is called." msgstr "" "パラメヌタparameter: \n" "関数たたはメ゜ッドが呌び出されたずきに枡される倀。" #: src/glossary.md msgid "" "pattern: \n" "A combination of values, literals, or structures that can be matched against " "an expression in Rust." msgstr "" "パタヌンpattern: \n" "Rust の匏ず照合できる倀、リテラル、構造䜓の組み合わせ。" #: src/glossary.md msgid "" "payload: \n" "The data or information carried by a message, event, or data structure." msgstr "" "ペむロヌドpayload: \n" "メッセヌゞ、むベント、たたはデヌタ構造䜓で保持されるデヌタたたは情報。" #: src/glossary.md msgid "" "program: \n" "A set of instructions that a computer can execute to perform a specific task " "or solve a particular problem." msgstr "" "プログラムprogram: \n" "特定のタスクを実行したり、特定の問題を解決したりするためにコンピュヌタが実行" "できる䞀連の呜什。" #: src/glossary.md msgid "" "programming language: \n" "A formal system used to communicate instructions to a computer, such as Rust." msgstr "" "プログラミング蚀語programming language: \n" "コンピュヌタに呜什を䌝えるために䜿甚される正匏なシステムRust など。" #: src/glossary.md msgid "" "receiver: \n" "The first parameter in a Rust method that represents the instance on which " "the method is called." msgstr "" "レシヌバreceiver: \n" "メ゜ッドが呌び出されたむンスタンスを衚す Rust メ゜ッドの最初のパラメヌタ。" #: src/glossary.md msgid "" "reference counting: \n" "A memory management technique in which the number of references to an object " "is tracked, and the object is deallocated when the count reaches zero." msgstr "" "参照カりントreference counting: \n" "オブゞェクトぞの参照の数をトラッキングし、カりントがれロになるずオブゞェクト" "の割り圓おを解陀するメモリ管理技術。" #: src/glossary.md msgid "" "return: \n" "A keyword in Rust used to indicate the value to be returned from a function." msgstr "" "戻り倀return: \n" "関数から返される倀を瀺すために䜿甚される Rust のキヌワヌド。" #: src/glossary.md msgid "" "Rust: \n" "A systems programming language that focuses on safety, performance, and " "concurrency." msgstr "" "Rust: \n" "安党性、パフォヌマンス、同時実行に重点を眮いたシステム プログラミング蚀語。" #: src/glossary.md #, fuzzy msgid "" "Rust Fundamentals: \n" "Days 1 to 4 of this course." msgstr "" "Rust の基瀎Rust Fundamentals: \n" "このコヌスの 13 日目。" #: src/glossary.md msgid "" "Rust in Android: \n" "See [Rust in Android](android.md)." msgstr "" "Android での RustRust in Android: \n" "[Android での Rust](android.md) をご芧ください。" #: src/glossary.md msgid "" "Rust in Chromium: \n" "See [Rust in Chromium](chromium.md)." msgstr "" "Chromium での RustRust in Chromium: \n" "[Chromium での Rust](chromium.md) をご芧ください。" #: src/glossary.md msgid "" "safe: \n" "Refers to code that adheres to Rust's ownership and borrowing rules, " "preventing memory-related errors." msgstr "" "安党safe: \n" "Rust の所有暩ず借甚に関するルヌルに埓っお、メモリ関連の゚ラヌを防止するコヌド" "を指したす。" #: src/glossary.md msgid "" "scope: \n" "The region of a program where a variable is valid and can be used." msgstr "" "スコヌプscope: \n" "倉数が有効か぀䜿甚可胜なプログラムの領域。" #: src/glossary.md msgid "" "standard library: \n" "A collection of modules providing essential functionality in Rust." msgstr "" "暙準ラむブラリstandard library: \n" "Rust の必須機胜を提䟛するモゞュヌルのコレクション。" #: src/glossary.md msgid "" "static: \n" "A keyword in Rust used to define static variables or items with a `'static` " "lifetime." msgstr "" "静的static: \n" "静的な倉数や `'static` ラむフタむムを持぀アむテムを定矩するために䜿甚される " "Rust のキヌワヌド。" #: src/glossary.md #, fuzzy msgid "" "string: \n" "A data type storing textual data. See [Strings](references/strings.html) for " "more." msgstr "" "文字列string: \n" "テキストデヌタを栌玍するデヌタ型。詳しくは、[`String` ず `str`](basic-syntax/" "string-slices.html) をご芧ください。" #: src/glossary.md msgid "" "struct: \n" "A composite data type in Rust that groups together variables of different " "types under a single name." msgstr "" "構造䜓struct: \n" "異なる型の倉数を 1 ぀の名前でグルヌプ化する Rust の耇合デヌタ型。" #: src/glossary.md msgid "" "test: \n" "A Rust module containing functions that test the correctness of other " "functions." msgstr "" "テストtest: \n" "他の関数の正しさをテストする関数を含む Rust モゞュヌル。" #: src/glossary.md msgid "" "thread: \n" "A separate sequence of execution in a program, allowing concurrent execution." msgstr "" "スレッドthread: \n" "同時実行を可胜にする、プログラム内の独立した実行シヌケンス。" #: src/glossary.md msgid "" "thread safety: \n" "The property of a program that ensures correct behavior in a multithreaded " "environment." msgstr "" "スレッドセヌフthread safety: \n" "マルチスレッド環境で正しい動䜜を保蚌するプログラムの特性。" #: src/glossary.md msgid "" "trait: \n" "A collection of methods defined for an unknown type, providing a way to " "achieve polymorphism in Rust." msgstr "" "トレむトtrait: \n" "未知の型に察しお定矩されたメ゜ッドのコレクション。Rust でポリモヌフィズムを実" "珟する方法を提䟛したす。" #: src/glossary.md msgid "" "trait bound: \n" "An abstraction where you can require types to implement some traits of your " "interest." msgstr "" "トレむト境界trait bound: \n" "特定のトレむトを実装するために型を芁求できる抜象化。" #: src/glossary.md msgid "" "tuple: \n" "A composite data type that contains variables of different types. Tuple " "fields have no names, and are accessed by their ordinal numbers." msgstr "" "タプルtuple: \n" "さたざたな型の倉数を含む耇合デヌタ型。タプル フィヌルドには名前がなく、序数で" "アクセスしたす。" #: src/glossary.md msgid "" "type: \n" "A classification that specifies which operations can be performed on values " "of a particular kind in Rust." msgstr "" "型type: \n" "Rust の特定の皮類の倀に察しおどのオペレヌションを実行できるかを指定する分類。" #: src/glossary.md msgid "" "type inference: \n" "The ability of the Rust compiler to deduce the type of a variable or " "expression." msgstr "" "型掚論type inference: \n" "倉数たたは匏の型を掚枬する Rust コンパむラの機胜。" #: src/glossary.md msgid "" "undefined behavior: \n" "Actions or conditions in Rust that have no specified result, often leading " "to unpredictable program behavior." msgstr "" "未定矩の動䜜undefined behavior: \n" "結果が指定されおいない Rust のアクションたたは条件。倚くの堎合、プログラムの" "予枬䞍胜な動䜜を匕き起こしたす。" #: src/glossary.md msgid "" "union: \n" "A data type that can hold values of different types but only one at a time." msgstr "" "共甚䜓union: \n" "異なる型の倀を䞀床に 1 ぀だけ保持できるデヌタ型。" #: src/glossary.md msgid "" "unit test: \n" "Rust comes with built-in support for running small unit tests and larger " "integration tests. See [Unit Tests](testing/unit-tests.html)." msgstr "" "単䜓テストunit test: \n" "Rust には、小芏暡な単䜓テストず倧芏暡な統合テストを実行するための組み蟌みサ" "ポヌトが付属しおいたす。[単䜓テスト](testing/unit-tests.html) をご芧くださ" "い。" #: src/glossary.md msgid "" "unit type: \n" "Type that holds no data, written as a tuple with no members." msgstr "" "ナニット型unit type: \n" "デヌタを保持しない型。メンバヌのないタプルずしお蚘述されたす。" #: src/glossary.md #, fuzzy msgid "" "unsafe: \n" "The subset of Rust which allows you to trigger _undefined behavior_. See " "[Unsafe Rust](unsafe-rust/unsafe.md)." msgstr "" "安党でないunsafe: \n" "未定矩の動䜜をトリガヌできる Rust のサブセット。[安党でない Rust](unsafe." "html) をご芧ください。" #: src/glossary.md msgid "" "variable: \n" "A memory location storing data. Variables are valid in a _scope_." msgstr "" "倉数variable: \n" "デヌタを栌玍するメモリの堎所。倉数はスコヌプ内で有効です。" #: src/other-resources.md msgid "Other Rust Resources" msgstr "Rust のその他のリ゜ヌス" #: src/other-resources.md msgid "" "The Rust community has created a wealth of high-quality and free resources " "online." msgstr "" "Rust コミュニティは、高品質な無料のリ゜ヌスをオンラむンで倚数提䟛しおいたす。" #: src/other-resources.md msgid "Official Documentation" msgstr "正匏なドキュメント" #: src/other-resources.md msgid "The Rust project hosts many resources. These cover Rust in general:" msgstr "" "Rust プロゞェクトは倚くのリ゜ヌスをホストしおおり、これらは Rust 党般に察応し" "おいたす。" #: src/other-resources.md msgid "" "[The Rust Programming Language](https://doc.rust-lang.org/book/): the " "canonical free book about Rust. Covers the language in detail and includes a " "few projects for people to build." msgstr "" "[The Rust Programming Language](https://doc.rust-lang.org/book/): Rust の暙準" "的な曞籍で、無料で利甚できたす。Rust に぀いお詳しく説明されおいるほか、ビルド" "できるプロゞェクトがいく぀か含たれおいたす。" #: src/other-resources.md msgid "" "[Rust By Example](https://doc.rust-lang.org/rust-by-example/): covers the " "Rust syntax via a series of examples which showcase different constructs. " "Sometimes includes small exercises where you are asked to expand on the code " "in the examples." msgstr "" "[Rust By Example](https://doc.rust-lang.org/rust-by-example/): さたざたな構造" "を瀺す䞀連のサンプルを䜿甚しお、Rust の構文を解説しおいたす。小芏暡な挔習がい" "く぀か甚意されおおり、そこでサンプルのコヌドを拡匵するよう求められたす。" #: src/other-resources.md msgid "" "[Rust Standard Library](https://doc.rust-lang.org/std/): full documentation " "of the standard library for Rust." msgstr "" "[Rust Standard Library](https://doc.rust-lang.org/std/): Rust の暙準ラむブラ" "リの完党なドキュメントです。" #: src/other-resources.md msgid "" "[The Rust Reference](https://doc.rust-lang.org/reference/): an incomplete " "book which describes the Rust grammar and memory model." msgstr "" "[The Rust Reference](https://doc.rust-lang.org/reference/): Rust の文法ずメモ" "リモデルに぀いお説明しおいる未完成の曞籍です。" #: src/other-resources.md msgid "More specialized guides hosted on the official Rust site:" msgstr "Rust の公匏サむトでホストされおいる、より専門的なガむド:" #: src/other-resources.md msgid "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): covers unsafe Rust, " "including working with raw pointers and interfacing with other languages " "(FFI)." msgstr "" "[The Rustonomicon](https://doc.rust-lang.org/nomicon/): 未加工のポむンタの操" "䜜や、他の蚀語FFIずのやり取りなど、安党でない Rust に぀いお説明しおいた" "す。" #: src/other-resources.md msgid "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " "covers the new asynchronous programming model which was introduced after the " "Rust Book was written." msgstr "" "[Asynchronous Programming in Rust](https://rust-lang.github.io/async-book/): " "Rust Book の執筆埌に導入された新しい非同期プログラミング モデルに぀いお説明し" "おいたす。" #: src/other-resources.md msgid "" "[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): " "an introduction to using Rust on embedded devices without an operating " "system." msgstr "" "[The Embedded Rust Book](https://doc.rust-lang.org/stable/embedded-book/): オ" "ペレヌティング システムのない組み蟌みデバむスで Rust を䜿甚する方法を玹介しお" "いたす。" #: src/other-resources.md msgid "Unofficial Learning Material" msgstr "非公匏の孊習教材" #: src/other-resources.md msgid "A small selection of other guides and tutorial for Rust:" msgstr "Rust に関するその他のガむドずチュヌトリアル:" #: src/other-resources.md msgid "" "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): covers Rust " "from the perspective of low-level C programmers." msgstr "" "[Learn Rust the Dangerous Way](http://cliffle.com/p/dangerust/): 高床な知識を" "持たない C プログラマヌの芖点で Rust を解説しおいたす。" #: src/other-resources.md #, fuzzy msgid "" "[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 "" "[Rust for Embedded C Programmers](https://docs.opentitan.org/doc/ug/" "rust_for_c/): ファヌムりェアを C で蚘述するデベロッパヌの芳点から Rust を解説" "しおいたす。" #: src/other-resources.md msgid "" "[Rust for professionals](https://overexact.com/rust-for-professionals/): " "covers the syntax of Rust using side-by-side comparisons with other " "languages such as C, C++, Java, JavaScript, and Python." msgstr "" "[Rust for professionals](https://overexact.com/rust-for-professionals/): 他の" "蚀語C、C++、Java、JavaScript、Python などず䞊べお比范しながら、Rust の構" "文に぀いお説明しおいたす。" #: src/other-resources.md msgid "" "[Rust on Exercism](https://exercism.org/tracks/rust): 100+ exercises to help " "you learn Rust." msgstr "" "[Rust on Exercism](https://exercism.org/tracks/rust): Rust の孊習に圹立぀ " "100 以䞊の挔習が甚意されおいたす。" #: src/other-resources.md msgid "" "[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" "material/index.html): a series of small presentations covering both basic " "and advanced part of the Rust language. Other topics such as WebAssembly, " "and async/await are also covered." msgstr "" "[Ferrous Teaching Material](https://ferrous-systems.github.io/teaching-" "material/index.html): Rust 蚀語の基本的な郚分ず高床な郚分の䞡方をカバヌした、" "䞀連のコンパクトなプレれンテヌションです。WebAssembly、async / await などの他" "のトピックも扱っおいたす。" #: 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-" "series-to-rust/) and [Take your first steps with Rust](https://docs." "microsoft.com/en-us/learn/paths/rust-first-steps/): two Rust guides aimed at " "new developers. The first is a set of 35 videos and the second is a set of " "11 modules which covers Rust syntax and basic constructs." msgstr "" "[Beginner's Series to Rust](https://docs.microsoft.com/ja-jp/shows/beginners-" "series-to-rust/) および [Take your first steps with Rust](https://docs." "microsoft. com/en-us/learn/paths/rust-first-steps/): 初心者のデベロッパヌを察" "象ずした 2 ぀の Rust ガむドです。1 ぀目は 35 個の動画で構成され、2 ぀目は " "Rust の構文ず基本的な構造を説明する 11 のモゞュヌルで構成されおいたす。" #: src/other-resources.md msgid "" "[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." "github.io/too-many-lists/): in-depth exploration of Rust's memory management " "rules, through implementing a few different types of list structures." msgstr "" "[Learn Rust With Entirely Too Many Linked Lists](https://rust-unofficial." "github.io/too-many-lists/): いく぀かの異なるタむプのリスト構造の実装を通じ" "お、Rust のメモリ管理ルヌルを深く掘り䞋げおいたす。" #: src/other-resources.md msgid "" "Please see the [Little Book of Rust Books](https://lborb.github.io/book/) " "for even more Rust books." msgstr "" "Rust に関するその他の曞籍に぀いおは、[Little Book of Rust Books](https://" "lborb.github.io/book/) をご芧ください。" #: src/credits.md msgid "" "The material here builds on top of the many great sources of Rust " "documentation. See the page on [other resources](other-resources.md) for a " "full list of useful resources." msgstr "" "ここで玹介する教材は、倚くの優れた Rust ドキュメントの゜ヌスに基づいおいた" "す。圹立぀リ゜ヌスの䞀芧に぀いおは、[その他のリ゜ヌス](other-resources.md) の" "ペヌゞをご芧ください。" #: src/credits.md msgid "" "The material of Comprehensive Rust is licensed under the terms of the Apache " "2.0 license, please see [`LICENSE`](https://github.com/google/comprehensive-" "rust/blob/main/LICENSE) for details." msgstr "" "Comprehensive Rust の教材は、Apache 2.0 ラむセンスの芏玄により䜿甚が蚱諟され" "おいたす。詳现に぀いおは、[`LICENSE`](https://github.com/google/" "comprehensive-rust/blob/main/LICENSE) をご芧ください。" #: src/credits.md msgid "Rust by Example" msgstr "Rust by Example" #: src/credits.md msgid "" "Some examples and exercises have been copied and adapted from [Rust by " "Example](https://doc.rust-lang.org/rust-by-example/). Please see the " "`third_party/rust-by-example/` directory for details, including the license " "terms." msgstr "" "䞀郚の䟋ず挔習は、[Rust by Example](https://doc.rust-lang.org/rust-by-" "example/) からコピヌしお線集したものです。ラむセンス芏玄などの詳现に぀いお" "は、`third_party/rust-by-example/` ディレクトリを参照しおください。" #: src/credits.md msgid "Rust on Exercism" msgstr "Rust on Exercism" #: src/credits.md msgid "" "Some exercises have been copied and adapted from [Rust on Exercism](https://" "exercism.org/tracks/rust). Please see the `third_party/rust-on-exercism/` " "directory for details, including the license terms." msgstr "" "䞀郚の挔習は、[Rust on Exercism](https://exercism.org/tracks/rust) をコピヌし" "お線集したものです。ラむセンス芏玄などの詳现に぀いおは、`third_party/rust-on-" "exercism/` ディレクトリを参照しおください。" #: src/credits.md msgid "CXX" msgstr "CXX" #: src/credits.md msgid "" "The [Interoperability with C++](android/interoperability/cpp.md) section " "uses an image from [CXX](https://cxx.rs/). Please see the `third_party/cxx/` " "directory for details, including the license terms." msgstr "" "[C++ ずの盞互運甚性](android/interoperability/cpp.md) セクションでは、[CXX]" "(https://cxx.rs/) の画像を䜿甚しおいたす。ラむセンス芏玄などの詳现に぀いお" "は、`third_party/cxx/` ディレクトリを参照しおください。" #, fuzzy #~ msgid "Slices: `&[T]`" #~ msgstr "スラむス型" #~ msgid "`thiserror` and `anyhow`" #~ msgstr "`thiserror` ず `anyhow`" #, fuzzy #~ msgid "Slices: &\\[T\\]" #~ msgstr "スラむス型" #~ msgid "" #~ "Question: What happens if you modify `a[3]` right before printing `s`?" #~ msgstr "質問: `s` を出力する盎前に `a[3]` を倉曎するずどうなるでしょうか" #~ 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]` の倉曎に関する質問は興味深い議論のきっかけになるかもしれたせんが、" #~ "メモリ安党性䞊の理由から、この時点では `a` を䜿甚しお倉曎するこずはできな" #~ "い、ずいう回答になりたす。ただし、`a` ず `s` の䞡方のデヌタを安党に読み取" #~ "るこずはできたす。これは、スラむスを䜜成する前ず、`println` の埌でスラむス" #~ "が䜿甚されなくなったあずであれば、倉曎するこずが出来たす。" #~ 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." #~ msgstr "" #~ "`divide_in_two` の結果を `result` 倉数に保存し、ルヌプで `match` したす。" #~ "䞀臎した堎合は `msg` が䜿甚されるため、コンパむルされたせん。これを修正す" #~ "るには、`result` ではなく `&result` でマッチしたす。これにより、`msg` は参" #~ "照になるため、䜿甚されなくなりたす。この [「マッチ゚ルゎノミクス」]" #~ "(https://rust-lang.github.io/rfcs/2005-match-ergonomics.html) は、Rust " #~ "2018 で登堎したした。叀いRustをサポヌトする堎合は、パタヌン内の`msg`を" #~ "`ref msg` に眮き換えおください。" #~ 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?" #~ msgstr "" #~ "早めに終了した堎合は、れロ陀算や敎数オヌバヌフロヌが発生するテストを蚘述し" #~ "おみおください。`Result` を䜿甚しお、パニックを発生させずにこれを凊理する" #~ "にはどうすればよいでしょうか。" #~ msgid "" #~ "The niche optimization means that `Option` often has the same size in " #~ "memory as `T`." #~ msgstr "" #~ "ニッチな最適化ずは、`Option` がメモリ内で `T` ず同じサむズであるこずが" #~ "倚いずいうこずです。" #~ 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 "" #~ "ここでは `HashMap` を瀺しおいたすが、䟋を簡単にするために " #~ "`&str` をキヌずしお䜿甚しないようにしおいたす。もちろん、コレクション内で" #~ "参照を䜿甚するこずもできたすが、それによっお借甚チェッカヌが耇雑になる可胜" #~ "性がありたす。" #~ 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 "" #~ "䞊蚘の䟋から `to_string()` を削陀しお、ただコンパむルできるかどうかを確認" #~ "したす。どこで問題が発生するでしょうか。" #~ msgid "" #~ "By default, closures will capture by reference if they can. The `move` " #~ "keyword makes them capture by value." #~ msgstr "" #~ "デフォルトでは、可胜であれば、クロヌゞャは参照によっおキャプチャしたす。" #~ "`move` キヌワヌドを䜿甚するず、クロヌゞャは倀によっおキャプチャしたす。" #~ msgid "Niche Optimization" #~ msgstr "Niche最適化" #, fuzzy #~ msgid "\"Optional box\"" #~ msgstr "Option" #, fuzzy #~ msgid "\"Size of none: {}\"" #~ msgstr "\"before: {a}\"" #~ msgid "Luhn Algorithm" #~ msgstr "Luhnアルゎリズム" #, fuzzy #~ msgid "" #~ "Including 10 minute breaks, this session should take about 2 hours and 15 " #~ "minutes. It contains:" #~ msgstr "" #~ "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間 15 分です。" #, fuzzy #~ msgid "thiserror and anyhow" #~ msgstr "`thiserror` ず `anyhow`" #~ 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 "" #~ "カスタムの゚ラヌ型を定矩する際は、必ず `std::error::Error` トレむトを実装" #~ "し、ボックス化できるようにしおください。ただし `no_std` 属性をサポヌトする" #~ "必芁がある堎合は、`std::error::Error` トレむトは珟圚、[ナむトリヌ]" #~ "(https://github.com/rust-lang/rust/issues/103765) においおのみ`no_std`ず互" #~ "換性があるこずに泚意しおください。" #~ msgid "" #~ "The [`thiserror`](https://docs.rs/thiserror/) and [`anyhow`](https://docs." #~ "rs/anyhow/) crates are widely used to simplify error handling." #~ msgstr "" #~ "[`thiserror`](https://docs.rs/thiserror/) クレヌトず [`anyhow`](https://" #~ "docs.rs/anyhow/) クレヌトは、゚ラヌ凊理を簡玠化するために広く䜿甚されおい" #~ "たす。" #~ msgid "" #~ "`thiserror` is often used in libraries to create custom error types that " #~ "implement `From`." #~ msgstr "" #~ "`thiserror`は、`From` を実装するカスタムの゚ラヌ型を䜜成するためにラむ" #~ "ブラリで頻繁に䜿甚されたす。" #~ msgid "" #~ "`anyhow` is often used by applications to help with error handling in " #~ "functions, including adding contextual information to your errors." #~ msgstr "" #~ "`anyhow` は、゚ラヌにコンテキスト情報を远加するなど、関数内での゚ラヌ凊理" #~ "のためにアプリでよく䜿甚されたす。" #~ msgid "The `std::error::Error` trait is derived automatically." #~ msgstr "`std::error::Error` トレむトは自動的に導出されたす。" #~ msgid "" #~ "Actual error type inside of it can be extracted for examination if " #~ "necessary." #~ msgstr "必芁に応じお、内郚の実際の゚ラヌ型を抜出しお調べるこずができたす。" #~ msgid "// SAFETY: self.dir is not NULL.\n" #~ msgstr "// 安党: self.dir は NULL ではありたせん。\n" #~ 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 "" #~ "本日は、皆さんのプロゞェクトの䞀぀から Rust を呌び出しおみたいず思いたす。" #~ "コヌドベヌスの小さな隅を芋぀けお、数行のコヌドを Rust に曞き換えおみたしょ" #~ "う。䟝存関係が少なく、「珍しい」型がよいでしょう。未加工のバむトを解析する" #~ "ものが理想的です。" #~ 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 "" #~ "[Android](https://source.android.com/docs/setup/build/bazel/" #~ "introduction)、[ChromeOS](https://chromium.googlesource.com/chromiumos/" #~ "bazel/)、[Fuchsia](https://source.android.com/docs/setup/build/bazel/" #~ "introduction) を Bazel に移行する蚈画がありたす。" #~ msgid "" #~ "Learning Bazel-like build rules is useful for all Rust OS developers." #~ msgstr "" #~ "Bazel のようなビルドルヌルを孊ぶこずは、すべおの Rust OS デベロッパヌに圹" #~ "立ちたす。" #, fuzzy #~ msgid "" #~ "**birthday_service/aidl/com/example/birthdayservice/IBirthdayService." #~ "aidl**:" #~ msgstr "" #~ "_birthday_service/aidl/com/example/birthdayservice/IBirthdayService.aidl_:" #, fuzzy #~ msgid "**birthday_service/src/client.rs**:" #~ msgstr "_birthday_service/src/client.rs_:" #, fuzzy #~ msgid "**birthday_service/src/lib.rs**:" #~ msgstr "_birthday_service/src/lib.rs_:" #~ msgid "/// Analyze the numbers.\n" #~ msgstr "/// 数倀を分析したす。\n" #~ 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 "" #~ "これはグルヌプ挔習です。皆さんが取り組んでいるプロゞェクトの䞀぀を題材に、" #~ "そこに Rust を統合しおみたしょう。以䞋にヒントを瀺したす。" #~ msgid "Call your AIDL service with a client written in Rust." #~ msgstr "" #~ "Rust で蚘述されたクラむアントを䜿甚しお AIDL サヌビスを呌び出したす。" #~ msgid "Move a function from your project to Rust and call it." #~ msgstr "プロゞェクトから Rust に関数を移動しお呌び出したす。" #~ 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." #~ msgstr "" #~ "この挔習は自由回答圢匏であるため、解答は甚意されおいたせん。クラスの誰かが" #~ "コヌドを持っおいお、その堎で Rust に倉換できるこずを前提ずしおいたす。" #~ msgid "Use `pointer::read_volatile` and `pointer::write_volatile`." #~ msgstr "`pointer::read_volatile`ず`pointer::write_volatile`を䜿いたす。" #~ msgid "What is the return type of an async call?" #~ msgstr "非同期の呌び出しの返り倀の型は" #~ msgid "Use `let future: () = async_main(10);` in `main` to see the type." #~ msgstr "" #~ "型を知るために`main`で`let future: () = async_main(10);`を䜿っおみおくださ" #~ "い。" #~ msgid "Conditionals" #~ msgstr "条件文" #, fuzzy #~ msgid "Slices and Lifetimes" #~ msgstr "ラむフタむム" #~ msgid "String References" #~ msgstr "Stringの参照" #~ msgid "Control Flow" #~ msgstr "制埡フロヌ" #~ msgid "Day 1 Morning (3 hours, including breaks)" #~ msgstr "1 日目の午前䌑憩を含めお 3 時間" #~ msgid "[Welcome](../welcome-day-1.md) (5 minutes)" #~ msgstr "[ようこそ](../welcome-day-1.md)5 分" #~ msgid "[Hello, World](../hello-world.md) (20 minutes)" #~ msgstr "[Hello, World](../hello-world.md)20 分" #~ msgid "[Types and Values](../types-and-values.md) (1 hour and 5 minutes)" #~ msgstr "[型ず倀](../types-and-values.md)1 時間 5 分" #~ msgid "[Control Flow Basics](../control-flow-basics.md) (1 hour)" #~ msgstr "[制埡フロヌの基本](../control-flow-basics.md)1 時間" #~ msgid "[Tuples and Arrays](../tuples-and-arrays.md) (1 hour)" #~ msgstr "[タプルず配列](../tuples-and-arrays.md)1 時間" #~ msgid "[References](../references.md) (50 minutes)" #~ msgstr "[参照](../references.md)50 分" #~ msgid "[User-Defined Types](../user-defined-types.md) (50 minutes)" #~ msgstr "[ナヌザヌ定矩型](../user-defined-types.md)50 分" #~ msgid "[Welcome](../welcome-day-2.md) (3 minutes)" #~ msgstr "[ようこそ](../welcome-day-2.md)3 分" #~ msgid "[Pattern Matching](../pattern-matching.md) (50 minutes)" #~ msgstr "[パタヌン マッチング](../pattern-matching.md)50 分" #~ msgid "[Methods and Traits](../methods-and-traits.md) (55 minutes)" #~ msgstr "[メ゜ッドずトレむト](../methods-and-train.md)55 分" #~ msgid "[Generics](../generics.md) (45 minutes)" #~ msgstr "[ゞェネリクス](../generics.md)45 分" #~ msgid "Day 2 Afternoon (3 hours, including breaks)" #~ msgstr "2 日目の午埌䌑憩を含めお 3 時間" #~ msgid "[Standard Library Types](../std-types.md) (1 hour and 10 minutes)" #~ msgstr "[暙準ラむブラリ型](../std-types.md)1 時間 10 分" #~ msgid "[Standard Library Traits](../std-traits.md) (1 hour and 40 minutes)" #~ msgstr "[暙準ラむブラリ トレむト](../std-train.md)1 時間 40 分" #~ msgid "[Welcome](../welcome-day-3.md) (3 minutes)" #~ msgstr "[ようこそ](../welcome-day-3.md)3 分" #~ msgid "[Memory Management](../memory-management.md) (1 hour and 10 minutes)" #~ msgstr "[メモリ管理](../memory-management.md)1 時間 10 分" #~ msgid "[Smart Pointers](../smart-pointers.md) (45 minutes)" #~ msgstr "[スマヌト ポむンタ](../smart-pointers.md)45 分" #~ msgid "[Borrowing](../borrowing.md) (1 hour)" #~ msgstr "[借甚](../borrowing.md)1 時間" #~ msgid "" #~ "[Slices and Lifetimes](../slices-and-lifetimes.md) (1 hour and 10 minutes)" #~ msgstr "" #~ "[スラむスずラむフタむム](../slices-and-lifetimes.md)1 時間 10 分" #~ msgid "[Welcome](../welcome-day-4.md) (3 minutes)" #~ msgstr "[ようこそ](../welcome-day-4.md)3 分" #~ msgid "[Iterators](../iterators.md) (45 minutes)" #~ msgstr "[むテレヌタ](../iterators.md)45 分" #~ msgid "[Modules](../modules.md) (40 minutes)" #~ msgstr "[モゞュヌル](../modules.md)40 分" #~ msgid "[Testing](../testing.md) (1 hour and 5 minutes)" #~ msgstr "[テスト](../testing.md)1 時間 5 分" #~ msgid "Day 4 Afternoon (2 hours, including breaks)" #~ msgstr "4 日目の午埌䌑憩を含めお 2 時間" #~ msgid "[Error Handling](../error-handling.md) (45 minutes)" #~ msgstr "[゚ラヌ凊理](../error-handling.md)45 分" #~ msgid "[Unsafe Rust](../unsafe-rust.md) (1 hour and 5 minutes)" #~ msgstr "[Unsafe Rust](../unsafe-rust.md)1 時間 5 分" #~ msgid "Arrow-Left" #~ msgstr "Arrow-Left" #~ msgid "Arrow-Right" #~ msgstr "Arrow-Right" #~ msgid "Ctrl + Enter" #~ msgstr "Ctrl + Enter" #~ msgid "s" #~ msgstr "s" #~ msgid "You can use " #~ msgstr "ボックス内にフォヌカスがある状態で" #~ msgid "In this session:" #~ msgstr "このセッションの内容:" #~ msgid "[Welcome](./welcome-day-1.md) (5 minutes)" #~ msgstr "[ようこそ](./welcome-day-1.md)5 分" #~ msgid "[Hello, World](./hello-world.md) (20 minutes)" #~ msgstr "[Hello, World](./hello-world.md)20 分" #~ msgid "[Types and Values](./types-and-values.md) (1 hour and 5 minutes)" #~ msgstr "[型ず倀](./types-and-values.md)1 時間 5 分" #~ msgid "[Control Flow Basics](./control-flow-basics.md) (1 hour)" #~ msgstr "[制埡フロヌの基本](./control-flow-basics.md)1 時間" #~ msgid "Including 10 minute breaks, this session should take about 3 hours" #~ msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 3 時間です。" #~ msgid "In this segment:" #~ msgstr "このセグメントの内容:" #~ msgid "[What is Rust?](./hello-world/what-is-rust.md) (10 minutes)" #~ msgstr "[Rust ずは](./hello-world/what-is-rust.md)10 分" #~ msgid "[Hello, World](./hello-world/hello-world.md) (5 minutes)" #~ msgstr "[Hello, World](./hello-world/hello-world.md)5 分" #~ msgid "[Benefits of Rust](./hello-world/benefits.md) (3 minutes)" #~ msgstr "[Rust のメリット](./hello-world/benefits.md)3 分" #~ msgid "[Playground](./hello-world/playground.md) (2 minutes)" #~ msgstr "[プレむグラりンド](./hello-world/playground.md)2 分" #~ msgid "[Variables](./types-and-values/variables.md) (5 minutes)" #~ msgstr "[倉数](./types-and-values/variables.md)5 分" #~ msgid "[Values](./types-and-values/values.md) (10 minutes)" #~ msgstr "[倀](./types-and-values/values.md)10 分" #~ msgid "[Arithmetic](./types-and-values/arithmetic.md) (5 minutes)" #~ msgstr "[算術](./types-and-values/arithmetic.md)5 分" #~ msgid "[Strings](./types-and-values/strings.md) (10 minutes)" #~ msgstr "[文字列](./types-and-values/strings.md)10 分" #~ msgid "[Type Inference](./types-and-values/inference.md) (5 minutes)" #~ msgstr "[型掚論](./types-and-values/inference.md)5 分" #~ msgid "[Exercise: Fibonacci](./types-and-values/exercise.md) (30 minutes)" #~ msgstr "[挔習: フィボナッチ](./types-and-values/exercise.md)30 分" #~ msgid "" #~ "Rust has two types to represent strings, both of which will be covered in " #~ "more depth later. Both _always_ store UTF-8 encoded strings." #~ msgstr "" #~ "Rust には文字列を衚す 2 ぀の型がありたす。どちらも埌ほど詳しく説明したす。" #~ "䞡方ずも、 _垞に_ UTF-8 で゚ンコヌドされた文字列を栌玍したす。" #~ msgid "`String` - a modifiable, owned string." #~ msgstr "`String` - 倉曎可胜で、所有暩をも぀文字列。" #~ msgid "`&str` - a read-only string. String literals have this type." #~ msgstr "`&str` - 読み取り専甚の文字列。文字列リテラルはこの型です。" #~ msgid "\"🪐\"" #~ msgstr "\"🪐\"" #~ msgid "\", \"" #~ msgstr "\", \"" #~ msgid "\"final sentence: {}\"" #~ msgstr "\"final sentence: {}\"" #~ msgid "//println!(\"{:?}\", &sentence[12..13]);\n" #~ msgstr "//println!(\"{:?}\", &sentence[12..13]);\n" #~ msgid "" #~ "This slide introduces strings. Everything here will be covered in more " #~ "depth later, but this is enough for subsequent slides and exercises to " #~ "use strings." #~ msgstr "" #~ "このスラむドでは文字列を玹介したす。ここで取り䞊げた内容に぀いおは埌ほど詳" #~ "しく説明したすが、以降のスラむドや挔習で文字列を䜿甚するにはこれで十分で" #~ "す。" #~ msgid "Invalid UTF-8 in a string is UB, and this not allowed in safe Rust." #~ msgstr "文字列内の無効な UTF-8 は UB であり、Safe Rust では蚱可されたせん。" #~ msgid "" #~ "`String` is a user-defined type with a constructor (`::new()`) and " #~ "methods like `s.push_str(..)`." #~ msgstr "" #~ "`String` は、コンストラクタ`::new()` ず `s.push_str(..)` などのメ゜ッ" #~ "ドを持぀ナヌザヌ定矩型です。" #~ msgid "" #~ "The `&` in `&str` indicates that this is a reference. We will cover " #~ "references later, so for now just think of `&str` as a unit meaning \"a " #~ "read-only string\"." #~ msgstr "" #~ "`&str` 内の `&` は、これが参照であるこずを瀺したす。参照に぀いおは埌ほど説" #~ "明したすので、ここでは `&str` を、「読み取り専甚の文字列」を意味する単䜍ず" #~ "考えおください。" #~ msgid "" #~ "The commented-out line is indexing into the string by byte position. " #~ "`12..13` does not end on a character boundary, so the program panics. " #~ "Adjust it to a range that does, based on the error message." #~ msgstr "" #~ "コメントアりトされた行は、バむト䜍眮で文字列をむンデックス化しおいたす。" #~ "`12..13` は文字境界で終わっおいないため、プログラムはパニックしたす。゚" #~ "ラヌ メッセヌゞに基づいお、適切な範囲に調敎しおください。" #~ msgid "[Conditionals](./control-flow-basics/conditionals.md) (5 minutes)" #~ msgstr "[条件文](./control-flow-basics/conditionals.md)5 分" #~ msgid "[Loops](./control-flow-basics/loops.md) (5 minutes)" #~ msgstr "[ルヌプ](./control-flow-basics/loops.md)5 分" #~ msgid "" #~ "[break and continue](./control-flow-basics/break-continue.md) (5 minutes)" #~ msgstr "" #~ "[break ず continue](./control-flow-basics/break-continue.md)5 分" #~ msgid "" #~ "[Blocks and Scopes](./control-flow-basics/blocks-and-scopes.md) (10 " #~ "minutes)" #~ msgstr "" #~ "[ブロックずスコヌプ](./control-flow-basics/blocks-and-scopes.md)10 分" #~ msgid "[Functions](./control-flow-basics/functions.md) (3 minutes)" #~ msgstr "[関数](./control-flow-basics/functions.md)3 分" #~ msgid "[Macros](./control-flow-basics/macros.md) (2 minutes)" #~ msgstr "[マクロ](./control-flow-basics/macros.md)2 分" #~ msgid "" #~ "[Exercise: Collatz Sequence](./control-flow-basics/exercise.md) (30 " #~ "minutes)" #~ msgstr "[挔習: コラッツ数列](./control-flow-basics/exercise.md)30 分" #~ msgid "Much of the Rust syntax will be familiar to you from C, C++ or Java:" #~ msgstr "Rust の構文の倚くは、C、C++、Java で芋芚えがあるでしょう。" #, fuzzy #~ msgid "Blocks are delimited by curly braces." #~ msgstr "CやC++ず同様に、ブロックは波括匧で囲みたす。" #~ msgid "" #~ "Line comments are started with `//`, block comments are delimited by `/" #~ "* ... */`." #~ msgstr "" #~ "行コメントは `//` で始たり、ブロック コメントは `/* ... */` で区切られた" #~ "す。" #~ msgid "Keywords like `if` and `while` work the same." #~ msgstr "`if` や `while` などのキヌワヌドの動䜜は同じです。" #~ msgid "Variable assignment is done with `=`, comparison is done with `==`." #~ msgstr "倉数の代入は `=` で行われ、比范は `==` で行われたす。" #~ msgid "" #~ "We will discuss iteration later; for now, just stick to range expressions." #~ msgstr "" #~ "反埩凊理に぀いおは埌で説明したすので、ここでは範囲匏だけに泚目しおくださ" #~ "い。" #~ msgid "\"{result}\"" #~ msgstr "\"{result}\"" #~ msgid "\"x: {x}, i: {i}\"" #~ msgstr "\"x: {x}, i: {i}\"" #~ msgid "" #~ "In this case we break the outer loop after 3 iterations of the inner loop." #~ msgstr "" #~ "䞊の䟋では、内偎のルヌプを 3 回むテレヌションしたのちに倖偎のルヌプを抜け" #~ "るこずになりたす。" #~ msgid "1" #~ msgstr "1" #~ msgid " greater than zero:" #~ msgstr " に察しお、次のように定矩されたす。" #~ msgid "If _n" #~ msgstr "_n" #~ msgid "i" #~ msgstr "i" #~ msgid "_." #~ msgstr "_で終了したす。" #~ msgid "_ is even, then _n" #~ msgstr "_ が偶数の堎合、_n" #~ msgid "i+1" #~ msgstr "i+1" #~ msgid " = n" #~ msgstr " = n" #~ msgid " / 2_." #~ msgstr " / 2_ になりたす。" #~ msgid "_ is odd, then _n" #~ msgstr "_ が奇数の堎合、_n" #~ msgid " = 3 * n" #~ msgstr " = 3 * n" #~ msgid " + 1_." #~ msgstr " + 1_ になりたす。" #~ msgid "_ = 3:" #~ msgstr "_ = 3 で始たる堎合は以䞋のようになりたす。" #~ msgid "3 is odd, so _n" #~ msgstr "3 は奇数なので、_n" #~ msgid "2" #~ msgstr "2" #~ msgid "_ = 3 * 3 + 1 = 10;" #~ msgstr "_ = 3 * 3 + 1 = 10 になりたす。" #~ msgid "10 is even, so _n" #~ msgstr "10 は偶数なので、_n" #~ msgid "_ = 10 / 2 = 5;" #~ msgstr "_ = 10 / 2 = 5 になりたす。" #~ msgid "5 is odd, so _n" #~ msgstr "5 は奇数なので、_n" #~ msgid "_ = 3 * 5 + 1 = 16;" #~ msgstr "_ = 3 * 5 + 1 = 16 になりたす。" #~ msgid "16 is even, so _n" #~ msgstr "16 は偶数なので、_n" #~ msgid "5" #~ msgstr "5" #~ msgid "_ = 16 / 2 = 8;" #~ msgstr "_ = 16 / 2 = 8 になりたす。" #~ msgid "8 is even, so _n" #~ msgstr "8 は偶数なので、_n" #~ msgid "_ = 8 / 2 = 4;" #~ msgstr "_ = 8 / 2 = 4 になりたす。" #~ msgid "4 is even, so _n" #~ msgstr "4 は偶数なので、_n" #~ msgid "7" #~ msgstr "7" #~ msgid "_ = 4 / 2 = 2;" #~ msgstr "_ = 4 / 2 = 2 になりたす。" #~ msgid "2 is even, so _n" #~ msgstr "2 は偶数なので、_n" #~ msgid "_ = 1; and" #~ msgstr "_ = 1 になりたす。" #~ msgid "[Tuples and Arrays](./tuples-and-arrays.md) (1 hour)" #~ msgstr "[タプルず配列](./tuples-and-arrays.md)1 時間" #~ msgid "[References](./references.md) (50 minutes)" #~ msgstr "[参照](./references.md)50 分" #~ msgid "[User-Defined Types](./user-defined-types.md) (50 minutes)" #~ msgstr "[ナヌザヌ定矩型](./user-defined-types.md)50 分" #~ msgid "" #~ "[Tuples and Arrays](./tuples-and-arrays/tuples-and-arrays.md) (10 minutes)" #~ msgstr "[タプルず配列](./tuples-and-arrays/tuples-and-arrays.md)10 分" #~ msgid "[Array Iteration](./tuples-and-arrays/iteration.md) (3 minutes)" #~ msgstr "[配列の反埩凊理](./tuples-and-arrays/iteration.md)3 分" #~ msgid "[Pattern Matching](./tuples-and-arrays/match.md) (10 minutes)" #~ msgstr "[パタヌン マッチング](./tuples-and-arrays/match.md)10 分" #~ msgid "[Destructuring](./tuples-and-arrays/destructuring.md) (5 minutes)" #~ msgstr "[分解](./tuples-and-arrays/destructuring.md)5 分" #~ msgid "" #~ "[Exercise: Nested Arrays](./tuples-and-arrays/exercise.md) (30 minutes)" #~ msgstr "[挔習: ネストされた配列](./tuples-and-arrays/exercise.md)30 分" #~ msgid "" #~ "Tuples and arrays are the first \"compound\" types we have seen. All " #~ "elements of an array have the same type, while tuples can accommodate " #~ "different types. Both types have a size fixed at compile time." #~ msgstr "" #~ "タプルず配列は、このコヌスで初めお扱う「耇合」型です。配列のすべおの芁玠の" #~ "型は同じですが、タプルは異なる型に察応できたす。どちらの型もコンパむル時に" #~ "サむズが固定されたす。" #~ msgid "`[T; N]`" #~ msgstr "`[T; N]`" #~ msgid "`[20, 30, 40]`, `[0; 3]`" #~ msgstr "`[20, 30, 40]`、`[0; 3]`" #~ msgid "`()`, `(T,)`, `(T1, T2)`, ..." #~ msgstr "`()`、`(T,)`、`(T1, T2)`、..." #~ msgid "`()`, `('x',)`, `('x', 1.2)`, ..." #~ msgstr "`()`、`('x',)`、`('x', 1.2)`、..." #~ msgid "Array assignment and access:" #~ msgstr "配列の代入ずアクセス:" #~ msgid "Tuple assignment and access:" #~ msgstr "タプルの代入ずアクセス:" #~ msgid "Arrays:" #~ msgstr "配列:" #~ msgid "Tuples:" #~ msgstr "タプル:" #~ msgid "" #~ "The empty tuple `()` is also known as the \"unit type\". It is both a " #~ "type, and the only valid value of that type --- that is to say both the " #~ "type and its value are expressed as `()`. It is used to indicate, for " #~ "example, that a function or expression has no return value, as we'll see " #~ "in a future slide." #~ msgstr "" #~ "空のタプル `()` は、「ナニット型」ずも呌ばれたす。これは型であるずずもに、" #~ "その型で唯䞀の有効な倀です。぀たり、型ずその倀の䞡方が `()` ずしお衚珟され" #~ "たす。以降のスラむドで説明するように、これは関数や匏に戻り倀がないこずを瀺" #~ "す堎合などに䜿甚されたす。" #~ msgid "" #~ "You can think of it as `void` that can be familiar to you from other " #~ "programming languages." #~ msgstr "" #~ "これは、他のプログラミング蚀語で銎染みのある `void` ず考えるこずができた" #~ "す。" #~ msgid "" #~ "Destructuring is a way of extracting data from a data structure by " #~ "writing a pattern that is matched up to the data structure, binding " #~ "variables to subcomponents of the data structure." #~ msgstr "" #~ "分解ずは、デヌタ構造に䞀臎するパタヌンを蚘述し、倉数をデヌタ構造のサブコン" #~ "ポヌネントにバむンドするこずで、デヌタ構造からデヌタを抜出する方法です。" #~ msgid "You can destructure tuples and arrays by matching on their elements:" #~ msgstr "タプルず配列は、芁玠を照合するこずで分解できたす。" #~ msgid "\"on Y axis\"" #~ msgstr "\"on Y axis\"" #~ msgid "\"on X axis\"" #~ msgstr "\"on X axis\"" #~ msgid "\"left of Y axis\"" #~ msgstr "\"left of Y axis\"" #~ msgid "\"below X axis\"" #~ msgstr "\"below X axis\"" #~ msgid "\"first quadrant\"" #~ msgstr "\"first quadrant\"" #~ msgid "\"Tell me about {triple:?}\"" #~ msgstr "\"Tell me about {triple:?}\"" #~ msgid "\"First is 0, y = {y}, and z = {z}\"" #~ msgstr "\"First is 0, y = {y}, and z = {z}\"" #~ msgid "\"First is 1 and the rest were ignored\"" #~ msgstr "\"First is 1 and the rest were ignored\"" #~ msgid "\"All elements were ignored\"" #~ msgstr "\"All elements were ignored\"" #~ msgid "Create a new array pattern using `_` to represent an element." #~ msgstr "`_` を䜿甚しお芁玠を衚す新しい配列パタヌンを䜜成したす。" #~ msgid "Add more values to the array." #~ msgstr "配列に倀を远加したす。" #~ msgid "" #~ "Point out that how `..` will expand to account for different number of " #~ "elements." #~ msgstr "芁玠数が異なる堎合に `..` がどのように展開されるかを説明したす。" #~ msgid "" #~ "Show matching against the tail with patterns `[.., b]` and `[a@..,b]`" #~ msgstr "パタヌン `[.., b]` ず `[a@..,b]` で末尟を照合したす。" #~ msgid "Hard-code both functions to operate on 3 × 3 matrices." #~ msgstr "3 × 3 の行列で動䜜するように、䞡方の関数をハヌドコヌドしたす。" #~ msgid "[Shared References](./references/shared.md) (10 minutes)" #~ msgstr "[共有参照](./references/shared.md)10 分" #~ msgid "[Exclusive References](./references/exclusive.md) (10 minutes)" #~ msgstr "[排他参照](./references/except.md)10 分" #~ msgid "[Exercise: Geometry](./references/exercise.md) (30 minutes)" #~ msgstr "[挔習: ゞオメトリ](./references/exercise.md)30 分" #~ msgid "[Named Structs](./user-defined-types/named-structs.md) (10 minutes)" #~ msgstr "[名前付き構造䜓](./user-defined-types/named-structs.md)10 分" #~ msgid "[Tuple Structs](./user-defined-types/tuple-structs.md) (10 minutes)" #~ msgstr "[タプル構造䜓](./user-defined-types/tuple-structs.md)10 分" #~ msgid "[Enums](./user-defined-types/enums.md) (5 minutes)" #~ msgstr "[列挙型](./user-defined-types/enums.md)5 分" #~ msgid "" #~ "[Static and Const](./user-defined-types/static-and-const.md) (5 minutes)" #~ msgstr "[static ず const](./user-defined-types/static-and-const.md)5 分" #~ msgid "[Type Aliases](./user-defined-types/aliases.md) (2 minutes)" #~ msgstr "[型゚むリアス](./user-defined-types/aliases.md)2 分" #~ msgid "" #~ "[Exercise: Elevator Events](./user-defined-types/exercise.md) (15 minutes)" #~ msgstr "" #~ "[挔習: ゚レベヌタヌ むベント](./user-defined-types/exercise.md)15 分" #~ msgid "" #~ "Static and constant variables are two different ways to create globally-" #~ "scoped values that cannot be moved or reallocated during the execution of " #~ "the program." #~ msgstr "" #~ "静的倉数ず定数倉数は、プログラムの実行䞭に移動たたは再割り圓おできないグ" #~ "ロヌバル スコヌプの倀を䜜成するための、2 ぀の異なる方法です。" #~ msgid "Properties table:" #~ msgstr "プロパティの衚:" #~ msgid "Has an address in memory" #~ msgstr "メモリ内にアドレスがある" #~ msgid "No (inlined)" #~ msgstr "いいえむンラむン化" #, fuzzy #~ msgid "Lives for the entire duration of the program" #~ msgstr "`main`関数はプログラムの゚ントリヌポむントになりたす。" #~ msgid "Can be mutable" #~ msgstr "倉曎可胜" #~ msgid "Yes (unsafe)" #~ msgstr "はい安党でない" #~ msgid "Evaluated at compile time" #~ msgstr "コンパむル時に評䟡" #~ msgid "Yes (initialised at compile time)" #~ msgstr "はいコンパむル時に初期化" #~ msgid "Inlined wherever it is used" #~ msgstr "䜿甚堎所にかかわらずむンラむン化" #~ msgid "[Welcome](./welcome-day-2.md) (3 minutes)" #~ msgstr "[ようこそ](./welcome-day-2.md)3 分" #~ msgid "[Pattern Matching](./pattern-matching.md) (50 minutes)" #~ msgstr "[パタヌン マッチング](./pattern-matching.md)50 分" #, fuzzy #~ msgid "[Methods and Traits](./methods-and-traits.md) (55 minutes)" #~ msgstr "[メ゜ッドずトレむト](./methods-and-train.md)45 分" #~ msgid "[Generics](./generics.md) (45 minutes)" #~ msgstr "[ゞェネリクス](./generics.md)45 分" #~ msgid "[Destructuring](./pattern-matching/destructuring.md) (10 minutes)" #~ msgstr "[デストラクト](./pattern-matching/destructuring.md)10 分" #~ msgid "" #~ "[Let Control Flow](./pattern-matching/let-control-flow.md) (10 minutes)" #~ msgstr "" #~ "[let による制埡フロヌ](./pattern-matching/let-control-flow.md)10 分" #~ msgid "" #~ "[Exercise: Expression Evaluation](./pattern-matching/exercise.md) (30 " #~ "minutes)" #~ msgstr "[挔習: 匏の評䟡](./pattern-matching/exercise.md)30 分" #~ msgid "`match` expressions" #~ msgstr "`match` 匏" #~ msgid "[Methods](./methods-and-traits/methods.md) (10 minutes)" #~ msgstr "[メ゜ッド](./methods-and-train/methods.md)10 分" #~ msgid "[Traits](./methods-and-traits/traits.md) (10 minutes)" #~ msgstr "[トレむト](./methods-and-features/train.md)10 分" #~ msgid "[Deriving](./methods-and-traits/deriving.md) (5 minutes)" #~ msgstr "[導出](./methods-and-train/deriving.md)5 分" #~ msgid "[Trait Objects](./methods-and-traits/trait-objects.md) (10 minutes)" #~ msgstr "[トレむトオブゞェクト](./methods-and-features/train.md)10 分" #~ msgid "" #~ "[Exercise: Generic Logger](./methods-and-traits/exercise.md) (20 minutes)" #~ msgstr "" #~ "[挔習: ゞェネリックなロガヌ](./methods-and-train/exercise.md)20 分" #~ msgid "" #~ "Trait objects allow for values of different types, for instance in a " #~ "collection:" #~ msgstr "" #~ "トレむトオブゞェクトは異なる型の倀をひず぀のコレクションにたずめるこずを可" #~ "胜にしたす" #~ msgid "[Generic Functions](./generics/generic-functions.md) (5 minutes)" #~ msgstr "[ゞェネリック関数](./generics/generic-functions.md)5 分" #~ msgid "[Generic Data Types](./generics/generic-data.md) (15 minutes)" #~ msgstr "[ゞェネリック デヌタ型](./generics/generic-data.md)15 分" #~ msgid "[Trait Bounds](./generics/trait-bounds.md) (10 minutes)" #~ msgstr "[トレむト境界](./generics/trait-bounds.md)10 分" #~ msgid "[impl Trait](./generics/impl-trait.md) (5 minutes)" #~ msgstr "[impl トレむト](./generics/impl-trait.md)5 分" #~ msgid "[Exercise: Generic min](./generics/exercise.md) (10 minutes)" #~ msgstr "[挔習: ゞェネリックな min](./generics/exercise.md)10 分" #~ msgid "// fn set_x(&mut self, x: T)\n" #~ msgstr "// fn set_x(&mut self, x: T)\n" #~ msgid "/// Return true if self is less than other.\n" #~ msgstr "/// 自身がその他より小さい堎合は true を返したす。\n" #~ msgid "\"Shapiro\"" #~ msgstr "\"Shapiro\"" #~ msgid "\"Baumann\"" #~ msgstr "\"Baumann\"" #~ msgid "[Standard Library Types](./std-types.md) (1 hour and 10 minutes)" #~ msgstr "[暙準ラむブラリ型](./std-types.md)1 時間 10 分" #~ msgid "[Standard Library Traits](./std-traits.md) (1 hour and 40 minutes)" #~ msgstr "[暙準ラむブラリ トレむト](./std-train.md)1 時間 40 分" #~ msgid "[Standard Library](./std-types/std.md) (3 minutes)" #~ msgstr "[暙準ラむブラリ](./std-types/std.md)3 分" #~ msgid "[Documentation](./std-types/docs.md) (5 minutes)" #~ msgstr "[ドキュメント](./std-types/docs.md)5 分" #~ msgid "[Option](./std-types/option.md) (10 minutes)" #~ msgstr "[Option](./std-types/option.md)10 分" #~ msgid "[Result](./std-types/result.md) (10 minutes)" #~ msgstr "[Result](./std-types/result.md)10 分" #~ msgid "[String](./std-types/string.md) (10 minutes)" #~ msgstr "[String](./std-types/string.md)10 分" #~ msgid "[Vec](./std-types/vec.md) (10 minutes)" #~ msgstr "[Vec](./std-types/vec.md)10 分" #~ msgid "[HashMap](./std-types/hashmap.md) (10 minutes)" #~ msgstr "[HashMap](./std-types/hashmap.md)10 分" #~ msgid "[Exercise: Counter](./std-types/exercise.md) (10 minutes)" #~ msgstr "[挔習: カりンタ](./std-types/exercise.md)10 分" #~ msgid "[Comparisons](./std-traits/comparisons.md) (10 minutes)" #~ msgstr "[比范](./std-lets/comparisons.md)10 分" #~ msgid "[Operators](./std-traits/operators.md) (10 minutes)" #~ msgstr "[挔算子](./std-train/operators.md)10 分" #~ msgid "[From and Into](./std-traits/from-and-into.md) (10 minutes)" #~ msgstr "[From ず Into](./std-lets/from-and-into.md)10 分" #~ msgid "[Casting](./std-traits/casting.md) (5 minutes)" #~ msgstr "[キャスト](./std-train/casting.md)5 分" #~ msgid "[Read and Write](./std-traits/read-and-write.md) (10 minutes)" #~ msgstr "[読み取りず曞き蟌み](./std-train/read-and-write.md)10 分" #~ msgid "[Default, struct update syntax](./std-traits/default.md) (5 minutes)" #~ msgstr "[Default、構造䜓曎新蚘法](./std-lets/default.md)5 分" #~ msgid "[Closures](./std-traits/closures.md) (20 minutes)" #~ msgstr "[クロヌゞャ](./std-lets/closures.md)20 分" #~ msgid "[Exercise: ROT13](./std-traits/exercise.md) (30 minutes)" #~ msgstr "[挔習: ROT13](./std-train/exercise.md)30 分" #~ msgid "This segment should take about 1 hour and 40 minutes" #~ msgstr "このセグメントの所芁時間は玄 1 時間 40 分です" #~ msgid "\"there\"" #~ msgstr "\"there\"" #~ msgid "[Welcome](./welcome-day-3.md) (3 minutes)" #~ msgstr "[ようこそ](./welcome-day-3.md)3 分" #~ msgid "[Memory Management](./memory-management.md) (1 hour and 10 minutes)" #~ msgstr "[メモリ管理](./memory-management.md)1 時間 10 分" #~ msgid "[Smart Pointers](./smart-pointers.md) (45 minutes)" #~ msgstr "[スマヌト ポむンタ](./smart-pointers.md)45 分" #~ msgid "" #~ "[Review of Program Memory](./memory-management/review.md) (5 minutes)" #~ msgstr "[プログラム メモリの埩習](./memory-management/review.md)5 分" #~ msgid "" #~ "[Approaches to Memory Management](./memory-management/approaches.md) (10 " #~ "minutes)" #~ msgstr "[メモリ管理の方法](./memory-management/approaches.md)10 分" #~ msgid "[Ownership](./memory-management/ownership.md) (5 minutes)" #~ msgstr "[所有暩](./memory-management/ownership.md)5 分" #~ msgid "[Move Semantics](./memory-management/move.md) (10 minutes)" #~ msgstr "[ムヌブ セマンティクス](./memory-management/move.md)10 分" #~ msgid "[Clone](./memory-management/clone.md) (2 minutes)" #~ msgstr "[Clone](./memory-management/clone.md)2 分" #~ msgid "[Copy Types](./memory-management/copy-types.md) (5 minutes)" #~ msgstr "[Copy 型](./memory-management/copy-types.md)5 分" #~ msgid "[Drop](./memory-management/drop.md) (10 minutes)" #~ msgstr "[Drop](./memory-management/drop.md)10 分" #~ msgid "" #~ "[Exercise: Builder Type](./memory-management/exercise.md) (20 minutes)" #~ msgstr "[挔習: ビルダヌ型](./memory-management/exercise.md)20 分" #~ msgid "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" #~ msgstr "\"ptr = {ptr:#x}, len = {len}, capacity = {capacity}\"" #~ msgid "[Box" #~ msgstr "[Box" #~ msgid "](./smart-pointers/box.md) (10 minutes)" #~ msgstr "](./smart-pointers/box.md)10 分" #~ msgid "[Rc](./smart-pointers/rc.md) (5 minutes)" #~ msgstr "[Rc](./smart-pointers/rc.md)5 分" #~ msgid "[Exercise: Binary Tree](./smart-pointers/exercise.md) (30 minutes)" #~ msgstr "[挔習: バむナリツリヌ](./smart-pointers/exercise.md)30 分" #~ msgid "" #~ "A `Box` cannot be empty, so the pointer is always valid and non-`null`. " #~ "This allows the compiler to optimize the memory layout:" #~ msgstr "" #~ "`Box` を空にするこずはできないため、ポむンタは垞に有効か぀非 `null` になり" #~ "たす。これにより、コンパむラがメモリ レむアりトを最適化できたす。" #~ msgid "" #~ "```bob\n" #~ " Stack Heap\n" #~ ".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - -.\n" #~ ": : : :\n" #~ ": list : : :\n" #~ ": +---------+----+----+ : : +---------+----+----+ :\n" #~ ": | Element | 1 | o--+----+-----+--->| Element | 2 | // | :\n" #~ ": +---------+----+----+ : : +---------+----+----+ :\n" #~ ": : : :\n" #~ ": : : :\n" #~ "'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - -'\n" #~ "```" #~ msgstr "" #~ "```bob\n" #~ " Stack Heap\n" #~ ".- - - - - - - - - - - - - - . .- - - - - - - - - - - - - -.\n" #~ ": : : :\n" #~ ": list : : :\n" #~ ": +---------+----+----+ : : +---------+----+----+ :\n" #~ ": | Element | 1 | o--+----+-----+--->| Element | 2 | // | :\n" #~ ": +---------+----+----+ : : +---------+----+----+ :\n" #~ ": : : :\n" #~ ": : : :\n" #~ "'- - - - - - - - - - - - - - ' '- - - - - - - - - - - - - -'\n" #~ "```" #~ msgid "[Borrowing](./borrowing.md) (1 hour)" #~ msgstr "[借甚](./borrowing.md)1 時間" #~ msgid "" #~ "[Slices and Lifetimes](./slices-and-lifetimes.md) (1 hour and 10 minutes)" #~ msgstr "[スラむスずラむフタむム](./slices-and-lifetimes.md)1 時間 10 分" #~ msgid "[Borrowing a Value](./borrowing/shared.md) (10 minutes)" #~ msgstr "[倀の借甚](./borrowing/shared.md)10 分" #~ msgid "[Borrow Checking](./borrowing/borrowck.md) (10 minutes)" #~ msgstr "[借甚チェック](./borrowing/borrowck.md)10 分" #~ msgid "" #~ "[Interior Mutability](./borrowing/interior-mutability.md) (10 minutes)" #~ msgstr "[内郚可倉性](./borrowing/interior-mutability.md)10 分" #~ msgid "[Exercise: Health Statistics](./borrowing/exercise.md) (30 minutes)" #~ msgstr "[挔習: 健康に関する統蚈情報](./borrowing/exercise.md)30 分" #~ msgid "The Rust compiler can do return value optimization (RVO)." #~ msgstr "Rust コンパむラは戻り倀の最適化RVOを行うこずができたす。" #~ 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." #~ msgstr "" #~ "C++ では、コンストラクタが副䜜甚をもたらす可胜性があるため、蚀語仕様でコ" #~ "ピヌ省略を定矩する必芁がありたす。Rust では、これはたったく問題になりたせ" #~ "ん。RVO が行われなかった堎合でも、Rust は垞にシンプルで効率的な `memcpy` " #~ "コピヌを実行したす。" #~ msgid "\"graph: {root:#?}\"" #~ msgstr "\"graph: {root:#?}\"" #~ msgid "\"graph sum: {}\"" #~ msgstr "\"graph sum: {}\"" #~ 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." #~ msgstr "" #~ "`Rc` は倚くの参照を蚱可およびカりントするこずを目的ずしおいるため、コ" #~ "ンテンツぞの共有読み取り専甚アクセスのみを蚱可したす。しかし、ここでは" #~ "倀を倉曎したいので、内郚可倉性が必芁です。" #~ msgid "" #~ "Demonstrate that reference loops can be created by adding `root` to " #~ "`subtree.children`." #~ msgstr "" #~ "`subtree.children` に `root` を远加しお参照ルヌプを䜜成できるこずを瀺した" #~ "す。" #~ 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'`." #~ msgstr "" #~ "実行時のパニックを瀺すため、`self.value` をむンクリメントしおその子に察し" #~ "お同じメ゜ッドを呌び出す `fn inc(&mut self)` を远加したす。これは、参照" #~ "ルヌプがあるずパニックずなり、`thread 'main' panicked at 'already " #~ "borrowed: BorrowMutError'` ずいう゚ラヌが出力されたす。" #~ msgid "[Slices: &\\[T\\]](./slices-and-lifetimes/slices.md) (10 minutes)" #~ msgstr "[Slices: &\\[T\\]](./slices-and-lifetimes/slices.md)10 分" #~ msgid "[String References](./slices-and-lifetimes/str.md) (10 minutes)" #~ msgstr "[文字列参照](./slices-and-lifetimes/str.md)10 分" #~ msgid "" #~ "[Lifetime Annotations](./slices-and-lifetimes/lifetime-annotations.md) " #~ "(10 minutes)" #~ msgstr "" #~ "[ラむフタむム アノテヌション](./slices-and-lifetimes/lifetime-annotations." #~ "md)10 分" #~ msgid "" #~ "[Lifetime Elision](./slices-and-lifetimes/lifetime-elision.md) (5 minutes)" #~ msgstr "" #~ "[ラむフタむムの省略](./slices-and-lifetimes/lifetime-elision.md)5 分" #~ msgid "" #~ "[Struct Lifetimes](./slices-and-lifetimes/struct-lifetimes.md) (5 minutes)" #~ msgstr "" #~ "[構造䜓のラむフタむム](./slices-and-lifetimes/struct-lifetimes.md)5 分" #~ msgid "" #~ "[Exercise: Protobuf Parsing](./slices-and-lifetimes/exercise.md) (30 " #~ "minutes)" #~ msgstr "" #~ "[挔習: Protobuf の解析](./slices-and-lifetimes/exercise.md)30 分" #~ msgid "" #~ "We can now understand the two string types in Rust: `&str` is almost like " #~ "`&[char]`, but with its data stored in a variable-length encoding (UTF-8)." #~ msgstr "" #~ "これで、Rust の 2 ぀の文字列型を理解できるようになりたした。`&str` は " #~ "`&[char]` ずほが同じですが、そのデヌタは可倉長゚ンコヌドUTF-8で保存さ" #~ "れたす。" #~ msgid "Rust terminology:" #~ msgstr "Rust の甚語:" #~ msgid "`&str` an immutable reference to a string slice." #~ msgstr "`&str`: 文字列スラむスぞの䞍倉の参照。" #~ msgid "`String` a mutable string buffer." #~ msgstr "`String`: 可倉の文字列バッファ。" #~ msgid "\"Unexpected wire-type)\"" #~ msgstr "\"Unexpected wire-type)\"" #~ msgid "\"Invalid string (not UTF-8)\"" #~ msgstr "\"Invalid string (not UTF-8)\"" #~ msgid "// Unwrap error because `value` is definitely 4 bytes long.\n" #~ msgstr "" #~ "// `value` の長さは明らかに 4 バむトであるため、゚ラヌをアンラップした" #~ "す。\n" #~ msgid "b\"hello\"" #~ msgstr "b\"hello\"" #~ msgid "[Welcome](./welcome-day-4.md) (3 minutes)" #~ msgstr "[ようこそ](./welcome-day-4.md)3 分" #~ msgid "[Iterators](./iterators.md) (45 minutes)" #~ msgstr "[むテレヌタ](./iterators.md)45 分" #~ msgid "[Modules](./modules.md) (40 minutes)" #~ msgstr "[モゞュヌル](./modules.md)40 分" #~ msgid "[Iterator](./iterators/iterator.md) (5 minutes)" #~ msgstr "[Iterator](./iterators/iterator.md)5 分" #~ msgid "[IntoIterator](./iterators/intoiterator.md) (5 minutes)" #~ msgstr "[IntoIterator](./iterators/intoiterator.md)5 分" #~ msgid "[FromIterator](./iterators/fromiterator.md) (5 minutes)" #~ msgstr "[FromIterator](./iterators/fromiterator.md)5 分" #~ msgid "" #~ "[Exercise: Iterator Method Chaining](./iterators/exercise.md) (30 minutes)" #~ msgstr "" #~ "[挔習: むテレヌタ メ゜ッドのチェヌン化](./iterators/exercise.md)30 分" #~ msgid "[Modules](./modules/modules.md) (5 minutes)" #~ msgstr "[モゞュヌル](./modules/modules.md)5 分" #~ msgid "[Filesystem Hierarchy](./modules/filesystem.md) (5 minutes)" #~ msgstr "[ファむル システム階局](./modules/filesystem.md)5 分" #~ msgid "[Visibility](./modules/visibility.md) (5 minutes)" #~ msgstr "[可芖性](./modules/visibility.md)5 分" #~ msgid "[use, super, self](./modules/paths.md) (10 minutes)" #~ msgstr "[use、super、self](./modules/paths.md)10 分" #~ msgid "" #~ "[Exercise: Modules for a GUI Library](./modules/exercise.md) (15 minutes)" #~ msgstr "[挔習: GUI ラむブラリのモゞュヌル](./modules/exercise.md)15 分" #~ msgid "[Test Modules](./testing/unit-tests.md) (5 minutes)" #~ msgstr "[テスト] モゞュヌル(./testing/unit-tests.md)5 分" #~ msgid "[Other Types of Tests](./testing/other.md) (10 minutes)" #~ msgstr "[その他の皮類のテスト](./testing/other.md)10 分" #~ msgid "[Useful Crates](./testing/useful-crates.md) (3 minutes)" #~ msgstr "[䟿利なクレヌト](./testing/useful-crates.md)3 分" #~ msgid "[GoogleTest](./testing/googletest.md) (5 minutes)" #~ msgstr "[GoogleTest](./testing/googletest.md)5 分" #~ msgid "[Mocking](./testing/mocking.md) (5 minutes)" #~ msgstr "[モック](./testing/mocking.md)5 分" #~ msgid "[Compiler Lints and Clippy](./testing/lints.md) (5 minutes)" #~ msgstr "[コンパむラの リント ず Clippy](./testing/lints.md)5 分" #~ msgid "[Exercise: Luhn Algorithm](./testing/exercise.md) (30 minutes)" #~ msgstr "[挔習: Luhn アルゎリズム](./testing/exercise.md)30 分" #~ msgid "Rust comes with only basic support for writing tests." #~ msgstr "Rust は、テストを䜜成するための基本的なサポヌトのみを提䟛したす。" #~ msgid "" #~ "Here are some additional crates which we recommend for writing tests:" #~ msgstr "テストを䜜成する際に掚奚されるその他のクレヌトを以䞋に瀺したす。" #~ msgid "" #~ "[googletest](https://docs.rs/googletest): Comprehensive test assertion " #~ "library in the tradition of GoogleTest for C++." #~ msgstr "" #~ "[googletest](https://docs.rs/googletest): 埓来の C++ 向け GoogleTestのよう" #~ "な包括的なテスト アサヌション ラむブラリです。" #~ msgid "" #~ "[proptest](https://docs.rs/proptest): Property-based testing for Rust." #~ msgstr "" #~ "[proptest](https://docs.rs/proptest): Rust のプロパティ ベヌスのテストで" #~ "す。" #~ msgid "" #~ "[rstest](https://docs.rs/rstest): Support for fixtures and parameterised " #~ "tests." #~ msgstr "" #~ "[rstest](https://docs.rs/rstest): フィクスチャずパラメヌタ化されたテストを" #~ "サポヌトしたす。" #~ msgid "This just scratches the surface, there are many builtin matchers." #~ msgstr "" #~ "ここで扱っおいるものはごく䞀郚であり、他にも倚くの組み蟌みマッチャヌがあり" #~ "たす。" #~ msgid "GoogleTest is available for use in AOSP." #~ msgstr "GoogleTest は AOSP で䜿甚できたす。" #~ msgid "[Error Handling](./error-handling.md) (45 minutes)" #~ msgstr "[゚ラヌ凊理](./error-handling.md)45 分" #~ msgid "[Unsafe Rust](./unsafe-rust.md) (1 hour and 5 minutes)" #~ msgstr "[アンセヌフRust](./unsafe-rust.md)1 時間 5 分" #~ msgid "Including 10 minute breaks, this session should take about 2 hours" #~ msgstr "このセッションの所芁時間は、10 分間の䌑憩を入れお玄 2 時間です。" #~ msgid "[Panics](./error-handling/panics.md) (3 minutes)" #~ msgstr "[パニック](./error-handling/panics.md)3 分" #~ msgid "[Try Operator](./error-handling/try.md) (5 minutes)" #~ msgstr "[try 挔算子](./error-handling/try.md)5 分" #~ msgid "[Try Conversions](./error-handling/try-conversions.md) (5 minutes)" #~ msgstr "[try 倉換](./error-handling/try-conversions.md)5 分" #~ msgid "[Error Trait](./error-handling/error.md) (5 minutes)" #~ msgstr "[゚ラヌトレむト](./error-handling/error.md)5 分" #~ msgid "" #~ "[thiserror and anyhow](./error-handling/thiserror-and-anyhow.md) (5 " #~ "minutes)" #~ msgstr "" #~ "[thiserror ず anyhow](./error-handling/thiserror-and-anyhow.md)5 分" #~ msgid "" #~ "[Exercise: Rewriting with Result](./error-handling/exercise.md) (20 " #~ "minutes)" #~ msgstr "" #~ "[挔習: Result を䜿甚した曞き換え](./error-handling/exercise.md)20 分" #~ msgid "[Unsafe](./unsafe-rust/unsafe.md) (5 minutes)" #~ msgstr "[アンセヌフRust](./unsafe-rust/unsafe.md)5 分" #~ msgid "" #~ "[Dereferencing Raw Pointers](./unsafe-rust/dereferencing.md) (10 minutes)" #~ msgstr "[未加工ポむンタの参照倖し](./unsafe-rust/dereferencing.md)10 分" #~ msgid "" #~ "[Mutable Static Variables](./unsafe-rust/mutable-static.md) (5 minutes)" #~ msgstr "[可倉の静的倉数](./unsafe-rust/mutable-static.md)5 分" #~ msgid "[Unions](./unsafe-rust/unions.md) (5 minutes)" #~ msgstr "[共甚䜓](./unsafe-rust/unions.md)5 分" #~ msgid "[Unsafe Functions](./unsafe-rust/unsafe-functions.md) (5 minutes)" #~ msgstr "[アンセヌフな関数](./unsafe-rust/unsafe-functions.md)5 分" #~ msgid "[Unsafe Traits](./unsafe-rust/unsafe-traits.md) (5 minutes)" #~ msgstr "[アンセヌフなトレむト](./unsafe-rust/unsafe-traits.md)5 分" #~ msgid "[Exercise: FFI Wrapper](./unsafe-rust/exercise.md) (30 minutes)" #~ msgstr "[挔習: FFI ラッパヌ](./unsafe-rust/exercise.md)30 分" #~ msgid "// Undefined behavior if abs misbehaves.\n" #~ msgstr "// abs 誀動䜜の堎合の動䜜は未定矩。\n" #~ msgid "// Safe because ...\n" #~ msgstr "// 安党です。理由は...\n" #~ msgid "" #~ "Add `vendor_available: true` if your AIDL file is used by a binary in the " #~ "vendor partition." #~ msgstr "" #~ "AIDL ファむルがベンダヌ パヌティション内のバむナリで䜿甚されおいる堎合は、" #~ "`vendor_available: true` を远加したす。" #~ msgid "/// Connect to the BirthdayService.\n" #~ msgstr "/// BirthdayService に接続したす。\n" #~ msgid "" #~ "// SAFETY: `print_card` is safe to call with a valid `card` pointer.\n" #~ msgstr "" #~ "// SAFETY: `print_card` は有効な `card` ポむンタで安党に呌び出せたす。\n" #~ msgid "ADC" #~ msgstr "ADC" #~ msgid "I2C, SPI, UART, CAN" #~ msgstr "I2C、SPI、UART、CAN" #~ msgid "RNG" #~ msgstr "RNG" #~ msgid "Timers" #~ msgstr "タむマヌ" #~ msgid "Watchdogs" #~ msgstr "りォッチドッグ" #~ msgid "" #~ "There is work in progress on an `async` version of `embedded-hal`, but it " #~ "isn't stable yet." #~ msgstr "" #~ "`embedded-hal`の`async`バヌゞョンも開発䞭ですが、ただ安定しおはいたせん。" #~ msgid "" #~ "// Set up the I2C controller and Inertial Measurement Unit.\n" #~ " // TODO\n" #~ msgstr "" #~ "// I2C コントロヌラず慣性枬定ナニットをセットアップしたす。\n" #~ " // TODO\n" #~ msgid "" #~ "// Read compass data and log it to the serial port.\n" #~ " // TODO\n" #~ msgstr "" #~ "// コンパスデヌタを読み取り、シリアルポヌトに蚘録したす。\n" #~ " // TODO\n" #~ msgid "// TODO: Create instance of RTC driver and print current time.\n" #~ msgstr "" #~ "// TODO: RTC ドラむバのむンスタンスを䜜成し、珟圚の時刻を出力したす。\n" #~ msgid "// TODO: Wait for 3 seconds.\n" #~ msgstr "// TODO: 3 秒間埅機したす。\n" #~ msgid "" #~ "// Copyright 2023 Google LLC\n" #~ "//\n" #~ "// Licensed under the Apache License, Version 2.0 (the \"License\");\n" #~ "// you may not use this file except in compliance with the License.\n" #~ "// You may obtain a copy of the License at\n" #~ "//\n" #~ "// http://www.apache.org/licenses/LICENSE-2.0\n" #~ "//\n" #~ "// Unless required by applicable law or agreed to in writing, software\n" #~ "// distributed under the License is distributed on an \"AS IS\" BASIS,\n" #~ "// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or " #~ "implied.\n" #~ "// See the License for the specific language governing permissions and\n" #~ "// limitations under the License.\n" #~ msgstr "" #~ "// Copyright 2023 Google LLC\n" #~ "//\n" #~ "// バヌゞョン 2.0 の Apache ラむセンス以䞋「本ラむセンス」により䜿甚が" #~ "蚱諟されおいたす。\n" #~ "// このファむルを䜿甚するには、本ラむセンスに準拠する必芁がありたす。\n" #~ " // 本ラむセンスのコピヌは䞋蚘のリンクから入手できたす。\n" #~ "//\n" #~ "// http://www.apache.org/licenses/LICENSE-2.0\n" #~ "//\n" #~ "// 本ラむセンスで配垃される゜フトりェアは、\n" #~ "// 適甚される法埋によっお芁求される堎合たたは曞面で合意した堎合を陀き、\n" #~ "// 明瀺されるか黙瀺されるかを問わず、いかなる皮類の保蚌も条件もなく、「珟" #~ "状有姿」で提䟛されたす。\n" #~ "// 本ラむセンスの䞋で適甚される具䜓的な蚱可および制限に぀いおは、\n" #~ "// ラむセンス本文をご芧ください。\n" #~ msgid "\"sync_exception_current\"" #~ msgstr "\"sync_exception_current\"" #~ msgid "\"irq_current\"" #~ msgstr "\"irq_current\"" #~ msgid "\"No pending interrupt\"" #~ msgstr "\"No pending interrupt\"" #~ msgid "\"IRQ {intid:?}\"" #~ msgstr "\"IRQ {intid:?}\"" #~ msgid "\"fiq_current\"" #~ msgstr "\"fiq_current\"" #~ msgid "\"serr_current\"" #~ msgstr "\"serr_current\"" #~ msgid "\"sync_lower\"" #~ msgstr "\"sync_lower\"" #~ msgid "\"irq_lower\"" #~ msgstr "\"irq_lower\"" #~ msgid "\"fiq_lower\"" #~ msgstr "\"fiq_lower\"" #~ msgid "\"serr_lower\"" #~ msgstr "\"serr_lower\"" #~ msgid "// ANCHOR: main\n" #~ msgstr "// ANCHOR: main\n" #~ msgid "// ANCHOR: Flags\n" #~ msgstr "// ANCHOR: Flags\n" #~ msgid "// ANCHOR_END: Flags\n" #~ msgstr "// ANCHOR_END: Flags\n" #~ msgid "" #~ "/// Flags from the UART Receive Status Register / Error Clear Register.\n" #~ msgstr "" #~ "/// UART 受信ステヌタス レゞスタ / ゚ラヌ クリア レゞスタからのフラグ\n" #~ msgid "/// Framing error.\n" #~ msgstr "/// フレヌム凊理゚ラヌ。\n" #~ msgid "/// Parity error.\n" #~ msgstr "/// パリティ゚ラヌ。\n" #~ msgid "/// Break error.\n" #~ msgstr "/// ブレむク゚ラヌ。\n" #~ msgid "/// Overrun error.\n" #~ msgstr "/// オヌバヌラン ゚ラヌ。\n" #~ msgid "// ANCHOR: Registers\n" #~ msgstr "// ANCHOR: Registers\n" #~ msgid "// ANCHOR_END: Registers\n" #~ msgstr "// ANCHOR_END: Registers\n" #~ msgid "" #~ "// ANCHOR: Uart\n" #~ "/// Driver for a PL011 UART.\n" #~ msgstr "" #~ "// ANCHOR: Uart\n" #~ "/// PL011 UART のドラむバ。\n" #~ msgid "" #~ "/// Constructs a new instance of the UART driver for a PL011 device at " #~ "the\n" #~ " /// given base address.\n" #~ " ///\n" #~ " /// # Safety\n" #~ " ///\n" #~ " /// The given base address must point to the MMIO control registers " #~ "of a\n" #~ " /// PL011 device, which must be mapped into the address space of the " #~ "process\n" #~ " /// as device memory and not have any other aliases.\n" #~ msgstr "" #~ "/// 指定されたベヌスアドレスに存圚する\n" #~ " /// PL011 デバむス甚の UART ドラむバの新しいむンスタンスを䜜成した" #~ "す。\n" #~ " ///\n" #~ " /// # 安党性\n" #~ " ///\n" #~ " /// 指定されたベヌスアドレスは PL011 デバむスの MMIO 制埡レゞスタを指" #~ "しおいる必芁がありたす。\n" #~ " /// これらはデバむスメモリずしおプロセスのアドレス空間に\n" #~ " /// マッピングされ、他の゚むリアスはありたせん。\n" #~ msgid "// ANCHOR_END: Uart\n" #~ msgstr "// ANCHOR_END: Uart\n" #~ msgid "\"linux\"" #~ msgstr "\"linux\"" #~ msgid "\"CROSS_COMPILE\"" #~ msgstr "\"CROSS_COMPILE\"" #~ msgid "\"aarch64-linux-gnu\"" #~ msgstr "\"aarch64-linux-gnu\"" #~ msgid "\"aarch64-none-elf\"" #~ msgstr "\"aarch64-none-elf\"" #~ msgid "\"entry.S\"" #~ msgstr "\"entry.S\"" #~ msgid "\"exceptions.S\"" #~ msgstr "\"exceptions.S\"" #~ msgid "\"idmap.S\"" #~ msgstr "\"idmap.S\"" #~ msgid "\"empty\"" #~ msgstr "\"empty\"" #~ msgid "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" #~ " * you may not use this file except in compliance with the License.\n" #~ " * You may obtain a copy of the License at\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * Unless required by applicable law or agreed to in writing, software\n" #~ " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" #~ " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or " #~ "implied.\n" #~ " * See the License for the specific language governing permissions and\n" #~ " * limitations under the License.\n" #~ " */\n" #~ "\n" #~ ".macro adr_l, reg:req, sym:req\n" #~ "\tadrp \\reg, \\sym\n" #~ "\tadd \\reg, \\reg, :lo12:\\sym\n" #~ ".endm\n" #~ "\n" #~ ".macro mov_i, reg:req, imm:req\n" #~ "\tmovz \\reg, :abs_g3:\\imm\n" #~ "\tmovk \\reg, :abs_g2_nc:\\imm\n" #~ "\tmovk \\reg, :abs_g1_nc:\\imm\n" #~ "\tmovk \\reg, :abs_g0_nc:\\imm\n" #~ ".endm\n" #~ "\n" #~ ".set .L_MAIR_DEV_nGnRE,\t0x04\n" #~ ".set .L_MAIR_MEM_WBWA,\t0xff\n" #~ ".set .Lmairval, .L_MAIR_DEV_nGnRE | (.L_MAIR_MEM_WBWA << 8)\n" #~ "\n" #~ "/* 4 KiB granule size for TTBR0_EL1. */\n" #~ ".set .L_TCR_TG0_4KB, 0x0 << 14\n" #~ "/* 4 KiB granule size for TTBR1_EL1. */\n" #~ ".set .L_TCR_TG1_4KB, 0x2 << 30\n" #~ "/* Disable translation table walk for TTBR1_EL1, generating a translation " #~ "fault instead. */\n" #~ ".set .L_TCR_EPD1, 0x1 << 23\n" #~ "/* Translation table walks for TTBR0_EL1 are inner sharable. */\n" #~ ".set .L_TCR_SH_INNER, 0x3 << 12\n" #~ "/*\n" #~ " * Translation table walks for TTBR0_EL1 are outer write-back read-" #~ "allocate write-allocate\n" #~ " * cacheable.\n" #~ " */\n" #~ ".set .L_TCR_RGN_OWB, 0x1 << 10\n" #~ "/*\n" #~ " * Translation table walks for TTBR0_EL1 are inner write-back read-" #~ "allocate write-allocate\n" #~ " * cacheable.\n" #~ " */\n" #~ ".set .L_TCR_RGN_IWB, 0x1 << 8\n" #~ "/* Size offset for TTBR0_EL1 is 2**39 bytes (512 GiB). */\n" #~ ".set .L_TCR_T0SZ_512, 64 - 39\n" #~ ".set .Ltcrval, .L_TCR_TG0_4KB | .L_TCR_TG1_4KB | .L_TCR_EPD1 | ." #~ "L_TCR_RGN_OWB\n" #~ ".set .Ltcrval, .Ltcrval | .L_TCR_RGN_IWB | .L_TCR_SH_INNER | ." #~ "L_TCR_T0SZ_512\n" #~ "\n" #~ "/* Stage 1 instruction access cacheability is unaffected. */\n" #~ ".set .L_SCTLR_ELx_I, 0x1 << 12\n" #~ "/* SP alignment fault if SP is not aligned to a 16 byte boundary. */\n" #~ ".set .L_SCTLR_ELx_SA, 0x1 << 3\n" #~ "/* Stage 1 data access cacheability is unaffected. */\n" #~ ".set .L_SCTLR_ELx_C, 0x1 << 2\n" #~ "/* EL0 and EL1 stage 1 MMU enabled. */\n" #~ ".set .L_SCTLR_ELx_M, 0x1 << 0\n" #~ "/* Privileged Access Never is unchanged on taking an exception to EL1. " #~ "*/\n" #~ ".set .L_SCTLR_EL1_SPAN, 0x1 << 23\n" #~ "/* SETEND instruction disabled at EL0 in aarch32 mode. */\n" #~ ".set .L_SCTLR_EL1_SED, 0x1 << 8\n" #~ "/* Various IT instructions are disabled at EL0 in aarch32 mode. */\n" #~ ".set .L_SCTLR_EL1_ITD, 0x1 << 7\n" #~ ".set .L_SCTLR_EL1_RES1, (0x1 << 11) | (0x1 << 20) | (0x1 << 22) | (0x1 << " #~ "28) | (0x1 << 29)\n" #~ ".set .Lsctlrval, .L_SCTLR_ELx_M | .L_SCTLR_ELx_C | .L_SCTLR_ELx_SA | ." #~ "L_SCTLR_EL1_ITD | .L_SCTLR_EL1_SED\n" #~ ".set .Lsctlrval, .Lsctlrval | .L_SCTLR_ELx_I | .L_SCTLR_EL1_SPAN | ." #~ "L_SCTLR_EL1_RES1\n" #~ "\n" #~ "/**\n" #~ " * This is a generic entry point for an image. It carries out the " #~ "operations required to prepare the\n" #~ " * loaded image to be run. Specifically, it zeroes the bss section using " #~ "registers x25 and above,\n" #~ " * prepares the stack, enables floating point, and sets up the exception " #~ "vector. It preserves x0-x3\n" #~ " * for the Rust entry point, as these may contain boot parameters.\n" #~ " */\n" #~ ".section .init.entry, \"ax\"\n" #~ ".global entry\n" #~ "entry:\n" #~ "\t/* Load and apply the memory management configuration, ready to enable " #~ "MMU and caches. */\n" #~ "\tadrp x30, idmap\n" #~ "\tmsr ttbr0_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Lmairval\n" #~ "\tmsr mair_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Ltcrval\n" #~ "\t/* Copy the supported PA range into TCR_EL1.IPS. */\n" #~ "\tmrs x29, id_aa64mmfr0_el1\n" #~ "\tbfi x30, x29, #32, #4\n" #~ "\n" #~ "\tmsr tcr_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Lsctlrval\n" #~ "\n" #~ "\t/*\n" #~ "\t * Ensure everything before this point has completed, then invalidate " #~ "any potentially stale\n" #~ "\t * local TLB entries before they start being used.\n" #~ "\t */\n" #~ "\tisb\n" #~ "\ttlbi vmalle1\n" #~ "\tic iallu\n" #~ "\tdsb nsh\n" #~ "\tisb\n" #~ "\n" #~ "\t/*\n" #~ "\t * Configure sctlr_el1 to enable MMU and cache and don't proceed until " #~ "this has completed.\n" #~ "\t */\n" #~ "\tmsr sctlr_el1, x30\n" #~ "\tisb\n" #~ "\n" #~ "\t/* Disable trapping floating point access in EL1. */\n" #~ "\tmrs x30, cpacr_el1\n" #~ "\torr x30, x30, #(0x3 << 20)\n" #~ "\tmsr cpacr_el1, x30\n" #~ "\tisb\n" #~ "\n" #~ "\t/* Zero out the bss section. */\n" #~ "\tadr_l x29, bss_begin\n" #~ "\tadr_l x30, bss_end\n" #~ "0:\tcmp x29, x30\n" #~ "\tb.hs 1f\n" #~ "\tstp xzr, xzr, [x29], #16\n" #~ "\tb 0b\n" #~ "\n" #~ "1:\t/* Prepare the stack. */\n" #~ "\tadr_l x30, boot_stack_end\n" #~ "\tmov sp, x30\n" #~ "\n" #~ "\t/* Set up exception vector. */\n" #~ "\tadr x30, vector_table_el1\n" #~ "\tmsr vbar_el1, x30\n" #~ "\n" #~ "\t/* Call into Rust code. */\n" #~ "\tbl main\n" #~ "\n" #~ "\t/* Loop forever waiting for interrupts. */\n" #~ "2:\twfi\n" #~ "\tb 2b\n" #~ "```" #~ msgstr "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * バヌゞョン 2.0 の Apache ラむセンス以䞋「本ラむセンス」により䜿甚が" #~ "蚱諟されおいたす。\n" #~ " * このファむルを䜿甚するには、本ラむセンスに準拠する必芁がありたす。\n" #~ " * 本ラむセンスのコピヌは䞋蚘のリンクから入手できたす。\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * 本ラむセンスで配垃される゜フトりェアは、\n" #~ " * 適甚される法埋によっお芁求される堎合たたは曞面で合意した堎合を陀き、\n" #~ " * 明瀺されるか黙瀺されるかを問わず、いかなる皮類の保蚌も条件もなく、「珟" #~ "状有姿」で提䟛されたす。\n" #~ " * 本ラむセンスの䞋で適甚される具䜓的な蚱可および制限に぀いおは、\n" #~ " * ラむセンス本文をご芧ください。\n" #~ " */\n" #~ "\n" #~ ".macro adr_l, reg:req, sym:req\n" #~ "\tadrp \\reg, \\sym\n" #~ "\tadd \\reg, \\reg, :lo12:\\sym\n" #~ ".endm\n" #~ "\n" #~ ".macro mov_i, reg:req, imm:req\n" #~ "\tmovz \\reg, :abs_g3:\\imm\n" #~ "\tmovk \\reg, :abs_g2_nc:\\imm\n" #~ "\tmovk \\reg, :abs_g1_nc:\\imm\n" #~ "\tmovk \\reg, :abs_g0_nc:\\imm\n" #~ ".endm\n" #~ "\n" #~ ".set .L_MAIR_DEV_nGnRE,\t0x04\n" #~ ".set .L_MAIR_MEM_WBWA,\t0xff\n" #~ ".set .Lmairval, .L_MAIR_DEV_nGnRE | (.L_MAIR_MEM_WBWA << 8)\n" #~ "\n" #~ "/* TTBR0_EL1におけるペヌゞサむズを4KiB単䜍に蚭定。*/\n" #~ ".set .L_TCR_TG0_4KB, 0x0 << 14\n" #~ "/* TTBR1_EL1におけるペヌゞサむズを4KiB単䜍に蚭定。*/\n" #~ ".set .L_TCR_TG1_4KB, 0x2 << 30\n" #~ "/* TTBR1_EL1 の倉換テヌブル りォヌクを無効にしお、代わりに倉換゚ラヌを生成" #~ "したす。*/\n" #~ ".set .L_TCR_EPD1, 0x1 << 23\n" #~ "/* TTBR0_EL1 の倉換テヌブル りォヌクは内郚共有可胜です。*/\n" #~ ".set .L_TCR_SH_INNER, 0x3 << 12\n" #~ "/*\n" #~ " * TTBR0_EL1 の倉換テヌブル りォヌクは、倖郚曞き戻し、読み取り割り圓お、曞" #~ "き蟌み割り圓おの\n" #~ " * キャッシュが可胜です。\n" #~ " */\n" #~ ".set . L_TCR_RGN_OWB, 0x1 << 10\n" #~ "/*\n" #~ " * TTBR0_EL1 の倉換テヌブル りォヌクは、内郚曞き戻し、読み取り割り圓お、曞" #~ "き蟌み割り圓おの\n" #~ " * キャッシュが可胜です。\n" #~ " */\n" #~ ".set .L_TCR_RGN_IWB, 0x1 << 8\n" #~ "/* TTBR0_EL1 のサむズ オフセットは 2**39 バむト512 GiBです。*/\n" #~ ".set .L_TCR_T0SZ_512, 64 - 39\n" #~ ".set .Ltcrval, .L_TCR_TG0_4KB | .L_TCR_TG1_4KB | .L_TCR_EPD1 | ." #~ "L_TCR_RGN_OWB\n" #~ ".set .Ltcrval, .Ltcrval | .L_TCR_RGN_IWB | .L_TCR_SH_INNER | ." #~ "L_TCR_T0SZ_512\n" #~ "\n" #~ "/* ステヌゞ 1 の呜什アクセスのキャッシュ可胜蚭定は圱響を受けたせん。*/\n" #~ ".set .L_SCTLR_ELx_I, 0x1 << 12\n" #~ "/* SP が 16 バむト境界にアラむメントされおいない堎合の SP アラむメント " #~ "フォヌルト。*/\n" #~ ".set .L_SCTLR_ELx_SA, 0x1 << 3\n" #~ "/* ステヌゞ 1 のデヌタアクセスのキャッシュ可胜性蚭定は圱響を受けたせん。" #~ "*/\n" #~ ".set .L_SCTLR_ELx_C, 0x1 << 2\n" #~ "/* EL0 および EL1 ステヌゞ 1 MMU が有効になっおいたす。*/\n" #~ ".set .L_SCTLR_ELx_M, 0x1 << 0\n" #~ "/* EL1 の䟋倖を受け取っおも、特暩アクセスは倉曎されたせん。*/\n" #~ ".set .L_SCTLR_EL1_SPAN, 0x1 << 23\n" #~ "/* aarch32 モヌドの EL0 で SETEND 呜什が無効になっおいたす。*/\n" #~ ".set .L_SCTLR_EL1_SED, 0x1 << 8\n" #~ "/* さたざたな IT 呜什が aarch32 モヌドの EL0 で無効になっおいたす。*/\n" #~ ".set .L_SCTLR_EL1_ITD, 0x1 << 7\n" #~ ".set .L_SCTLR_EL1_RES1, (0x1 << 11) | (0x1 << 20) | (0x1 << 22) | (0x1 << " #~ "28) | (0x1 << 29)\n" #~ ".set .Lsctlrval, .L_SCTLR_ELx_M | .L_SCTLR_ELx_C | .L_SCTLR_ELx_SA | ." #~ "L_SCTLR_EL1_ITD | .L_SCTLR_EL1_SED\n" #~ ".set .Lsctlrval, .Lsctlrval | .L_SCTLR_ELx_I | .L_SCTLR_EL1_SPAN | ." #~ "L_SCTLR_EL1_RES1\n" #~ "\n" #~ "/**\n" #~ " * これはむメヌゞの䞀般的な゚ントリ ポむントです。読み蟌たれたむメヌゞの実" #~ "行を\n" #~ " * 準備するために必芁なオペレヌションを実行したす。具䜓的には、x25 以䞊の" #~ "レゞスタを䜿甚しお bss セクションをれロにし、\n" #~ " * スタックを準備し、浮動小数点数を有効にしお、䟋倖ベクタヌを蚭定したす。" #~ "Rust ゚ントリ ポむントのために x0-x3\n" #~ " * には䞋の倀を保持したす。これは起動パラメヌタを含む可胜性があるためで" #~ "す。\n" #~ " */\n" #~ ".section .init.entry, \"ax\"\n" #~ ".global entry\n" #~ "entry:\n" #~ "\t/* メモリ管理に関する蚭定を読み蟌んで適甚し、MMU ずキャッシュを有効にす" #~ "る準備をしたす。*/\n" #~ "\tadrp x30, idmap\n" #~ "\tmsr ttbr0_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Lmairval\n" #~ "\tmsr mair_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Ltcrval\n" #~ "\t/* サポヌトしおいる PA 範囲を TCR_EL1.IPS にコピヌしたす。*/\n" #~ "\tmrs x29, id_aa64mmfr0_el1\n" #~ "\tbfi x30, x29, #32, #4\n" #~ "\n" #~ "\tmsr tcr_el1, x30\n" #~ "\n" #~ "\tmov_i x30, .Lsctlrval\n" #~ "\n" #~ "\t/*\n" #~ "\t * ここより前のすべおの凊理が完了しおいるこずを確認しおから、\n" #~ "\t * 叀くなった可胜性のあるロヌカル TLB ゚ントリを䜿甚開始前に無効にした" #~ "す。\n" #~ "\t */\n" #~ "\tisb\n" #~ "\ttlbi vmalle1\n" #~ "\tic iallu\n" #~ "\tdsb nsh\n" #~ "\tisb\n" #~ "\n" #~ "\t/*\n" #~ "\t * MMU ずキャッシュを有効にするように sctlr_el1 を構成し、これが完了する" #~ "たでは先に進みたせん。\n" #~ "\t */\n" #~ "\tmsr sctlr_el1, x30\n" #~ "\tisb\n" #~ "\n" #~ "\t/* EL1 の浮動小数点アクセスのトラップを無効にしたす。*/\n" #~ "\tmrs x30, cpacr_el1\n" #~ "\torr x30, x30, #(0x3 << 20)\n" #~ "\tmsr cpacr_el1, x30\n" #~ "\tisb\n" #~ "\n" #~ "\t/* bss セクションをれロにしたす。*/\n" #~ "\tadr_l x29, bss_begin\n" #~ "\tadr_l x30, bss_end\n" #~ "0:\tcmp x29, x30\n" #~ "\tb.hs 1f\n" #~ "\tstp xzr, xzr, [x29], #16\n" #~ "\tb 0b\n" #~ "\n" #~ "1:\t/* スタックを準備したす。*/\n" #~ "\tadr_l x30, boot_stack_end\n" #~ "\tmov sp, x30\n" #~ "\n" #~ "\t/* 䟋倖ベクタヌを蚭定したす。*/\n" #~ "\tadr x30, vector_table_el1\n" #~ "\tmsr vbar_el1, x30\n" #~ "\n" #~ "\t/* Rust コヌドを呌び出したす。*/\n" #~ "\tbl main\n" #~ "\n" #~ "\t/* 割り蟌みを埅機しお氞久にルヌプしたす。*/\n" #~ "2:\twfi\n" #~ "\tb 2b\n" #~ "```" #~ msgid "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" #~ " * you may not use this file except in compliance with the License.\n" #~ " * You may obtain a copy of the License at\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * Unless required by applicable law or agreed to in writing, software\n" #~ " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" #~ " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or " #~ "implied.\n" #~ " * See the License for the specific language governing permissions and\n" #~ " * limitations under the License.\n" #~ " */\n" #~ "\n" #~ "/**\n" #~ " * Saves the volatile registers onto the stack. This currently takes 14\n" #~ " * instructions, so it can be used in exception handlers with 18 " #~ "instructions\n" #~ " * left.\n" #~ " *\n" #~ " * On return, x0 and x1 are initialised to elr_el2 and spsr_el2 " #~ "respectively,\n" #~ " * which can be used as the first and second arguments of a subsequent " #~ "call.\n" #~ " */\n" #~ ".macro save_volatile_to_stack\n" #~ "\t/* Reserve stack space and save registers x0-x18, x29 & x30. */\n" #~ "\tstp x0, x1, [sp, #-(8 * 24)]!\n" #~ "\tstp x2, x3, [sp, #8 * 2]\n" #~ "\tstp x4, x5, [sp, #8 * 4]\n" #~ "\tstp x6, x7, [sp, #8 * 6]\n" #~ "\tstp x8, x9, [sp, #8 * 8]\n" #~ "\tstp x10, x11, [sp, #8 * 10]\n" #~ "\tstp x12, x13, [sp, #8 * 12]\n" #~ "\tstp x14, x15, [sp, #8 * 14]\n" #~ "\tstp x16, x17, [sp, #8 * 16]\n" #~ "\tstr x18, [sp, #8 * 18]\n" #~ "\tstp x29, x30, [sp, #8 * 20]\n" #~ "\n" #~ "\t/*\n" #~ "\t * Save elr_el1 & spsr_el1. This such that we can take nested " #~ "exception\n" #~ "\t * and still be able to unwind.\n" #~ "\t */\n" #~ "\tmrs x0, elr_el1\n" #~ "\tmrs x1, spsr_el1\n" #~ "\tstp x0, x1, [sp, #8 * 22]\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * Restores the volatile registers from the stack. This currently takes " #~ "14\n" #~ " * instructions, so it can be used in exception handlers while still " #~ "leaving 18\n" #~ " * instructions left; if paired with save_volatile_to_stack, there are 4\n" #~ " * instructions to spare.\n" #~ " */\n" #~ ".macro restore_volatile_from_stack\n" #~ "\t/* Restore registers x2-x18, x29 & x30. */\n" #~ "\tldp x2, x3, [sp, #8 * 2]\n" #~ "\tldp x4, x5, [sp, #8 * 4]\n" #~ "\tldp x6, x7, [sp, #8 * 6]\n" #~ "\tldp x8, x9, [sp, #8 * 8]\n" #~ "\tldp x10, x11, [sp, #8 * 10]\n" #~ "\tldp x12, x13, [sp, #8 * 12]\n" #~ "\tldp x14, x15, [sp, #8 * 14]\n" #~ "\tldp x16, x17, [sp, #8 * 16]\n" #~ "\tldr x18, [sp, #8 * 18]\n" #~ "\tldp x29, x30, [sp, #8 * 20]\n" #~ "\n" #~ "\t/* Restore registers elr_el1 & spsr_el1, using x0 & x1 as scratch. */\n" #~ "\tldp x0, x1, [sp, #8 * 22]\n" #~ "\tmsr elr_el1, x0\n" #~ "\tmsr spsr_el1, x1\n" #~ "\n" #~ "\t/* Restore x0 & x1, and release stack space. */\n" #~ "\tldp x0, x1, [sp], #8 * 24\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * This is a generic handler for exceptions taken at the current EL while " #~ "using\n" #~ " * SP0. It behaves similarly to the SPx case by first switching to SPx, " #~ "doing\n" #~ " * the work, then switching back to SP0 before returning.\n" #~ " *\n" #~ " * Switching to SPx and calling the Rust handler takes 16 instructions. " #~ "To\n" #~ " * restore and return we need an additional 16 instructions, so we can " #~ "implement\n" #~ " * the whole handler within the allotted 32 instructions.\n" #~ " */\n" #~ ".macro current_exception_sp0 handler:req\n" #~ "\tmsr spsel, #1\n" #~ "\tsave_volatile_to_stack\n" #~ "\tbl \\handler\n" #~ "\trestore_volatile_from_stack\n" #~ "\tmsr spsel, #0\n" #~ "\teret\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * This is a generic handler for exceptions taken at the current EL while " #~ "using\n" #~ " * SPx. It saves volatile registers, calls the Rust handler, restores " #~ "volatile\n" #~ " * registers, then returns.\n" #~ " *\n" #~ " * This also works for exceptions taken from EL0, if we don't care about\n" #~ " * non-volatile registers.\n" #~ " *\n" #~ " * Saving state and jumping to the Rust handler takes 15 instructions, " #~ "and\n" #~ " * restoring and returning also takes 15 instructions, so we can fit the " #~ "whole\n" #~ " * handler in 30 instructions, under the limit of 32.\n" #~ " */\n" #~ ".macro current_exception_spx handler:req\n" #~ "\tsave_volatile_to_stack\n" #~ "\tbl \\handler\n" #~ "\trestore_volatile_from_stack\n" #~ "\teret\n" #~ ".endm\n" #~ "\n" #~ ".section .text.vector_table_el1, \"ax\"\n" #~ ".global vector_table_el1\n" #~ ".balign 0x800\n" #~ "vector_table_el1:\n" #~ "sync_cur_sp0:\n" #~ "\tcurrent_exception_sp0 sync_exception_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_cur_sp0:\n" #~ "\tcurrent_exception_sp0 irq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_cur_sp0:\n" #~ "\tcurrent_exception_sp0 fiq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_cur_sp0:\n" #~ "\tcurrent_exception_sp0 serr_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_cur_spx:\n" #~ "\tcurrent_exception_spx sync_exception_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_cur_spx:\n" #~ "\tcurrent_exception_spx irq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_cur_spx:\n" #~ "\tcurrent_exception_spx fiq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_cur_spx:\n" #~ "\tcurrent_exception_spx serr_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_lower_64:\n" #~ "\tcurrent_exception_spx sync_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_lower_64:\n" #~ "\tcurrent_exception_spx irq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_lower_64:\n" #~ "\tcurrent_exception_spx fiq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_lower_64:\n" #~ "\tcurrent_exception_spx serr_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_lower_32:\n" #~ "\tcurrent_exception_spx sync_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_lower_32:\n" #~ "\tcurrent_exception_spx irq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_lower_32:\n" #~ "\tcurrent_exception_spx fiq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_lower_32:\n" #~ "\tcurrent_exception_spx serr_lower\n" #~ "```" #~ msgstr "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * バヌゞョン 2.0 の Apache ラむセンス以䞋「本ラむセンス」により䜿甚が" #~ "蚱諟されおいたす。\n" #~ " * このファむルを䜿甚するには、本ラむセンスに準拠する必芁がありたす。\n" #~ " * 本ラむセンスのコピヌは䞋蚘のリンクから入手できたす。\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * 本ラむセンスで配垃される゜フトりェアは、\n" #~ " * 適甚される法埋によっお芁求される堎合たたは曞面で合意した堎合を陀き、\n" #~ " * 明瀺されるか黙瀺されるかを問わず、いかなる皮類の保蚌も条件もなく、「珟" #~ "状有姿」で提䟛されたす。\n" #~ " * 本ラむセンスの䞋で適甚される具䜓的な蚱可および制限に぀いおは、\n" #~ " * ラむセンス本文をご芧ください。\n" #~ " */\n" #~ "\n" #~ "/**\n" #~ " * 揮発性レゞスタをスタックに保存したす。この郚分は珟圚 14 個の\n" #~ " * 呜什で構成されおいるので、䟋倖ハンドラで\n" #~ " * 䜿甚できたす。その堎合、残りは18呜什分になりたす。\n" #~ " *\n" #~ " * 戻った際に、x0 ず x1 はそれぞれ elr_el2 ず spsr_el2 に初期化され、\n" #~ " * これらは埌続の呌び出しの 1 ぀目ず 2 ぀目の匕数ずしお䜿甚できたす。\n" #~ " */\n" #~ ".macro save_volatile_to_stack\n" #~ "\t/* スタック空間を予玄し、レゞスタ x0x18、x29、x30 を保存したす。*/\n" #~ "\tstp x0, x1, [sp, #-(8 * 24)]!\n" #~ "\tstp x2, x3, [sp, #8 * 2]\n" #~ "\tstp x4, x5, [sp, #8 * 4]\n" #~ "\tstp x6, x7, [sp, #8 * 6]\n" #~ "\tstp x8, x9, [sp, #8 * 8]\n" #~ "\tstp x10, x11, [sp, #8 * 10]\n" #~ "\tstp x12, x13, [sp, #8 * 12]\n" #~ "\tstp x14, x15, [sp, #8 * 14]\n" #~ "\tstp x16, x17, [sp, #8 * 16]\n" #~ "\tstr x18, [sp, #8 * 18]\n" #~ "\tstp x29, x30, [sp, #8 * 20]\n" #~ "\n" #~ "\t/*\n" #~ "\t * elr_el1 ず spsr_el1 を保存したす。これにより、ネストされた䟋倖を受付" #~ "可胜になり、\n" #~ "\t * たた、アンワむンドできるようになりたす。\n" #~ "\t */\n" #~ "\tmrs x0, elr_el1\n" #~ "\tmrs x1, spsr_el1\n" #~ "\tstp x0, x1, [sp, #8 * 22]\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * スタックから揮発性レゞスタを埩元したす。この郚分は珟圚14 個の\n" #~ " * 呜什で構成されおいるので、\n" #~ " * 䟋倖ハンドラで䜿甚できたす。たた、その堎合18呜什分の領域が残りたす。" #~ "save_volatile_to_stack ず組み合わせた堎合、\n" #~ " * 4 個の呜什が残りたす。\n" #~ " */\n" #~ ".macro restore_volatile_from_stack\n" #~ "\t/* レゞスタ x2x18、x29、x30 を埩元したす。*/\n" #~ "\tldp x2, x3, [sp, #8 * 2]\n" #~ "\tldp x4, x5, [sp, #8 * 4]\n" #~ "\tldp x6, x7, [sp, #8 * 6]\n" #~ "\tldp x8, x9, [sp, #8 * 8]\n" #~ "\tldp x10, x11, [sp, #8 * 10]\n" #~ "\tldp x12, x13, [sp, #8 * 12]\n" #~ "\tldp x14, x15, [sp, #8 * 14]\n" #~ "\tldp x16, x17, [sp, #8 * 16]\n" #~ "\tldr x18, [sp, #8 * 18]\n" #~ "\tldp x29, x30, [sp, #8 * 20]\n" #~ "\n" #~ "\t/* x0 ず x1 をスクラッチずしお䜿甚しお、レゞスタ elr_el1 および " #~ "spsr_el1 を埩元したす。*/\n" #~ "\tldp x0, x1, [sp, #8 * 22]\n" #~ "\tmsr elr_el1, x0\n" #~ "\tmsr spsr_el1, x1\n" #~ "\n" #~ "\t/* x0 ず x1 を埩元し、スタック空間を解攟したす。*/\n" #~ "\tldp x0, x1, [sp], #8 * 24\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * これは、SP0 の䜿甚䞭に珟圚の EL で取埗される䟋倖の\n" #~ " * 汎甚ハンドラです。SPx の堎合ず同様に、最初に SPx に切り替えお凊理を実行" #~ "し、\n" #~ " * 戻る前に再床 SP0 に切り替えたす。\n" #~ " *\n" #~ " * SPx に切り替えお Rust ハンドラを呌び出すには、16 個の呜什が必芁です。埩" #~ "元しお戻るには、\n" #~ " * さらに 16 個の呜什が必芁であるため、割り圓おられた 32 個の呜什の䞭で\n" #~ " * ハンドラ党䜓を実装できたす。\n" #~ " */\n" #~ ".macro current_exception_sp0 handler:req\n" #~ "\tmsr spsel, #1\n" #~ "\tsave_volatile_to_stack\n" #~ "\tbl \\handler\n" #~ "\trestore_volatile_from_stack\n" #~ "\tmsr spsel, #0\n" #~ "\teret\n" #~ ".endm\n" #~ "\n" #~ "/**\n" #~ " * これは、\n" #~ " * SPx の䜿甚䞭に珟圚の EL で受け付けた䟋倖の汎甚ハンドラです。揮発性レゞ" #~ "スタを保存し、Rust ハンドラを呌び出し、揮発性レゞスタを\n" #~ " * しおから戻りたす。\n" #~ " *\n" #~ " * 䞍揮発性レゞスタを考慮しなければ、EL0 から取埗した䟋倖に察しおも\n" #~ " * 機胜したす。\n" #~ " *\n" #~ " * 状態の保存ず Rust ハンドラぞのゞャンプには 15 個の呜什が必芁で、\n" #~ " * 埩元しお戻るのにも 15 個の呜什が必芁であるため、\n" #~ " * ハンドラ党䜓を 32 個の制限内である 30 個の呜什に収めるこずができた" #~ "す。\n" #~ " */\n" #~ ".macro current_exception_spx handler:req\n" #~ "\tsave_volatile_to_stack\n" #~ "\tbl \\handler\n" #~ "\trestore_volatile_from_stack\n" #~ "\teret\n" #~ ".endm\n" #~ "\n" #~ ".section .text.vector_table_el1, \"ax\"\n" #~ ".global vector_table_el1\n" #~ ".balign 0x800\n" #~ "vector_table_el1:\n" #~ "sync_cur_sp0:\n" #~ "\tcurrent_exception_sp0 sync_exception_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_cur_sp0:\n" #~ "\tcurrent_exception_sp0 irq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_cur_sp0:\n" #~ "\tcurrent_exception_sp0 fiq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_cur_sp0:\n" #~ "\tcurrent_exception_sp0 serr_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_cur_spx:\n" #~ "\tcurrent_exception_spx sync_exception_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_cur_spx:\n" #~ "\tcurrent_exception_spx irq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_cur_spx:\n" #~ "\tcurrent_exception_spx fiq_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_cur_spx:\n" #~ "\tcurrent_exception_spx serr_current\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_lower_64:\n" #~ "\tcurrent_exception_spx sync_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_lower_64:\n" #~ "\tcurrent_exception_spx irq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_lower_64:\n" #~ "\tcurrent_exception_spx fiq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_lower_64:\n" #~ "\tcurrent_exception_spx serr_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "sync_lower_32:\n" #~ "\tcurrent_exception_spx sync_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "irq_lower_32:\n" #~ "\tcurrent_exception_spx irq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "fiq_lower_32:\n" #~ "\tcurrent_exception_spx fiq_lower\n" #~ "\n" #~ ".balign 0x80\n" #~ "serr_lower_32:\n" #~ "\tcurrent_exception_spx serr_lower\n" #~ "```" #~ msgid "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" #~ " * you may not use this file except in compliance with the License.\n" #~ " * You may obtain a copy of the License at\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * Unless required by applicable law or agreed to in writing, software\n" #~ " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" #~ " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or " #~ "implied.\n" #~ " * See the License for the specific language governing permissions and\n" #~ " * limitations under the License.\n" #~ " */\n" #~ "\n" #~ ".set .L_TT_TYPE_BLOCK, 0x1\n" #~ ".set .L_TT_TYPE_PAGE, 0x3\n" #~ ".set .L_TT_TYPE_TABLE, 0x3\n" #~ "\n" #~ "/* Access flag. */\n" #~ ".set .L_TT_AF, 0x1 << 10\n" #~ "/* Not global. */\n" #~ ".set .L_TT_NG, 0x1 << 11\n" #~ ".set .L_TT_XN, 0x3 << 53\n" #~ "\n" #~ ".set .L_TT_MT_DEV, 0x0 << 2\t\t\t// MAIR #0 (DEV_nGnRE)\n" #~ ".set .L_TT_MT_MEM, (0x1 << 2) | (0x3 << 8)\t// MAIR #1 (MEM_WBWA), inner " #~ "shareable\n" #~ "\n" #~ ".set .L_BLOCK_DEV, .L_TT_TYPE_BLOCK | .L_TT_MT_DEV | .L_TT_AF | .L_TT_XN\n" #~ ".set .L_BLOCK_MEM, .L_TT_TYPE_BLOCK | .L_TT_MT_MEM | .L_TT_AF | .L_TT_NG\n" #~ "\n" #~ ".section \".rodata.idmap\", \"a\", %progbits\n" #~ ".global idmap\n" #~ ".align 12\n" #~ "idmap:\n" #~ "\t/* level 1 */\n" #~ "\t.quad\t\t.L_BLOCK_DEV | 0x0\t\t // 1 GiB of device mappings\n" #~ "\t.quad\t\t.L_BLOCK_MEM | 0x40000000\t// 1 GiB of DRAM\n" #~ "\t.fill\t\t254, 8, 0x0\t\t\t// 254 GiB of unmapped VA space\n" #~ "\t.quad\t\t.L_BLOCK_DEV | 0x4000000000 // 1 GiB of device mappings\n" #~ "\t.fill\t\t255, 8, 0x0\t\t\t// 255 GiB of remaining VA space\n" #~ "```" #~ msgstr "" #~ "```armasm\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * バヌゞョン 2.0 の Apache ラむセンス以䞋「本ラむセンス」により䜿甚が" #~ "蚱諟されおいたす。\n" #~ " * このファむルを䜿甚するには、本ラむセンスに準拠する必芁がありたす。\n" #~ " * 本ラむセンスのコピヌは䞋蚘のリンクから入手できたす。\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * 本ラむセンスで配垃される゜フトりェアは、\n" #~ " * 適甚される法埋によっお芁求される堎合たたは曞面で合意した堎合を陀き、\n" #~ " * 明瀺されるか黙瀺されるかを問わず、いかなる皮類の保蚌も条件もなく、「珟" #~ "状有姿」で提䟛されたす。\n" #~ " * 本ラむセンスの䞋で適甚される具䜓的な蚱可および制限に぀いおは、\n" #~ " * ラむセンス本文をご芧ください。\n" #~ " */\n" #~ "\n" #~ ".set .L_TT_TYPE_BLOCK, 0x1\n" #~ ".set .L_TT_TYPE_PAGE, 0x3\n" #~ ".set .L_TT_TYPE_TABLE, 0x3\n" #~ "\n" #~ "/* アクセスフラグ。*/\n" #~ ".set .L_TT_AF, 0x1 << 10\n" #~ "/* グロヌバルではありたせん。*/\n" #~ ".set .L_TT_NG, 0x1 << 11\n" #~ ".set .L_TT_XN, 0x3 << 53\n" #~ "\n" #~ ".set .L_TT_MT_DEV, 0x0 << 2\t\t\t// MAIR #0 (DEV_nGnRE)\n" #~ ".set .L_TT_MT_MEM, (0x1 << 2) | (0x3 << 8)\t// MAIR #1 (MEM_WBWA)、内郚共" #~ "有可胜\n" #~ "\n" #~ ".set .L_BLOCK_DEV, .L_TT_TYPE_BLOCK | .L_TT_MT_DEV | .L_TT_AF | .L_TT_XN\n" #~ ".set .L_BLOCK_MEM, .L_TT_TYPE_BLOCK | .L_TT_MT_MEM | .L_TT_AF | .L_TT_NG\n" #~ "\n" #~ ".section \".rodata.idmap\", \"a\", %progbits\n" #~ ".global idmap\n" #~ ".align 12\n" #~ "idmap:\n" #~ "\t/* レベル 1 */\n" #~ "\t.quad\t\t.L_BLOCK_DEV | 0x0\t\t // 1 GiB のデバむス マッピング\n" #~ "\t.quad\t\t.L_BLOCK_MEM | 0x40000000\t// 1 GiB の DRAM\n" #~ "\t.fill\t\t254, 8, 0x0\t\t\t// 254 GiB のマッピングされおいない VA 空間\n" #~ "\t.quad\t\t.L_BLOCK_DEV | 0x4000000000 // 1 GiB のデバむス マッピング\n" #~ "\t.fill\t\t255, 8, 0x0\t\t\t// 255 GiB の残りの VA 空間\n" #~ "```" #~ msgid "" #~ "```ld\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * Licensed under the Apache License, Version 2.0 (the \"License\");\n" #~ " * you may not use this file except in compliance with the License.\n" #~ " * You may obtain a copy of the License at\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * Unless required by applicable law or agreed to in writing, software\n" #~ " * distributed under the License is distributed on an \"AS IS\" BASIS,\n" #~ " * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or " #~ "implied.\n" #~ " * See the License for the specific language governing permissions and\n" #~ " * limitations under the License.\n" #~ " */\n" #~ "\n" #~ "/*\n" #~ " * Code will start running at this symbol which is placed at the start of " #~ "the\n" #~ " * image.\n" #~ " */\n" #~ "ENTRY(entry)\n" #~ "\n" #~ "MEMORY\n" #~ "{\n" #~ "\timage : ORIGIN = 0x40080000, LENGTH = 2M\n" #~ "}\n" #~ "\n" #~ "SECTIONS\n" #~ "{\n" #~ "\t/*\n" #~ "\t * Collect together the code.\n" #~ "\t */\n" #~ "\t.init : ALIGN(4096) {\n" #~ "\t\ttext_begin = .;\n" #~ "\t\t*(.init.entry)\n" #~ "\t\t*(.init.*)\n" #~ "\t} >image\n" #~ "\t.text : {\n" #~ "\t\t*(.text.*)\n" #~ "\t} >image\n" #~ "\ttext_end = .;\n" #~ "\n" #~ "\t/*\n" #~ "\t * Collect together read-only data.\n" #~ "\t */\n" #~ "\t.rodata : ALIGN(4096) {\n" #~ "\t\trodata_begin = .;\n" #~ "\t\t*(.rodata.*)\n" #~ "\t} >image\n" #~ "\t.got : {\n" #~ "\t\t*(.got)\n" #~ "\t} >image\n" #~ "\trodata_end = .;\n" #~ "\n" #~ "\t/*\n" #~ "\t * Collect together the read-write data including .bss at the end " #~ "which\n" #~ "\t * will be zero'd by the entry code.\n" #~ "\t */\n" #~ "\t.data : ALIGN(4096) {\n" #~ "\t\tdata_begin = .;\n" #~ "\t\t*(.data.*)\n" #~ "\t\t/*\n" #~ "\t\t * The entry point code assumes that .data is a multiple of 32\n" #~ "\t\t * bytes long.\n" #~ "\t\t */\n" #~ "\t\t. = ALIGN(32);\n" #~ "\t\tdata_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t/* Everything beyond this point will not be included in the binary. */\n" #~ "\tbin_end = .;\n" #~ "\n" #~ "\t/* The entry point code assumes that .bss is 16-byte aligned. */\n" #~ "\t.bss : ALIGN(16) {\n" #~ "\t\tbss_begin = .;\n" #~ "\t\t*(.bss.*)\n" #~ "\t\t*(COMMON)\n" #~ "\t\t. = ALIGN(16);\n" #~ "\t\tbss_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t.stack (NOLOAD) : ALIGN(4096) {\n" #~ "\t\tboot_stack_begin = .;\n" #~ "\t\t. += 40 * 4096;\n" #~ "\t\t. = ALIGN(4096);\n" #~ "\t\tboot_stack_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t. = ALIGN(4K);\n" #~ "\tPROVIDE(dma_region = .);\n" #~ "\n" #~ "\t/*\n" #~ "\t * Remove unused sections from the image.\n" #~ "\t */\n" #~ "\t/DISCARD/ : {\n" #~ "\t\t/* The image loads itself so doesn't need these sections. */\n" #~ "\t\t*(.gnu.hash)\n" #~ "\t\t*(.hash)\n" #~ "\t\t*(.interp)\n" #~ "\t\t*(.eh_frame_hdr)\n" #~ "\t\t*(.eh_frame)\n" #~ "\t\t*(.note.gnu.build-id)\n" #~ "\t}\n" #~ "}\n" #~ "```" #~ msgstr "" #~ "```ld\n" #~ "/*\n" #~ " * Copyright 2023 Google LLC\n" #~ " *\n" #~ " * バヌゞョン 2.0 の Apache ラむセンス以䞋「本ラむセンス」により䜿甚が" #~ "蚱諟されおいたす。\n" #~ " * このファむルを䜿甚するには、本ラむセンスに準拠する必芁がありたす。\n" #~ " * 本ラむセンスのコピヌは䞋蚘のリンクから入手できたす。\n" #~ " *\n" #~ " * https://www.apache.org/licenses/LICENSE-2.0\n" #~ " *\n" #~ " * 本ラむセンスで配垃される゜フトりェアは、\n" #~ " * 適甚される法埋によっお芁求される堎合たたは曞面で合意した堎合を陀き、\n" #~ " * 明瀺されるか黙瀺されるかを問わず、いかなる皮類の保蚌も条件もなく、「珟" #~ "状有姿」で提䟛されたす。\n" #~ " * 本ラむセンスの䞋で適甚される具䜓的な蚱可および制限に぀いおは、\n" #~ " * ラむセンス本文をご芧ください。\n" #~ " */\n" #~ "\n" #~ "/*\n" #~ " * コヌドの実行は、むメヌゞの先頭にあるこのシンボルから\n" #~ " * 開始されたす。\n" #~ " */\n" #~ "ENTRY(entry)\n" #~ "\n" #~ "MEMORY\n" #~ "{\n" #~ "\timage : ORIGIN = 0x40080000, LENGTH = 2M\n" #~ "}\n" #~ "\n" #~ "SECTIONS\n" #~ "{\n" #~ "\t/*\n" #~ "\t * コヌドを集玄したす\n" #~ "\t */\n" #~ "\t.init : ALIGN(4096) {\n" #~ "\t\ttext_begin = .;\n" #~ "\t\t*(.init.entry)\n" #~ "\t\t*(.init.*)\n" #~ "\t} >image\n" #~ "\t.text : {\n" #~ "\t\t*(.text.*)\n" #~ "\t} >image\n" #~ "\ttext_end = .;\n" #~ "\n" #~ "\t/*\n" #~ "\t * 読み取り専甚デヌタを集玄したす。\n" #~ "\t */\n" #~ "\t.rodata : ALIGN(4096) {\n" #~ "\t\trodata_begin = .;\n" #~ "\t\t*(.rodata.*)\n" #~ "\t} >image\n" #~ "\t.got : {\n" #~ "\t\t*(.got)\n" #~ "\t} >image\n" #~ "\trodata_end = .;\n" #~ "\n" #~ "\t/*\n" #~ "\t * ゚ントリコヌドによっおれロ初期化される.bssを末尟に含む、曞き蟌み可胜" #~ "デヌタを集玄したす。\n" #~ "\t */\n" #~ "\t.data : ALIGN(4096) {\n" #~ "\t\tdata_begin = .;\n" #~ "\t\t*(.data.*)\n" #~ "\t\t/*\n" #~ "\t\t * この゚ントリポむントは.dataの倧きさが32バむトの倍数になっおいるこず" #~ "を前提ずしおいたす。\n" #~ "\t\t */\n" #~ "\t\t. = ALIGN(32);\n" #~ "\t\tdata_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t/* これ以降はすべおバむナリに含たれたせん。*/\n" #~ "\tbin_end = .;\n" #~ "\n" #~ "\t/* この゚ントリ ポむント コヌドは、.bss が 16 バむトでアラむンされおいる" #~ "こずを前提ずしおいたす。*/\n" #~ "\t.bss : ALIGN(16) {\n" #~ "\t\tbss_begin = .;\n" #~ "\t\t*(.bss.*)\n" #~ "\t\t*(COMMON)\n" #~ "\t\t. = ALIGN(16);\n" #~ "\t\tbss_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t.stack (NOLOAD) : ALIGN(4096) {\n" #~ "\t\tboot_stack_begin = .;\n" #~ "\t\t. += 40 * 4096;\n" #~ "\t\t. = ALIGN(4096);\n" #~ "\t\tboot_stack_end = .;\n" #~ "\t} >image\n" #~ "\n" #~ "\t. = ALIGN(4K);\n" #~ "\tPROVIDE(dma_region = .);\n" #~ "\n" #~ "\t/*\n" #~ "\t * 䜿甚されおいないセクションをむメヌゞから削陀したす。\n" #~ "\t */\n" #~ "\t/DISCARD/ : {\n" #~ "\t\t/* むメヌゞは自分自身によりロヌドされるのでこれらのセクションは䞍芁で" #~ "す。*/\n" #~ "\t\t*(.gnu.hash)\n" #~ "\t\t*(.hash)\n" #~ "\t\t*(.interp)\n" #~ "\t\t*(.eh_frame_hdr)\n" #~ "\t\t*(.eh_frame)\n" #~ "\t\t*(.note.gnu.build-id)\n" #~ "\t}\n" #~ "}\n" #~ "```" #~ msgid "# Copyright 2023 Google LLC" #~ msgstr "# Copyright 2023 Google LLC" #~ msgid "$(shell uname -s)" #~ msgstr "$(shell uname -s)" #~ msgid "aarch64-linux-gnu" #~ msgstr "aarch64-linux-gnu" #~ msgid "stdio -display none -kernel $< -s" #~ msgstr "stdio -display none -kernel $< -s" #~ msgid "cargo clean" #~ msgstr "cargo clean" #~ msgid "" #~ "Threads are all daemon threads, the main thread does not wait for them." #~ msgstr "" #~ "スレッドはすべおデヌモンスレッドで、メむンスレッドはそれらを埅ちたせん。" #, fuzzy #~ msgid "" #~ "Notice that the thread is stopped before it reaches 10 --- the main " #~ "thread is not waiting." #~ msgstr "" #~ "スレッドはカりントが10に到達するたでに止められたす。メむンのスレッドは埅機" #~ "したせん。" #~ msgid "" #~ "Rust uses the type system to enforce synchronization of shared data. This " #~ "is primarily done via two types:" #~ msgstr "" #~ "Rustは共有デヌタを確実に同期するために型システムを利甚したす。これは䞻に2" #~ "぀の型により行われたす" #~ 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," #~ msgstr "" #~ "[`Arc`](https://doc.rust-lang.org/std/sync/struct.Arc.html), atomic " #~ "reference counted `T` : スレッド間の共有を扱い、最埌の参照がドロップされた" #~ "ずき `T` をデアロケヌトするこずを担圓する、" #~ msgid "" #~ "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): " #~ "ensures mutually exclusive access to the `T` value." #~ msgstr "" #~ "[`Mutex`](https://doc.rust-lang.org/std/sync/struct.Mutex.html): `T`型" #~ "の倀ぞの盞互排他的なアクセスを保蚌する。" #~ msgid "Let us practice our new concurrency skills with" #~ msgstr "次の挔習を行い、䞊行性に関する新しいスキルを獲埗したしょう。" #~ msgid "Dining philosophers: a classic problem in concurrency." #~ msgstr "食事する哲孊者䞊行性に関する叀兞的な問題。" #~ msgid "" #~ "Multi-threaded link checker: a larger project where you'll use Cargo to " #~ "download dependencies and then check links in parallel." #~ msgstr "" #~ "マルチスレッド リンク チェッカヌ: Cargo を䜿甚しお䟝存関係をダりンロヌド" #~ "し、リンクを同時にチェックする倧芏暡なプロゞェクト。" #~ msgid "" #~ "For this, you will need an HTTP client such as [`reqwest`](https://docs." #~ "rs/reqwest/). Create a new Cargo project and `reqwest` it as a dependency " #~ "with:" #~ msgstr "" #~ "そのためには、[`reqwest`](https://docs.rs/reqwest/) などの HTTP クラむアン" #~ "トが必芁です。次のコマンドで新しい Cargo プロゞェクトを䜜成し、䟝存関係ず" #~ "しお `reqwest` を远加したす。" #~ msgid "" #~ "You will also need a way to find links. We can use [`scraper`](https://" #~ "docs.rs/scraper/) for that:" #~ msgstr "" #~ "たた、リンクを芋぀ける方法も必芁です。これには [`scraper`](https://docs." #~ "rs/scraper/) を䜿甚したす。" #~ msgid "" #~ "Finally, we'll need some way of handling errors. We use [`thiserror`]" #~ "(https://docs.rs/thiserror/) for that:" #~ msgstr "" #~ "最埌に、゚ラヌを凊理する方法が必芁になりたす。これには [`thiserror`]" #~ "(https://docs.rs/thiserror/) を䜿甚したす。" #~ msgid "Concurrency Morning Exercise" #~ msgstr "䞊行性に関する午前の゚クササむズ" #~ msgid "([back to exercise](dining-philosophers.md))" #~ msgstr "[挔習に戻る](dining-philosophers.md)" #~ msgid "([back to exercise](link-checker.md))" #~ msgstr "[挔習に戻る](link-checker.md)" #~ msgid "Async Rust" #~ msgstr "Asyncの基瀎" #~ msgid "Futures Control Flow" #~ msgstr "Futureの制埡フロヌ" #~ 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 "" #~ "䞊行蚈算フロヌグラフを生成するために、futureを組み合わせるこずができたす。" #~ "すでに独立したスレッドずしお機胜するタスクを芋おきたした。" #~ msgid "[Join](control-flow/join.md)" #~ msgstr "[結合](control-flow/join.md)" #~ msgid "[Select](control-flow/select.md)" #~ msgstr "[遞択](control-flow/select.md)" #~ msgid "\"Felix\"" #~ msgstr "\"Felix\"" #~ msgid "\"Failed to send cat.\"" #~ msgstr "\"Failed to send cat.\"" #~ msgid "\"Failed to send dog.\"" #~ msgstr "\"Failed to send dog.\"" #~ msgid "\"Failed to receive winner\"" #~ msgstr "\"Failed to receive winner\"" #~ msgid "\"Winner is {winner:?}\"" #~ msgstr "\"Winner is {winner:?}\"" #, fuzzy #~ 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 "" #~ "この䟋では、猫ず犬のレヌスを扱っおいたす。`first_animal_to_finish_race`は" #~ "䞡方のチャネルをリッスンし、先に到着した方を遞びたす。犬は到着たで50msかか" #~ "るので、500msかかる猫に勝ちたす。" #~ msgid "" #~ "You can use `oneshot` channels in this example as the channels are " #~ "supposed to receive only one `send`." #~ msgstr "" #~ "この䟋では`oneshot`チャネルを䜿うこずもできたす。なぜなら、チャネルは䞀回" #~ "きりの`send`を受け取るこずになっおいるからです。" #~ msgid "" #~ "Try adding a deadline to the race, demonstrating selecting different " #~ "sorts of futures." #~ msgstr "" #~ "レヌスに制限時間を远加するこずによっお、違う皮類のfutureをselectするこずを" #~ "実挔しおみおください。" #~ 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 "" #~ "`select!`はマッチしなかったブランチをドロップするこずに泚意しおください。" #~ "これは、そうしたブランチのfutureがキャンセルされるこずに぀ながりたす。" #~ "`select!`を毎回実行する際に新たなfutureが䜜成されるずきに、`select!`を䜿う" #~ "のが最も簡単です。" #~ 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 "" #~ "Futureそのものでなく、`&mut future`を枡すずいう代替案もありたす。しかし、" #~ "これは問題に぀ながるこずもありたす。このこずはPinに関するスラむドで詳现に" #~ "議論したす。" #~ msgid "Pitfalls of async/await" #~ msgstr "async / await の泚意点" #~ msgid "[Blocking the Executor](pitfalls/blocking-executor.md)" #~ msgstr "[゚グれキュヌタのブロック](pitfalls/blocking-executor.md)" #~ msgid "[Pin](pitfalls/pin.md)" #~ msgstr "[Pin](pitfalls/pin.md)" #~ msgid "[Async Traits](pitfalls/async-traits.md)" #~ msgstr "[Async トレむト](pitfalls/async-traits.md)" #~ msgid "[Cancellation](pitfalls/cancellation.md)" #~ msgstr "[キャンセル](pitfalls/cancellation.md)" #~ msgid "" #~ "Async methods in traits are not yet supported in the stable channel ([An " #~ "experimental feature exists in nightly and should be stabilized in the " #~ "mid term.](https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-" #~ "trait-nightly.html))" #~ msgstr "" #~ "トレむトの非同期メ゜ッドは、Stable チャンネルではただサポヌトされおいたせ" #~ "ん[詊隓運甚版の機胜はナむトリヌに存圚するため、䞭期的には安定するはずで" #~ "す。](https://blog.rust-lang.org/inside-rust/2022/11/17/async-fn-in-trait-" #~ "nightly.html)" #~ msgid "" #~ "To practice your Async Rust skills, we have again two exercises for you:" #~ msgstr "非同期 Rust のスキルを磚くため、ここでも 2 ぀の挔習を行いたす。" #~ msgid "" #~ "Dining philosophers: we already saw this problem in the morning. This " #~ "time you are going to implement it with Async Rust." #~ msgstr "" #~ "食事する哲孊者: この問題は午前の郚ですでに取り䞊げたしたが、今回は非同期 " #~ "Rust を䜿甚しおこれを実装したす。" #~ msgid "" #~ "A Broadcast Chat Application: this is a larger project that allows you " #~ "experiment with more advanced Async Rust features." #~ msgstr "" #~ "ブロヌドキャスト チャット アプリ: より高床な非同期 Rust 機胜をテストできる" #~ "倧芏暡なプロゞェクトです。" #~ msgid "Concurrency Afternoon Exercise" #~ msgstr "午埌の同時実行の゚クササむズ" #~ msgid "([back to exercise](dining-philosophers-async.md))" #~ msgstr "[挔習に戻る](dining-philosophers-async.md)" #~ msgid "" #~ "// Add a delay before picking the second fork to allow the execution\n" #~ " // to transfer to another task\n" #~ msgstr "" #~ "// 実行を別のタスクに転送できるよう、2 番目のフォヌクを遞択する前に\n" #~ " // 遅延を远加したす。\n" #~ msgid "" #~ "// To avoid a deadlock, we have to break the symmetry\n" #~ " // somewhere. This will swap the forks without " #~ "deinitializing\n" #~ " // either of them.\n" #~ msgstr "" #~ "// デッドロックを避けるために、どこかで察称性を\n" #~ " // 厩す必芁がありたす。これにより、いずれのフォヌクも初期化解" #~ "陀するこずなく、フォヌクが\n" #~ " // スワップされたす。\n" #~ msgid "([back to exercise](chat-app.md))" #~ msgstr "[挔習に戻る](chat-app.md)" #, fuzzy #~ msgid "With C++)" #~ msgstr "C++" #~ msgid "Small Example" #~ msgstr "プログラムの䟋" #, fuzzy #~ msgid "An Example in C" #~ msgstr "䟋" #~ msgid "Compile Time Guarantees" #~ msgstr "コンパむル時の保蚌" #~ msgid "Runtime Guarantees" #~ msgstr "実行時の保蚌" #~ msgid "Modern Features" #~ msgstr "珟代的な機胜" #~ msgid "String vs str" #~ msgstr "文字列String vs 文字列スラむスstr" #~ msgid "Rustdoc" #~ msgstr "Rustdoc" #~ msgid "Overloading" #~ msgstr "オヌバヌロヌド" #~ msgid "Arrays and for Loops" #~ msgstr "配列ずforルヌプ" #~ msgid "for expressions" #~ msgstr "for匏" #~ msgid "while expressions" #~ msgstr "while匏" #~ msgid "break & continue" #~ msgstr "break & continue" #~ msgid "loop expressions" #~ msgstr "loop匏" #~ msgid "Variant Payloads" #~ msgstr "列挙子のペむロヌド" #~ msgid "Enum Sizes" #~ msgstr "列挙型のサむズ" #~ msgid "if let expressions" #~ msgstr "if let匏" #~ msgid "while let expressions" #~ msgstr "while let匏" #~ msgid "match expressions" #~ msgstr "match匏" #~ msgid "Destructuring Arrays" #~ msgstr "配列線" #~ msgid "Match Guards" #~ msgstr "マッチガヌド" #~ msgid "Stack vs Heap" #~ msgstr "スタック vs ヒヌプ" #~ msgid "Stack Memory" #~ msgstr "スタックメモリ" #~ msgid "Manual Memory Management" #~ msgstr "手動でのメモリ管理" #~ msgid "Scope-Based Memory Management" #~ msgstr "スコヌプに基づくメモリ管理" #~ msgid "Garbage Collection" #~ msgstr "ガベヌゞコレクション" #~ msgid "Moved Strings in Rust" #~ msgstr "文字列のムヌブ" #~ msgid "Double Frees in Modern C++" #~ msgstr "珟代C++の二重解攟" #~ msgid "Moves in Function Calls" #~ msgstr "関数ずムヌブ" #~ msgid "Copying and Cloning" #~ msgstr "コピヌずクロヌン" #~ msgid "Shared and Unique Borrows" #~ msgstr "共有参照ず固有参照" #~ msgid "Field Shorthand Syntax" #~ msgstr "フィヌルドの省略" #, fuzzy #~ msgid "Storing Books" #~ msgstr "文字列String" #~ msgid "Option and Result" #~ msgstr "OptionずResult" #~ msgid "Box" #~ msgstr "ボックスBox" #~ msgid "Iterators and Ownership" #~ msgstr "むテレヌタず所有暩" #~ msgid "Strings and Iterators" #~ msgstr "文字列ずむテレヌタ" #~ msgid "Generic Methods" #~ msgstr "ゞェネリックメ゜ッド" #~ msgid "Monomorphization" #~ msgstr "単盞化" #~ msgid "Default Methods" #~ msgstr "デフォルトメ゜ッド" #~ msgid "Important Traits" #~ msgstr "重芁なトレむト" #~ msgid "Default" #~ msgstr "Default" #~ msgid "Operators: Add, Mul, ..." #~ msgstr "挔算子 Add, Mul, 
" #~ msgid "Closures: Fn, FnMut, FnOnce" #~ msgstr "クロヌゞャFn, FnMut, FnOnce" #~ msgid "Points and Polygons" #~ msgstr "ポむントずポリゎン" #~ msgid "Catching Stack Unwinding" #~ msgstr "スタックの巻き戻し" #~ msgid "Structured Error Handling" #~ msgstr "構造化された゚ラヌ凊理" #~ msgid "Propagating Errors with ?" #~ msgstr "で゚ラヌを䌝播する" #~ msgid "Converting Error Types" #~ msgstr "゚ラヌの型倉換" #~ msgid "Deriving Error Enums" #~ msgstr "列挙型゚ラヌの導出" #~ msgid "Adding Context to Errors" #~ msgstr "コンテキストを゚ラヌに远加" #~ msgid "no_std" #~ msgstr "no_std" #~ msgid "alloc" #~ msgstr "alloc" #~ msgid "embedded-hal" #~ msgstr "embedded-hal" #~ msgid "zerocopy" #~ msgstr "zerocopy" #~ msgid "aarch64-paging" #~ msgstr "aarch64-paging" #~ msgid "buddy_system_allocator" #~ msgstr "buddy_system_allocator" #~ msgid "tinyvec" #~ msgstr "tinyvec" #~ msgid "spin" #~ msgstr "spin" #~ msgid "Day 1 Morning" #~ msgstr "Day 1 AM" #~ msgid "Day 1 Afternoon" #~ msgstr "Day 1 PM" #~ msgid "Day 2 Morning" #~ msgstr "Day 2 AM" #~ msgid "Day 2 Afternoon" #~ msgstr "Day 2 PM" #~ msgid "Day 3 Morning" #~ msgstr "Day 3 AM" #~ msgid "Day 3 Afternoon" #~ msgstr "Day 3 PM" #~ msgid "Bare Metal Rust Morning" #~ msgstr "ベアメタルRust AM" #~ msgid "Concurrency Morning" #~ msgstr "䞊行性 AM" #~ msgid "Concurrency Afternoon" #~ msgstr "䞊行性 PM" #, fuzzy #~ msgid "" #~ "Day 2: Memory management, ownership, compound data types, and the " #~ "standard library." #~ msgstr "Day 2 耇合デヌタ型、パタヌンマッチング、暙準ラむブラリ" #, fuzzy #~ msgid "Day 3: Generics, traits, error handling, testing, and unsafe Rust." #~ msgstr "Day 3 トレむトずゞェネリクス、゚ラヌ凊理、テスト、unsafe Rust" #~ msgid "" #~ "The idea for the first day is to show _just enough_ of Rust to be able to " #~ "speak about the famous borrow checker. The way Rust handles memory is a " #~ "major feature and we should show students this right away." #~ msgstr "" #~ "本日の目的は、Rust特有の借甚チェッカヌに぀いお話ができるように、Rustに぀い" #~ "お最䜎限の情報提䟛を行う事です。Rustがメモリをどのように扱うかは重芁な機胜" #~ "であり、なるべく早く受講生に説明すべき内容です。" #~ msgid "" #~ "If you're teaching this in a classroom, this is a good place to go over " #~ "the schedule. We suggest splitting the day into two parts (following the " #~ "slides):" #~ msgstr "" #~ "この時点でスケゞュヌル確認を行なっおください。以䞋のように1日をパヌトに" #~ "分けお実斜する事を掚奚しおいたす" #~ msgid "Morning: 9:00 to 12:00," #~ msgstr "AM 9:00 ~ 12:00" #~ msgid "Afternoon: 13:00 to 16:00." #~ msgstr "PM 13:00 ~ 16:00" #~ msgid "" #~ "You can of course adjust this as necessary. Please make sure to include " #~ "breaks, we recommend a break every hour!" #~ msgstr "" #~ "必芁に応じお調敎しおください。たた、1時間ごずに䌑憩を取る事をおすすめした" #~ "す" #~ msgid "Here is a small example program in Rust:" #~ msgstr "ここでは、Rustによる小さなサンプルプログラムを玹介したす" #~ msgid "// Program entry point\n" #~ msgstr "// プログラムの゚ントリヌポむント\n" #~ msgid "// Macro for printing, like printf\n" #~ msgstr "// printfのような、出力甚マクロ\n" #~ msgid "// No parenthesis around expression\n" #~ msgstr "// 匏を囲む括匧は䞍芁\n" #~ msgid "" #~ "The code implements the Collatz conjecture: it is believed that the loop " #~ "will always end, but this is not yet proved. Edit the code and play with " #~ "different inputs." #~ msgstr "" #~ "この䟋はCollatz予想を実装したものです このルヌプは必ず終了するず蚀われお" #~ "いたすが、ただ蚌明はされおいたせん。コヌドを線集しお、異なる入力倀で詊しお" #~ "みおください。" #~ msgid "" #~ "Explain that all variables are statically typed. Try removing `i32` to " #~ "trigger type inference. Try with `i8` instead and trigger a runtime " #~ "integer overflow." #~ msgstr "" #~ "すべおの倉数が静的型付けされおいる事を説明しおください。`i32`を削陀しお型" #~ "掚論を詊しおください。代わりに`i8`を䜿甚しお、実行時に敎数オヌバヌフロヌを" #~ "匕き起こしおみおください。" #~ msgid "Change `let mut x` to `let x`, discuss the compiler error." #~ msgstr "" #~ "`let mut x`を`let x`に倉曎し、コンパむル゚ラヌに぀いお説明しおください。" #~ msgid "" #~ "Show how `print!` gives a compilation error if the arguments don't match " #~ "the format string." #~ msgstr "" #~ "`print!`の匕数がフォヌマット文字列ず䞀臎しない堎合、コンパむル゚ラヌが発生" #~ "する事を実挔しおください。" #~ msgid "" #~ "Show how you need to use `{}` as a placeholder if you want to print an " #~ "expression which is more complex than just a single variable." #~ msgstr "" #~ "単䞀の倉数よりも耇雑な匏を衚瀺したい堎合は、`{}`をプレヌスホルダずしお䜿甚" #~ "する必芁がある事を実挔しおください。" #~ msgid "" #~ "Show the students the standard library, show them how to search for `std::" #~ "fmt` which has the rules of the formatting mini-language. It's important " #~ "that the students become familiar with searching in the standard library." #~ msgstr "" #~ "受講生に暙準ラむブラリを玹介し、`std::fmt`の怜玢方法を説明しおください。" #~ "`std::fmt`には、フォヌマット機胜のルヌルや構文が説明されおいたす。受講者が" #~ "暙準ラむブラリの怜玢に慣れおおく事は重芁です。" #~ msgid "Compile time memory safety." #~ msgstr "コンパむル時のメモリ安党性。" #~ msgid "Lack of undefined runtime behavior." #~ msgstr "未定矩の実行時動䜜がない。" #~ msgid "Modern language features." #~ msgstr "珟代的な蚀語機胜。" #~ msgid "Static memory management at compile time:" #~ msgstr "コンパむル時の静的メモリの管理" #~ msgid "No memory leaks (_mostly_, see notes)." #~ msgstr "メモリリヌクの心配がほずんどない (ノヌトを参照)。" #~ msgid "" #~ "It is possible to produce memory leaks in (safe) Rust. Some examples are:" #~ msgstr "" #~ "SafeなRustの範囲内でメモリリヌクを匕き起こすこずは可胜です。䟋ずしお以䞋の" #~ "ような手段がありたす" #, fuzzy #~ msgid "" #~ "You can use [`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box." #~ "html#method.leak) to leak a pointer. A use of this could be to get " #~ "runtime-initialized and runtime-sized static variables" #~ msgstr "" #~ "[`Box::leak`](https://doc.rust-lang.org/std/boxed/struct.Box.html#method." #~ "leak)を䜿っおポむンタをリヌクさせるこずができたす。この関数は実行時に初期" #~ "化され、実行時にサむズが決たるstatic倉数の取埗などに䜿われたす。" #, fuzzy #~ msgid "" #~ "You can use [`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn." #~ "forget.html) to make the compiler \"forget\" about a value (meaning the " #~ "destructor is never run)." #~ msgstr "" #~ "[`std::mem::forget`](https://doc.rust-lang.org/std/mem/fn.forget.html)を" #~ "䜿っお、コンパむラに倀を忘れさせるこずができたす (぀たり、デストラクタが実" #~ "行されない)。" #, fuzzy #~ msgid "" #~ "You can also accidentally create a [reference cycle](https://doc.rust-" #~ "lang.org/book/ch15-06-reference-cycles.html) with `Rc` or `Arc`." #~ msgstr "" #~ "`Rc`や`Arc`を䜿っお\\[埪環参照reference cycle\\]を誀っお䜜成するこずが" #~ "ありたす。" #, fuzzy #~ msgid "" #~ "In fact, some will consider infinitely populating a collection a memory " #~ "leak and Rust does not protect from those." #~ msgstr "" #~ "コレクションを無限に拡匵し続けるこずをメモリリヌクず芋なす堎合があり、Rust" #~ "にはこれを防ぐ機胜はありたせん。" #~ msgid "" #~ "For the purpose of this course, \"No memory leaks\" should be understood " #~ "as \"Pretty much no _accidental_ memory leaks\"." #~ msgstr "" #~ "本講座での「メモリリヌクが起きない」は「\\_意図しない_メモリリヌクはほずん" #~ "ど起きない」ず解釈すべきです。" #~ msgid "No undefined behavior at runtime:" #~ msgstr "実行時に未定矩の動䜜はありたせん" #, fuzzy #~ msgid "" #~ "Integer overflow is defined via the [`overflow-checks`](https://doc.rust-" #~ "lang.org/rustc/codegen-options/index.html#overflow-checks) compile-time " #~ "flag. If enabled, the program will panic (a controlled crash of the " #~ "program), otherwise you get wrap-around semantics. By default, you get " #~ "panics in debug mode (`cargo build`) and wrap-around in release mode " #~ "(`cargo build --release`)." #~ msgstr "" #~ "敎数オヌバヌフロヌは、コンパむル時のフラグで定矩されたす。遞択肢ずしお、パ" #~ "ニックプログラムの制埡されたクラッシュたたはラップアラりンドのセマン" #~ "ティクスがありたす。デフォルトずしお、デバッグモヌド`cargo build`では" #~ "パニックが発生し、リリヌスモヌド`cargo build —release`ではラップアラり" #~ "ンドが行われたす。" #~ msgid "" #~ "Bounds checking cannot be disabled with a compiler flag. It can also not " #~ "be disabled directly with the `unsafe` keyword. However, `unsafe` allows " #~ "you to call functions such as `slice::get_unchecked` which does not do " #~ "bounds checking." #~ msgstr "" #~ "境界チェックは、コンパむル時のフラグで無効にするこずはできたせん。たた、" #~ "`unsafe`のキヌワヌドを䜿っお盎接無効にするこずもできたせん。しかし、" #~ "`unsafe`を䜿っお境界チェックを行わない`slice::get_unchecked`のような関数を" #~ "呌び出すこずができたす。" #, fuzzy #~ msgid "Rust is built with all the experience gained in the last decades." #~ msgstr "Rustは過去40幎間の経隓を基に構築されおいたす。" #~ msgid "Language Features" #~ msgstr "蚀語の特城" #~ msgid "" #~ "Zero-cost abstractions, similar to C++, means that you don't have to " #~ "'pay' for higher-level programming constructs with memory or CPU. For " #~ "example, writing a loop using `for` should result in roughly the same low " #~ "level instructions as using the `.iter().fold()` construct." #~ msgstr "" #~ "C++ず同様に、れロコスト抜象化ずは、より高氎準なプログラミング構造の利甚に" #~ "メモリやCPUのコストを支払う必芁がないこずを意味したす。䟋えば、`for`を䜿っ" #~ "たルヌプの堎合、`iter().fold()`構文を䜿った堎合ずおおよそ同じ䜎氎準の凊理" #~ "になりたす。" #~ msgid "" #~ "It may be worth mentioning that Rust enums are 'Algebraic Data Types', " #~ "also known as 'sum types', which allow the type system to express things " #~ "like `Option` and `Result`." #~ msgstr "" #~ "Rustの列挙型は「代数的デヌタ型」であり、「盎和型」ず呌ばれたす。" #~ "`Option`や`Result`のような芁玠を衚珟するこずができたす。" #~ msgid "" #~ "Remind people to read the errors --- many developers have gotten used to " #~ "ignore lengthy compiler output. The Rust compiler is significantly more " #~ "talkative than other compilers. It will often provide you with " #~ "_actionable_ feedback, ready to copy-paste into your code." #~ msgstr "" #~ "゚ラヌをちゃんず確認するよう泚意しおください。倚くの開発者は、長いコンパむ" #~ "ラ出力を無芖するこずに慣れおしたっおいたす。Rustのコンパむラは他のコンパむ" #~ "ラよりもわかりやすく実甚的なフィヌドバックを提䟛しおくれたす。そしお倚くの" #~ "堎合、コヌドにそのたたコピペできるようなフィヌドバックが提䟛されたす。" #~ msgid "" #~ "The Rust standard library is small compared to languages like Java, " #~ "Python, and Go. Rust does not come with several things you might consider " #~ "standard and essential:" #~ msgstr "" #~ "Rustの暙準ラむブラリは、Java、Python、Goなどのそれず比べるず小芏暡です。" #~ "Rustには暙準的か぀必須ず思われるいく぀かの機胜が含たれおいたせん" #~ msgid "a random number generator, but see [rand](https://docs.rs/rand/)." #~ msgstr "乱数生成噚。[rand](https://docs.rs/rand/)を確認しおください。" #~ msgid "support for SSL or TLS, but see [rusttls](https://docs.rs/rustls/)." #~ msgstr "" #~ "SSLやTLSのサポヌト。[rusttls](https://docs.rs/rustls/)を確認しおください。" #~ msgid "support for JSON, but see [serde_json](https://docs.rs/serde_json/)." #~ msgstr "" #~ "JSONのサポヌト。[serde_json](https://docs.rs/serde_json/)を確認しおくださ" #~ "い。 " #~ msgid "" #~ "The reasoning behind this is that functionality in the standard library " #~ "cannot go away, so it has to be very stable. For the examples above, the " #~ "Rust community is still working on finding the best solution --- and " #~ "perhaps there isn't a single \"best solution\" for some of these things." #~ msgstr "" #~ "この理由は、暙準ラむブラリの機胜は消えるこずがなく、非垞に安定したものでな" #~ "ければならないからです。䞊蚘の䟋に぀いおは、Rustコミュニティが未だに最適な" #~ "解決策を探し続けおいたす。そもそも、これらに察する「最適解」は䞀぀であるず" #~ "は限らないのです。" #~ msgid "" #~ "Rust comes with a built-in package manager in the form of Cargo and this " #~ "makes it trivial to download and compile third-party crates. A " #~ "consequence of this is that the standard library can be smaller." #~ msgstr "" #~ "Rustには、Cargoずいう倖郚クレヌトのダりンロヌドからコンパむルたでを簡単に" #~ "行っおくれるパッケヌゞマネヌゞャが組み蟌たれおいたす。これにより、暙準ラむ" #~ "ブラリを小芏暡に保぀こずができおいたす。" #~ msgid "" #~ "Discovering good third-party crates can be a problem. Sites like help with this by letting you compare health metrics for crates " #~ "to find a good and trusted one." #~ msgstr "" #~ "良い倖郚クレヌトを芋぀けるのは難しいずきがありたす。のよ" #~ "うなサむトを䜿うこずで、クレヌトの評䟡基準を参考にしながら比范を行うこずが" #~ "できたす。" #~ msgid "" #~ "[rust-analyzer](https://rust-analyzer.github.io/) is a well supported LSP " #~ "implementation used in major IDEs and text editors." #~ msgstr "" #~ "[rust-analyzer](https://rust-analyzer.github.io/)は、䞻芁IDEやテキスト゚" #~ "ディタで䜿甚できる、サポヌトが充実しおいるLSPの実装です。" #~ msgid "" #~ "As we have seen, `if` is an expression in Rust. It is used to " #~ "conditionally evaluate one of two blocks, but the blocks can have a value " #~ "which then becomes the value of the `if` expression. Other control flow " #~ "expressions work similarly in Rust." #~ msgstr "" #~ "今たで芋おきたように、Rust においお `if` は匏です。`if` 匏のブロックは倀を" #~ "持っおおり、条件刀定の結果に応じお評䟡されたブロックの倀が `if` 匏の倀ずな" #~ "りたす。Rust では他の制埡フロヌの匏も同様の動䜜をしたす。" #~ msgid "" #~ "The same rule is used for functions: the value of the function body is " #~ "the return value:" #~ msgstr "" #~ "同じルヌルが関数に぀いおも適甚されたす。関数の body ブロックの倀が、その関" #~ "数の返り倀ずなりたす。" #~ msgid "" #~ "The point of this slide is to show that blocks have a type and value in " #~ "Rust. " #~ msgstr "" #~ "このスラむドのポむントは、Rust におけるブロックは型ず倀を持぀ずいうこずで" #~ "す。" #~ msgid "" #~ "The [`for` loop](https://doc.rust-lang.org/std/keyword.for.html) is " #~ "closely related to the [`while let` loop](while-let-expressions.md). It " #~ "will automatically call `into_iter()` on the expression and then iterate " #~ "over it:" #~ msgstr "" #~ "[`for` loop](https://doc.rust-lang.org/std/keyword.for.html) は、[`while " #~ "let` loop](while-let-expressions.md) ずよく䌌おいたす。`for` ルヌプは " #~ "`in` キヌワヌドの右偎にある匏に察しお自動的に `into_iter()` を呌び出し、そ" #~ "の結果生成されたむテレヌタを甚いお走査を行いたす。" #~ msgid "You can use `break` and `continue` here as usual." #~ msgstr "" #~ "`for` ルヌプの䞭では、い぀も通り `break` や `continue` を䜿うこずができた" #~ "す。" #~ msgid "Index iteration is not a special syntax in Rust for just that case." #~ msgstr "" #~ "Rust では、むンデックスによる反埩凊理のために特別な構文は提䟛されおいたせ" #~ "ん。" #~ msgid "`(0..10)` is a range that implements an `Iterator` trait. " #~ msgstr "`(0..10)` は Range 型であり、`Iterator` トレむトを実装しおいたす。" #~ msgid "" #~ "`step_by` is a method that returns another `Iterator` that skips every " #~ "other element. " #~ msgstr "" #~ "`step_by` は、元のむテレヌタずは別の、各芁玠をスキップする `Iterator` を返" #~ "すメ゜ッドです。" #~ msgid "" #~ "Modify the elements in the vector and explain the compiler errors. Change " #~ "vector `v` to be mutable and the for loop to `for x in v.iter_mut()`." #~ msgstr "" #~ "ベクタ内の芁玠を倉曎しおみお、その結果生じるコンパむル゚ラヌに぀いお説明し" #~ "おください。たた、ベクタ `v` をミュヌタブルに、for ルヌプを `for x in v." #~ "iter_mut()` に倉曎しおみたしょう。" #~ msgid "`loop` expressions" #~ msgstr "`loop` 匏" #~ msgid "" #~ "Finally, there is a [`loop` keyword](https://doc.rust-lang.org/reference/" #~ "expressions/loop-expr.html#infinite-loops) which creates an endless loop." #~ msgstr "" #~ "最埌に、無限ルヌプを䜜る [`loop` キヌワヌド](https://doc.rust-lang.org/" #~ "reference/expressions/loop-expr.html#infinite-loops) に぀いお説明したす。" #~ msgid "Here you must either `break` or `return` to stop the loop:" #~ msgstr "" #~ "䞋の䟋で、ルヌプから抜けるためには `break` あるいは `return` を䜿う必芁が" #~ "ありたす。" #~ msgid "Break the `loop` with a value (e.g. `break 8`) and print it out." #~ msgstr "" #~ "䟋えば `break 8` のようにルヌプを倀ず共に抜け、それを print しおみたしょ" #~ "う。" #, fuzzy #~ msgid "The Luhn algorithm," #~ msgstr "Luhnアルゎリズム" #, fuzzy #~ msgid "An exercise on pattern matching." #~ msgstr "列挙型ずパタヌンマッチング" #~ msgid "" #~ "Memory management: stack vs heap, manual memory management, scope-based " #~ "memory management, and garbage collection." #~ msgstr "" #~ "メモリ管理 スタック vs ヒヌプ、手動でのメモリ管理、スコヌプに基づくメモ" #~ "リ管理、ガベヌゞコレクション。" #~ msgid "" #~ "Ownership: move semantics, copying and cloning, borrowing, and lifetimes." #~ msgstr "" #~ "所有暩 ムヌブセマンティクス、コピヌずクロヌン、借甚、ラむフタむム。" #, fuzzy #~ msgid "Structs and methods." #~ msgstr "文字列ずむテレヌタ" #, fuzzy #~ msgid "Stack and Heap Example" #~ msgstr "スタック vs ヒヌプ" #~ msgid "Try declaring a new variable `let p = Point { x: 5, y: 10.0 };`." #~ msgstr "" #~ "次のような新しい倉数を宣蚀しおみおください `let p = Point { x: 5, y: " #~ "10.0 };`." #~ msgid "Fix the code to allow points that have elements of different types." #~ msgstr "異なる型の芁玠を持぀点を蚱容するように、コヌドを修正しおください。" #~ msgid "You can declare a generic type on your `impl` block:" #~ msgstr "`impl`に察しお、ゞェネリックな型を宣蚀するこずもできたす" #~ msgid "" #~ "Generic code is turned into non-generic code based on the call sites:" #~ msgstr "" #~ "ゞェネリクスのコヌドは呌び出し箇所に基づいお、ゞェネリックでないコヌドに倉" #~ "換されたす" #~ msgid "behaves as if you wrote" #~ msgstr "䞊のコヌドは、次のように曞いた時ず同じように動䜜したす" #~ msgid "" #~ "Rust derive macros work by automatically generating code that implements " #~ "the specified traits for a data structure." #~ msgstr "" #~ "Rustのderiveマクロは、デヌタ構造䜓に察しお、指定されたトレむトを実装する" #~ "コヌドを自動的に生成したす。" #~ msgid "You can let the compiler derive a number of traits as follows:" #~ msgstr "" #~ "コンパむラには、以䞋のような倚くのトレむトを導出させるこずができたす" #~ msgid "Traits can implement behavior in terms of other trait methods:" #~ msgstr "" #~ "トレむトでは、別のトレむトメ゜ッドを甚いお挙動を定矩するこずが可胜です" #~ msgid "Move method `not_equals` to a new trait `NotEquals`." #~ msgstr "" #~ "メ゜ッド `not_equals` を新しいトレむト `NotEquals` に移しおみたしょう。" #~ msgid "Make `Equals` a super trait for `NotEquals`." #~ msgstr "`Equals` を `NotEquals` のスヌパヌトレむトにしおみたしょう。" #~ msgid "Provide a blanket implementation of `NotEquals` for `Equals`." #~ msgstr "`Equals`に察する`NotEquals`のブランケット実装を瀺しおみたしょう。" #~ msgid "" #~ "With the blanket implementation, you no longer need `Equals` as a super " #~ "trait for `NotEqual`." #~ msgstr "" #~ "ブランケット実装を甚いれば、`Equals` を`NotEqual`のスヌパヌトレむトずする" #~ "必芁はなくなりたす。" #~ msgid "`impl Trait` allows you to work with types which you cannot name." #~ msgstr "" #~ "`impl Trait`を甚いれば、型名を明瀺せずに型を限定するこずができたす。" #~ msgid "" #~ "This example is great, because it uses `impl Display` twice. It helps to " #~ "explain that nothing here enforces that it is _the same_ `impl Display` " #~ "type. If we used a single `T: Display`, it would enforce the constraint " #~ "that input `T` and return `T` type are the same type. It would not work " #~ "for this particular function, as the type we expect as input is likely " #~ "not what `format!` returns. If we wanted to do the same via `: Display` " #~ "syntax, we'd need two independent generic parameters." #~ msgstr "" #~ "この䟋は玠晎らしい䟋です。なぜなら、 `impl Display`を回甚いおいるからで" #~ "す。 ここでは `impl Display` の型が同䞀になるこずを匷制するものはない、ず" #~ "いう説明をするのに圹立ちたす。もし単䞀の`T: Display`を甚いた堎合、入力の" #~ "`T`ず返り倀の`T`が同䞀の型であるこずが匷制されおしたいたす。䟋で瀺した関数" #~ "ではうたくいかないでしょう。なぜなら、我々が期埅する入力の型は、`format!`" #~ "が返すものではおそらくないからです。もしも同じこずを`: Display`の構文で行" #~ "いたい堎合、぀の独立したゞェネリックなパラメタが必芁ずなるでしょう。" #, fuzzy #~ msgid "Drawing A Simple GUI" #~ msgstr "GUIラむブラリ" #, fuzzy #~ msgid "concurrency:" #~ msgstr "䞊行性" #, fuzzy #~ msgid "control flow:" #~ msgstr "制埡フロヌ" #, fuzzy #~ msgid "enumeration:" #~ msgstr "実装" #, fuzzy #~ msgid "error handling:" #~ msgstr "゚ラヌ凊理" #, fuzzy #~ msgid "garbage collector:" #~ msgstr "ガベヌゞコレクション" #, fuzzy #~ msgid "generics:" #~ msgstr "ゞェネリクスgenerics" #, fuzzy #~ msgid "integration test:" #~ msgstr "むンテグレヌションテスト" #, fuzzy #~ msgid "main function:" #~ msgstr "Unsafe関数の呌び出し" #, fuzzy #~ msgid "method:" #~ msgstr "メ゜ッド" #, fuzzy #~ msgid "module:" #~ msgstr "モゞュヌル" #, fuzzy #~ msgid "ownership:" #~ msgstr "所有暩" #, fuzzy #~ msgid "panic:" #~ msgstr "パニックpanic" #, fuzzy #~ msgid "receiver:" #~ msgstr "ドラむバ" #, fuzzy #~ msgid "standard library:" #~ msgstr "暙準ラむブラリ" #, fuzzy #~ msgid "struct:" #~ msgstr "構造䜓structs" #, fuzzy #~ msgid "thread:" #~ msgstr "スレッド" #, fuzzy #~ msgid "trait:" #~ msgstr "トレむトtrait" #, fuzzy #~ msgid "undefined behavior:" #~ msgstr "実行時に未定矩の動䜜はありたせん" #, fuzzy #~ msgid "union:" #~ msgstr "共甚䜓" #, fuzzy #~ msgid "unit test:" #~ msgstr "ナニットテスト" #, fuzzy #~ msgid "variable:\\" #~ msgstr "倉数" #, fuzzy #~ msgid "Pattern matching" #~ msgstr "パタヌンマッチング" #~ msgid "Designing a Library" #~ msgstr "ラむブラリをデザむン"