Showing preview only (2,653K chars total). Download the full file or copy to clipboard to get everything.
Repository: rust-lang/rust-by-example
Branch: master
Commit: 5383db524711
Files: 217
Total size: 2.5 MB
Directory structure:
gitextract_2dn170dt/
├── .gitattributes
├── .github/
│ └── workflows/
│ └── rbe.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── TRANSLATING.md
├── TRANSLATING_JA.md
├── TRANSLATING_ZH.md
├── book.toml
├── po/
│ ├── es.po
│ ├── ja.po
│ ├── ko.po
│ └── zh.po
├── src/
│ ├── SUMMARY.md
│ ├── attribute/
│ │ ├── cfg/
│ │ │ └── custom.md
│ │ ├── cfg.md
│ │ ├── crate.md
│ │ └── unused.md
│ ├── attribute.md
│ ├── cargo/
│ │ ├── build_scripts.md
│ │ ├── conventions.md
│ │ ├── deps.md
│ │ └── test.md
│ ├── cargo.md
│ ├── compatibility/
│ │ └── raw_identifiers.md
│ ├── compatibility.md
│ ├── conversion/
│ │ ├── from_into.md
│ │ ├── string.md
│ │ └── try_from_try_into.md
│ ├── conversion.md
│ ├── crates/
│ │ ├── lib.md
│ │ └── using_lib.md
│ ├── crates.md
│ ├── custom_types/
│ │ ├── constants.md
│ │ ├── enum/
│ │ │ ├── c_like.md
│ │ │ ├── enum_use.md
│ │ │ └── testcase_linked_list.md
│ │ ├── enum.md
│ │ └── structs.md
│ ├── custom_types.md
│ ├── error/
│ │ ├── abort_unwind.md
│ │ ├── iter_result.md
│ │ ├── multiple_error_types/
│ │ │ ├── boxing_errors.md
│ │ │ ├── define_error_type.md
│ │ │ ├── option_result.md
│ │ │ ├── reenter_question_mark.md
│ │ │ └── wrap_error.md
│ │ ├── multiple_error_types.md
│ │ ├── option_unwrap/
│ │ │ ├── and_then.md
│ │ │ ├── defaults.md
│ │ │ ├── map.md
│ │ │ └── question_mark.md
│ │ ├── option_unwrap.md
│ │ ├── panic.md
│ │ ├── result/
│ │ │ ├── early_returns.md
│ │ │ ├── enter_question_mark.md
│ │ │ ├── result_alias.md
│ │ │ └── result_map.md
│ │ └── result.md
│ ├── error.md
│ ├── expression.md
│ ├── flow_control/
│ │ ├── for.md
│ │ ├── if_else.md
│ │ ├── if_let.md
│ │ ├── let_else.md
│ │ ├── loop/
│ │ │ ├── nested.md
│ │ │ └── return.md
│ │ ├── loop.md
│ │ ├── match/
│ │ │ ├── binding.md
│ │ │ ├── destructuring/
│ │ │ │ ├── destructure_enum.md
│ │ │ │ ├── destructure_pointers.md
│ │ │ │ ├── destructure_slice.md
│ │ │ │ ├── destructure_structures.md
│ │ │ │ └── destructure_tuple.md
│ │ │ ├── destructuring.md
│ │ │ └── guard.md
│ │ ├── match.md
│ │ ├── while.md
│ │ └── while_let.md
│ ├── flow_control.md
│ ├── fn/
│ │ ├── closures/
│ │ │ ├── anonymity.md
│ │ │ ├── capture.md
│ │ │ ├── closure_examples/
│ │ │ │ ├── iter_any.md
│ │ │ │ └── iter_find.md
│ │ │ ├── closure_examples.md
│ │ │ ├── input_functions.md
│ │ │ ├── input_parameters.md
│ │ │ └── output_parameters.md
│ │ ├── closures.md
│ │ ├── diverging.md
│ │ ├── hof.md
│ │ └── methods.md
│ ├── fn.md
│ ├── generics/
│ │ ├── assoc_items/
│ │ │ ├── the_problem.md
│ │ │ └── types.md
│ │ ├── assoc_items.md
│ │ ├── bounds/
│ │ │ └── testcase_empty.md
│ │ ├── bounds.md
│ │ ├── gen_fn.md
│ │ ├── gen_trait.md
│ │ ├── impl.md
│ │ ├── multi_bounds.md
│ │ ├── new_types.md
│ │ ├── phantom/
│ │ │ └── testcase_units.md
│ │ ├── phantom.md
│ │ └── where.md
│ ├── generics.md
│ ├── hello/
│ │ ├── comment.md
│ │ ├── print/
│ │ │ ├── fmt.md
│ │ │ ├── print_debug.md
│ │ │ ├── print_display/
│ │ │ │ └── testcase_list.md
│ │ │ └── print_display.md
│ │ └── print.md
│ ├── hello.md
│ ├── index.md
│ ├── macros/
│ │ ├── designators.md
│ │ ├── dry.md
│ │ ├── dsl.md
│ │ ├── overload.md
│ │ ├── repeat.md
│ │ ├── syntax.md
│ │ └── variadics.md
│ ├── macros.md
│ ├── meta/
│ │ ├── doc.md
│ │ └── playground.md
│ ├── meta.md
│ ├── mod/
│ │ ├── split.md
│ │ ├── struct_visibility.md
│ │ ├── super.md
│ │ ├── use.md
│ │ └── visibility.md
│ ├── mod.md
│ ├── primitives/
│ │ ├── array.md
│ │ ├── literals.md
│ │ └── tuples.md
│ ├── primitives.md
│ ├── scope/
│ │ ├── borrow/
│ │ │ ├── alias.md
│ │ │ ├── mut.md
│ │ │ └── ref.md
│ │ ├── borrow.md
│ │ ├── lifetime/
│ │ │ ├── elision.md
│ │ │ ├── explicit.md
│ │ │ ├── fn.md
│ │ │ ├── lifetime_bounds.md
│ │ │ ├── lifetime_coercion.md
│ │ │ ├── methods.md
│ │ │ ├── static_lifetime.md
│ │ │ ├── struct.md
│ │ │ └── trait.md
│ │ ├── lifetime.md
│ │ ├── move/
│ │ │ ├── mut.md
│ │ │ └── partial_move.md
│ │ ├── move.md
│ │ └── raii.md
│ ├── scope.md
│ ├── std/
│ │ ├── arc.md
│ │ ├── box.md
│ │ ├── hash/
│ │ │ ├── alt_key_types.md
│ │ │ └── hashset.md
│ │ ├── hash.md
│ │ ├── option.md
│ │ ├── panic.md
│ │ ├── rc.md
│ │ ├── result/
│ │ │ └── question_mark.md
│ │ ├── result.md
│ │ ├── str.md
│ │ └── vec.md
│ ├── std.md
│ ├── std_misc/
│ │ ├── arg/
│ │ │ └── matching.md
│ │ ├── arg.md
│ │ ├── channels.md
│ │ ├── ffi.md
│ │ ├── file/
│ │ │ ├── create.md
│ │ │ ├── open.md
│ │ │ └── read_lines.md
│ │ ├── file.md
│ │ ├── fs.md
│ │ ├── path.md
│ │ ├── process/
│ │ │ ├── pipe.md
│ │ │ └── wait.md
│ │ ├── process.md
│ │ ├── threads/
│ │ │ └── testcase_mapreduce.md
│ │ └── threads.md
│ ├── std_misc.md
│ ├── testing/
│ │ ├── dev_dependencies.md
│ │ ├── doc_testing.md
│ │ ├── integration_testing.md
│ │ └── unit_testing.md
│ ├── testing.md
│ ├── trait/
│ │ ├── clone.md
│ │ ├── derive.md
│ │ ├── disambiguating.md
│ │ ├── drop.md
│ │ ├── dyn.md
│ │ ├── impl_trait.md
│ │ ├── iter.md
│ │ ├── ops.md
│ │ └── supertraits.md
│ ├── trait.md
│ ├── types/
│ │ ├── alias.md
│ │ ├── cast.md
│ │ ├── inference.md
│ │ └── literals.md
│ ├── types.md
│ ├── unsafe/
│ │ └── asm.md
│ ├── unsafe.md
│ ├── variable_bindings/
│ │ ├── declare.md
│ │ ├── freeze.md
│ │ ├── mut.md
│ │ └── scope.md
│ └── variable_bindings.md
├── theme/
│ ├── css/
│ │ └── language-picker.css
│ └── head.hbs
└── triagebot.toml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto eol=lf
================================================
FILE: .github/workflows/rbe.yml
================================================
name: CI
on: [push, pull_request]
env:
# Update the language picker in index.hbs to link new languages.
LANGUAGES: ja zh es ko
MDBOOK_VERSION: 0.5.1
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# We need the full history below.
fetch-depth: 0
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install nightly -c rust-docs
rustup default nightly
- name: Install mdbook
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Install mdbook-i18n-helpers
run: |
cargo install mdbook-i18n-helpers --locked --version 0.4.0
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run tests
run: mdbook test
- name: Build HTML
run: mdbook build
- name: Check for broken links
run: |
curl -sSLo linkcheck.sh \
https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all rust-by-example
- name: Build all translations
run: |
for po_lang in ${{ env.LANGUAGES }}; do
echo "::group::Building $po_lang translation"
# Set language and adjust site URL. Clear the redirects
# since they are in sync with the source files, not the
# translation.
MDBOOK_BOOK__LANGUAGE=$po_lang \
mdbook build -d book/$po_lang
echo "::endgroup::"
done
- name: Check all translations for broken links
run: |
for po_lang in ${{ env.LANGUAGES }}; do
MDBOOK_BOOK__LANGUAGE=$po_lang \
sh linkcheck.sh --all rust-by-example
done
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: rust-by-example
path: book
================================================
FILE: .gitignore
================================================
book
po/messages.pot
.vscode/
# Auto-generated files from macOS
.DS_Store
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# The Rust Code of Conduct
A version of this document [can be found online](https://www.rust-lang.org/conduct.html).
## Conduct
**Contact**: [rust-mods@rust-lang.org](mailto:rust-mods@rust-lang.org)
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
* Please be kind and courteous. There's no need to be mean or rude.
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the [Citizen Code of Conduct](http://citizencodeofconduct.org/); if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
## Moderation
These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation, please contact the [Rust moderation team][mod_team].
1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
3. Moderators will first respond to such remarks with a warning.
4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed.
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
[mod_team]: https://www.rust-lang.org/team.html#Moderation-team
================================================
FILE: CONTRIBUTING.md
================================================
# Rust by Example contribution guidelines
Thank you for your interest in making Rust by Example (also known as RBE)
better! We'd love to have your contribution. We expect all contributors to
abide by the [Rust code of conduct], which you can find at that link or in the
[`CODE_OF_CONDUCT.md`] file in this repository.
[Rust code of conduct]: https://www.rust-lang.org/policies/code-of-conduct
[`CODE_OF_CONDUCT.md`]: https://github.com/rust-lang/rust-by-example/blob/master/CODE_OF_CONDUCT.md
## License
RBE is dual licensed under the MIT and Apache 2.0 licenses, and so are all
contributions. Please see the [`LICENSE-MIT`] and [`LICENSE-APACHE`] files in
this directory for more details.
[`LICENSE-MIT`]: https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-MIT
[`LICENSE-APACHE`]: https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-APACHE
## Pull Requests
To make changes to RBE, please send in pull requests on GitHub to the `master`
branch. We'll review them and either merge or request changes. Travis CI tests
everything as well, so you may get feedback from it too.
If you make additions or other changes to a pull request, feel free to either amend
previous commits or only add new ones, however you prefer. We may ask you to squash
your commits before merging, depending.
## Issue Tracker
You can find the issue tracker [on
GitHub](https://github.com/rust-lang/rust-by-example/issues). If you've found a
problem with RBE, please open an issue there.
We use the following labels:
* `enhancement`: This is for any request for new sections or functionality.
* `bug`: This is for anything that's in RBE, but incorrect or not working.
* `discussion`: A discussion about improving something in RBE; this may lead to new
enhancement or bug issues.
* `E-mentor`: This issue has someone dedicated to helping a new contributor fix it!
Can apply to both enhancement or bug issues.
## Development workflow
To build RBE, [install Rust](https://www.rust-lang.org/tools/install), and then:
```bash
$ git clone https://github.com/rust-lang/rust-by-example
$ cd rust-by-example
$ cargo install mdbook
$ mdbook build
```
**The following warnings can be ignored safely.**
```text
WARN The command `mdbook-gettext` for preprocessor `gettext` was not found, but is marked as optional.
```
[install Rust]: http://rust-lang.org/install.html
The files will be in the `book` directory at the top-level; `mdbook serve` will
open the contents in your web browser ([localhost:3000](http://localhost:3000) by default).
To run the tests:
```bash
$ mdbook test
```
If you're adding a new chapter, you'll need to edit `src\SUMMARY.md` to add it. If
you're tweaking an existing example, you'll need to edit the corresponding file; check
`src\SUMMARY.md` to see a mapping of where chapters go to files.
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: LICENSE-MIT
================================================
Copyright (c) 2014 Jorge Aparicio
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Rust By Example
[](https://github.com/rust-lang/rust-by-example/actions)
Learn Rust with examples (Live code editor included)
## Using
If you'd like to read Rust by Example, you can visit <https://doc.rust-lang.org/rust-by-example/>
to read it online.
If you'd like to read it locally, [install Rust], and then:
```bash
git clone https://github.com/rust-lang/rust-by-example
cd rust-by-example
cargo install mdbook
mdbook build
mdbook serve
```
[install Rust]: https://www.rust-lang.org/tools/install
To be able to run the examples, you must be connected to the internet; you can
read all content offline, however!
**The following warnings can be ignored safely.**
```text
WARN The command `mdbook-gettext` for preprocessor `gettext` was not found, but is marked as optional.
```
### Using translated version
If there is a translated resource in `po/` directory, it can be specified through `MDBOOK_BOOK__LANGUAGE` like below:
```bash
git clone https://github.com/rust-lang/rust-by-example
cd rust-by-example
cargo install mdbook
MDBOOK_BOOK__LANGUAGE=ja mdbook build
MDBOOK_BOOK__LANGUAGE=ja mdbook serve
```
## Contributing
Please see the [CONTRIBUTING.md] file for more details.
[CONTRIBUTING.md]: https://github.com/rust-lang/rust-by-example/blob/master/CONTRIBUTING.md
## Translating
Please see the [TRANSLATING.md] file for more details.
[TRANSLATING.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING.md
### Translating guide for each languages
* Japanese/日本語: [TRANSLATING_JA.md]
[TRANSLATING_JA.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_JA.md
* Chinese/中文: [TRANSLATING_ZH.md]
[TRANSLATING_ZH.md]: https://github.com/rust-lang/rust-by-example/blob/master/TRANSLATING_ZH.md
## Translations to other languages
* [Bulgarian](https://github.com/kberov/rust-by-example-bg)
* [French](https://github.com/Songbird0/FR_RBE)
* [Russian](https://github.com/ruRust/rust-by-example)
* [Vietnamese](https://github.com/EyesCrypto-Insights/rust-by-example-vn)
* [Portuguese](https://github.com/nazarepiedady/rust-com-exemplos)
## License
Rust by Example is licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
<http://www.apache.org/licenses/LICENSE-2.0>)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or
<http://opensource.org/licenses/MIT>)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rust by Example by you, as defined in the Apache-2.0 license, shall be
dually licensed as above, without any additional terms or conditions.
================================================
FILE: TRANSLATING.md
================================================
# Rust by Example translation guidelines
Please see the [CONTRIBUTING.md] file for general contribution guidelines.
This file describes about the translation workflow.
[CONTRIBUTING.md]: https://github.com/rust-lang/rust-by-example/blob/master/CONTRIBUTING.md
## Translation workflow
### Preparation
RBE uses [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) as a translation framework.
The following tools are required.
* GNU gettext utilities ( `msgmerge` and `msgcat` )
* mdbook-i18n-helpers ( `cargo install mdbook-i18n-helpers` )
### Creating and Updating Translations
Please see the [mdbook-i18n-helpers USAGE](https://github.com/google/mdbook-i18n-helpers/blob/main/i18n-helpers/USAGE.md) file for the detailed usage of mdbook-i18n-helpers.
The summarized command list is below:
#### Generating a message template
The generated message templete `po/messages.pot` is required to create or update translations.
```bash
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot"}}' \
mdbook build -d po
```
#### Creating a new translation resource
`xx` is [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code.
```bash
msginit -i po/messages.pot -l xx -o po/xx.po
```
#### Updating the existing translation resource
```bash
msgmerge --update po/xx.po po/messages.pot
```
#### Tracking translation progress
```bash
msgfmt --statistics po/xx.po
```
### Editing translation resources
After generating a translation resource `po/xx.po`, you can write translation messages in `msgstr` entry of `po/xx.po`.
To build a translated book, the following command can be used.
```bash
MDBOOK_BOOK__LANGUAGE=xx mdbook build
MDBOOK_BOOK__LANGUAGE=xx mdbook serve
```
### Add a language entry
Please add a language entry in `.github/workflows/rbe.yml`, `theme/head.hbs`, and `src/bootstrap/src/core/build_steps/doc.rs` in [rust-lang/rust](https://github.com/rust-lang/rust) like below:
* `rbe.yml`
```yml
env:
# Update the language picker in index.hbs to link new languages.
LANGUAGES: xx yy zz
```
* `head.hbs`
```html
<ul id="language-list" class="theme-popup" aria-label="Languages" role="menu">
<li role="none"><button role="menuitem" class="theme">
<a id="en">English</a>
</button></li>
<li role="none"><button role="menuitem" class="theme">
<a id="xx">XX language</a>
</button></li>
<li role="none"><button role="menuitem" class="theme">
<a id="yy">YY language</a>
</button></li>
<li role="none"><button role="menuitem" class="theme">
<a id="zz">ZZ language</a>
</button></li>
</ul>
```
* `src/bootstrap/src/core/build_steps/doc.rs` in [rust-lang/rust](https://github.com/rust-lang/rust)
```rust
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["xx", "yy", "zz"], submodule;
```
================================================
FILE: TRANSLATING_JA.md
================================================
# Rust by Example 日本語版 翻訳ガイド
日本語版の翻訳は https://github.com/rust-lang-ja/rust-by-example にて日本語のレビューを行います。
翻訳に貢献される方は以下のフローに従ってください。
* https://github.com/rust-lang/rust-by-example を自身のアカウントにフォークする
* `po/ja.po` に訳文を追加・変更する
* https://github.com/rust-lang-ja/rust-by-example (の`ja`ブランチ)にプルリクエストを出す
+ 直接オリジナルのリポジトリに出しても訳文自体のレビューができないので rust-lang-ja で一旦レビューします
+ 上記リポジトリは`ja`ブランチがデフォルトなので通常通りプルリクエストを作成すれば`ja`ブランチ向けになります
rust-lang-ja のレビュワーは以下のように作業します。
* プルリクエストをレビューし、問題なければ`ja`ブランチにマージ
* https://github.com/rust-lang/rust-by-example にプルリクエストを出す
最終的に https://github.com/rust-lang/rust-by-example でマージされれば公開されます。
## 翻訳の方法
### 全般的なこと
* 文体は「です・ます」調
* 記号類は原則として全角(括弧`()`やコロン`:`など)
### 対訳表
* カタカナ語のままで違和感のない用語はカタカナ語のまま使う
+ 気持としては「無理矢理和訳」を避けたい。そのための基準。
+ カタカナ語の方が用語として認識しやすい
* カタカナ語の末尾の長音記号「ー」は省く(JIS規格)
* 構文キーワードなどはそのままアルファベットを使う
| English | 日本語
| :------------------------------- | :-------------
| (lockの) acquire | 獲得
| (lockの) release | 解放
| Intrinsics | Intrinsic
| Lang Items | Lang Item
| Universal Function Call Syntax | 共通の関数呼び出し構文
| abort | アボート
| activity | 実践
| aggregate type | 合成型
| alignment | アラインメント
| allocator | アロケータ
| antipattern | アンチパターン
| application | アプリケーション
| argument type | 引数タイプ
| arity | アリティ
| array | 配列
| assignment | 代入
| associated - | 関連-
| atomic | アトミック
| attribute | アトリビュート
| binary | バイナリ
| binding | 束縛
| block | ブロック
| borrow checker | 借用チェッカー
| borrowing | 借用
| bounds | 境界
| bug | バグ
| capture | キャプチャ
| case analysis | 場合分け
| casting | キャスト
| channel | チャネル
| closure | クロージャ
| code bloat | コードの膨張
| coercion | 型強制
| color model | カラーモデル
| combinator | コンビネータ
| comma | カンマ
| command line | コマンドライン
| compile-time error | コンパイル時エラー
| compiler | コンパイラ
| composable | 合成可能
| computer science | コンピュータサイエンス
| concurrency | 並行性
| constant | 定数
| constructor | コンストラクタ
| continuous integration | 継続的インテグレーション
| crate | クレート
| custom type | カスタム型
| dangling | ダングリング
| data race | データ競合
| deadlock | デッドロック
| declaration statement | 宣言文
| dereferencing | 参照外し
| derive | 導出
| designator | 識別子
| destructor | デストラクタ
| destructuring | 分配
| directive | ディレクティブ
| directory | ディレクトリ
| discriminant | 判別子
| distribution | 配布物
| diverge | ダイバージ
| diverging | ダイバージング
| diverging function | 発散する関数
| documentation comment | ドキュメンテーションコメント
| documentation test | ドキュメンテーションテスト
| early return | 早期リターン
| empty tuple | 空タプル
| encode | エンコード
| endpoint | エンドポイント
| entry point | エントリポイント
| enum | 列挙型
| equality | 等値性
| ergonomic | エルゴノミック(人間にとって扱いやすいもの)
| error | エラー
| error handling | エラーハンドリング
| executable | 実行可能形式
| existentially quantified type | 存在量型
| expression statement | 式文
| exterior | 外側の
| feature | フィーチャ
| field | フィールド
| foreign | 他言語
| free-standing function | フリースタンディングな関数
| full path | 絶対パス
| generic parameter | ジェネリックパラメータ
| generics | ジェネリクス
| glob | グロブ
| growable | 伸張可能
| guard | ガード
| handle | ハンドル
| hash | ハッシュ
| hash set | ハッシュ集合
| higher order functions | 高階関数
| identifier | 識別子
| immutability | イミュータビリティ
| immutable | イミュータブル
| implement | 実装する
| initialize | 初期化する
| input lifetime | 入力ライフタイム
| install | インストール
| installer | インストーラ
| interior | 内側の
| interpolate | インターポーレートする
| interpolation | インターポーレーション
| key | キー
| keyword | キーワード
| leak | リーク
| least significant bit | 最下位ビット
| lending | 貸付け
| library | ライブラリ
| lifetime | ライフタイム
| lifetime coercion | ライフタイムの圧縮
| lifetime elision | ライフタイムの省略
| lifetime parameter | ライフタイムパラメータ
| link | リンク
| lint | リント
| mangling | マングリング
| match | マッチ
| memory | メモリ
| method | メソッド
| monomorphization | 単相化
| move | ムーブ
| mutability | ミュータビリティ
| mutable | ミュータブル
| mutable binding | ミュータブルな束縛
| mutual-exclusion | 相互排他
| null | ヌル
| numeric literal | 数値リテラル
| object-safe | オブジェクト安全
| offline | オフライン
| opaque | オペーク
| open source | オープンソース
| option | オプション
| output lifetime | 出力ライフタイム
| output type | アウトプット型
| overflow | オーバーフロー
| owner | 所有者
| ownership | 所有権
| panic | パニック
| parameter | パラメータ
| parametric polymorphism | パラメトリック多相
| parse | パース、パースする
| partial moves | 部分的ムーブ
| patch | パッチ
| pattern | パターン
| performance | パフォーマンス
| phantom type | 幽霊型
| platform | プラットフォーム
| pointer | ポインタ
| primitive type | プリミティブ型
| private | プライベート
| process | プロセス
| public | パブリック
| r-value | 右辺値
| range | レンジ
| raw pointer | 生ポインタ
| raw identifier | 生識別子
| re-assignment | 再代入
| rebind | 再束縛
| reference count | 参照カウント
| regression | リグレッション
| release | リリース
| return | 返す
| return type | リターン型
| return value | 戻り値
| runtime | 実行時
| safe | 安全
| safety check | 安全性検査
| scope | スコープ
| scoped | スコープ化された
| script | スクリプト
| semantics | セマンティクス
| shadow | 覆い隠す
| shadowing | シャドーイング
| signature | シグネチャ
| signed | 符号付き
| slice | スライス
| slicing | スライシング
| specialized | 特殊化された
| standard library | 標準ライブラリ
| string | 文字列
| string interpolation | 文字列インターポーレーション
| struct | 構造体
| structure | 構造体
| sum type | 直和型
| subtrait | サブトレイト
| supertrait | スーパートレイト
| symbol | シンボル
| syntactic sugar | 糖衣構文
| syntax tree | 構文木
| system | システム
| tagged union | タグ付き共用体
| term | 項
| thread-locality | スレッドローカル性
| threadsafe | スレッドセーフ
| tick | クオート
| token trees | トークン木
| trait | トレイト
| transmute | トランスミュート
| tuple | タプル
| tuple struct | タプル
| type alias | 型エイリアス
| type erasure | 型消去
| type family | 型族
| type inference | 型推論
| type parameter | 型パラメータ
| uninstall | アンインストール
| unit 注: `()` の読み | ユニット
| unsafe | アンセーフ
| unsigned | 符号無し
| unsized type | サイズ不定型
| unwinding | 巻き戻し
| unwrap | アンラップ
| value constructor | 値コンストラクタ
| variable | 変数
| variable binding | 変数束縛
| variant | ヴァリアント
| vector | ベクタ
| version | バージョン
| warning | ウォーニング
| wildcard | ワイルドカード
| wrapper | ラッパ
================================================
FILE: TRANSLATING_ZH.md
================================================
# Rust by Example 中文版翻译指南
Rust by Example 中文版的翻译在 https://github.com/rust-lang-cn/rust-by-example 仓库进行审核和校对。
如果您希望参与翻译,请按照以下流程操作:
1. 复刻(fork)https://github.com/rust-lang/rust-by-example 仓库。
2. 在 `po/zh.po` 文件中添加或修改译文。
3. 向 https://github.com/rust-lang-cn/rust-by-example 仓库的 `zh` 分支提交 PR(Pull Request)。
- 先在 rust-lang-cn 仓库进行审校,而非直接向原始仓库提交 PR,这样可以更方便进行译文讨论。
- 中文社区仓库的默认分支为 `zh`,因此正常创建 PR 时会自动指向该分支。
rust-lang-cn 翻译组成员的维护流程:
1. 审核并校对提交的 PR,先合并到 `zh` 分支。
2. 向 https://github.com/rust-lang/rust-by-example 原始仓库提交 PR。
## 翻译规范
### 总体原则
* 文风应保持正式、清晰、简洁
* 标点符号原则上使用全角(如括号"()"和冒号":"等)
### 术语翻译指南
* 对于已经广泛接受的技术术语,保留英文或使用通用的中文翻译
* 避免生硬的直译,优先考虑符合中文语境的自然表达
* 保持术语翻译的一致性,可参考 [Rust 语言术语中英文对照表](https://github.com/rust-lang-cn/english-chinese-glossary-of-rust/blob/master/rust-glossary.md)
================================================
FILE: book.toml
================================================
[book]
title = "Rust By Example"
description = "Rust by Example (RBE) is a collection of runnable examples that illustrate various Rust concepts and standard libraries."
authors = ["The Rust Community"]
[output.html.playpen]
editable = true
line-numbers = true
[output.html.fold]
enable = true
[output.html]
git-repository-url = "https://github.com/rust-lang/rust-by-example"
edit-url-template = "https://github.com/rust-lang/rust-by-example/edit/master/{path}"
hash-files = true
additional-css = [
"theme/css/language-picker.css",
]
[output.html.search]
use-boolean-and = true
[rust]
edition = "2021"
[build]
extra-watch-dirs = ["po"]
[preprocessor.gettext]
optional = true
after = ["links"]
================================================
FILE: po/es.po
================================================
msgid ""
msgstr ""
"Project-Id-Version: Rust By Example\n"
"POT-Creation-Date: 2025-01-30T21:37:19-06:00\n"
"PO-Revision-Date: 2025-01-30 21:37-06:00\n"
"Last-Translator: mrg <miguelraz@gmail.com>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: src/SUMMARY.md:1
msgid "Summary"
msgstr "Resumen"
#: src/SUMMARY.md:3
msgid "Introduction"
msgstr "Introducción"
#: src/SUMMARY.md:5 src/hello.md:1
msgid "Hello World"
msgstr "Hola Mundo"
#: src/SUMMARY.md:6 src/hello/comment.md:1
msgid "Comments"
msgstr "Comentarios"
#: src/SUMMARY.md:7 src/hello/print.md:1
msgid "Formatted print"
msgstr "Imprimir con formatos"
#: src/SUMMARY.md:8 src/hello/print/print_debug.md:1
msgid "Debug"
msgstr "Depuración"
#: src/SUMMARY.md:9 src/hello/print/print_display.md:1
msgid "Display"
msgstr ""
#: src/SUMMARY.md:10 src/hello/print/print_display/testcase_list.md:1
msgid "Testcase: List"
msgstr "Ejemplot: Lista"
#: src/SUMMARY.md:11 src/hello/print/fmt.md:1
msgid "Formatting"
msgstr "Formateo"
#: src/SUMMARY.md:13 src/primitives.md:1
msgid "Primitives"
msgstr "Primitivas"
#: src/SUMMARY.md:14 src/primitives/literals.md:1
msgid "Literals and operators"
msgstr "Operadores y Literales"
#: src/SUMMARY.md:15 src/primitives/tuples.md:1
msgid "Tuples"
msgstr "Tuplas"
#: src/SUMMARY.md:16 src/primitives/array.md:1
msgid "Arrays and Slices"
msgstr "Arreglos y slices"
#: src/SUMMARY.md:18 src/custom_types.md:1
msgid "Custom Types"
msgstr "Tipos Personalizados"
#: src/SUMMARY.md:19 src/custom_types/structs.md:1
msgid "Structures"
msgstr "Estructuras"
#: src/SUMMARY.md:20 src/custom_types/enum.md:1
msgid "Enums"
msgstr "Enums"
#: src/SUMMARY.md:21 src/custom_types/enum/enum_use.md:1
msgid "use"
msgstr ""
#: src/SUMMARY.md:22 src/custom_types/enum/c_like.md:1
msgid "C-like"
msgstr "Herencias de C"
#: src/SUMMARY.md:23 src/custom_types/enum/testcase_linked_list.md:1
msgid "Testcase: linked-list"
msgstr "Ejemplo: lista ligada"
#: src/SUMMARY.md:24 src/custom_types/constants.md:1
msgid "constants"
msgstr "constantes"
#: src/SUMMARY.md:26 src/variable_bindings.md:1
msgid "Variable Bindings"
msgstr "Enlaces de variables"
#: src/SUMMARY.md:27 src/SUMMARY.md:120 src/SUMMARY.md:123
#: src/variable_bindings/mut.md:1 src/scope/move/mut.md:1
#: src/scope/borrow/mut.md:1
msgid "Mutability"
msgstr "Mutabilidad"
#: src/SUMMARY.md:28 src/variable_bindings/scope.md:1
msgid "Scope and Shadowing"
msgstr "Alcance y sombreo"
#: src/SUMMARY.md:29 src/variable_bindings/declare.md:1
msgid "Declare first"
msgstr "Declara primero"
#: src/SUMMARY.md:30 src/variable_bindings/freeze.md:1
msgid "Freezing"
msgstr "Congelar"
#: src/SUMMARY.md:32 src/types.md:1
msgid "Types"
msgstr "Tipos"
#: src/SUMMARY.md:33 src/types/cast.md:1
msgid "Casting"
msgstr "Casteo"
#: src/SUMMARY.md:34 src/types/literals.md:1
msgid "Literals"
msgstr "Literales"
#: src/SUMMARY.md:35 src/types/inference.md:1
msgid "Inference"
msgstr "Inferencia"
#: src/SUMMARY.md:36 src/SUMMARY.md:124 src/types/alias.md:1
#: src/scope/borrow/alias.md:1
msgid "Aliasing"
msgstr "Aliasing"
#: src/SUMMARY.md:38 src/conversion.md:1
msgid "Conversion"
msgstr "Conversión"
#: src/SUMMARY.md:39 src/conversion/from_into.md:1
msgid "`From` and `Into`"
msgstr "`From` e `Into`"
#: src/SUMMARY.md:40 src/conversion/try_from_try_into.md:1
msgid "`TryFrom` and `TryInto`"
msgstr "`TryFrom` y `TryInto`"
#: src/SUMMARY.md:41
msgid "To and from `String`s"
msgstr "De y hacia `String`s"
#: src/SUMMARY.md:43 src/expression.md:1
msgid "Expressions"
msgstr "Expresiones"
#: src/SUMMARY.md:45 src/flow_control.md:1
msgid "Flow of Control"
msgstr "Control de Flujo"
#: src/SUMMARY.md:46 src/flow_control/if_else.md:1
msgid "if/else"
msgstr ""
#: src/SUMMARY.md:47 src/flow_control/loop.md:1
msgid "loop"
msgstr ""
#: src/SUMMARY.md:48 src/flow_control/loop/nested.md:1
msgid "Nesting and labels"
msgstr ""
#: src/SUMMARY.md:49 src/flow_control/loop/return.md:1
msgid "Returning from loops"
msgstr "Retornar desde bucles"
#: src/SUMMARY.md:50 src/flow_control/while.md:1
msgid "while"
msgstr ""
#: src/SUMMARY.md:51 src/flow_control/for.md:3
msgid "for and range"
msgstr "for y range"
#: src/SUMMARY.md:52 src/flow_control/match.md:1
msgid "match"
msgstr ""
#: src/SUMMARY.md:53 src/flow_control/match/destructuring.md:1
msgid "Destructuring"
msgstr "Destructura"
#: src/SUMMARY.md:54
#: src/flow_control/match/destructuring/destructure_tuple.md:1
msgid "tuples"
msgstr "tuplas"
#: src/SUMMARY.md:55
#: src/flow_control/match/destructuring/destructure_slice.md:1
msgid "arrays/slices"
msgstr "arreglos/slices"
#: src/SUMMARY.md:56 src/flow_control/match/destructuring/destructure_enum.md:1
msgid "enums"
msgstr ""
#: src/SUMMARY.md:57
#: src/flow_control/match/destructuring/destructure_pointers.md:1
msgid "pointers/ref"
msgstr "punteros/ref"
#: src/SUMMARY.md:58
#: src/flow_control/match/destructuring/destructure_structures.md:1
msgid "structs"
msgstr ""
#: src/SUMMARY.md:59 src/flow_control/match/guard.md:1
msgid "Guards"
msgstr "Guardias"
#: src/SUMMARY.md:60 src/flow_control/match/binding.md:1
msgid "Binding"
msgstr "Enlaces"
#: src/SUMMARY.md:61 src/flow_control/if_let.md:1
msgid "if let"
msgstr ""
#: src/SUMMARY.md:62 src/flow_control/let_else.md:1
msgid "let-else"
msgstr ""
#: src/SUMMARY.md:63 src/flow_control/while_let.md:1
msgid "while let"
msgstr ""
#: src/SUMMARY.md:65 src/SUMMARY.md:103 src/SUMMARY.md:128 src/fn.md:1
#: src/generics/gen_fn.md:1 src/scope/lifetime/fn.md:1
msgid "Functions"
msgstr "Funciones"
#: src/SUMMARY.md:66 src/SUMMARY.md:129 src/scope/lifetime/methods.md:1
msgid "Methods"
msgstr "Métodos"
#: src/SUMMARY.md:67 src/fn/closures.md:1
msgid "Closures"
msgstr ""
#: src/SUMMARY.md:68 src/fn/closures/capture.md:1
msgid "Capturing"
msgstr "Capturas"
#: src/SUMMARY.md:69 src/fn/closures/input_parameters.md:1
msgid "As input parameters"
msgstr "Como parámetros de entrada"
#: src/SUMMARY.md:70 src/fn/closures/anonymity.md:1
msgid "Type anonymity"
msgstr "Anonimidad de tipos"
#: src/SUMMARY.md:71 src/fn/closures/input_functions.md:1
msgid "Input functions"
msgstr "Funciones de entrada"
#: src/SUMMARY.md:72 src/fn/closures/output_parameters.md:1
msgid "As output parameters"
msgstr "Como parámetros de salida"
#: src/SUMMARY.md:73 src/fn/closures/closure_examples.md:1
msgid "Examples in `std`"
msgstr "Ejemplos de `std`"
#: src/SUMMARY.md:74 src/fn/closures/closure_examples/iter_any.md:1
msgid "Iterator::any"
msgstr ""
#: src/SUMMARY.md:75 src/fn/closures/closure_examples/iter_find.md:1
msgid "Searching through iterators"
msgstr "Buscando con iteradores"
#: src/SUMMARY.md:76 src/fn/hof.md:1
msgid "Higher Order Functions"
msgstr "Funciones de Mayor Orden"
#: src/SUMMARY.md:77 src/fn/diverging.md:1
msgid "Diverging functions"
msgstr "Funciones Divergentes"
#: src/SUMMARY.md:79 src/mod.md:1
msgid "Modules"
msgstr "Módulos"
#: src/SUMMARY.md:80 src/mod/visibility.md:1
msgid "Visibility"
msgstr "Visibilidad"
#: src/SUMMARY.md:81 src/mod/struct_visibility.md:1
msgid "Struct visibility"
msgstr "Visibilidad de estructuras"
#: src/SUMMARY.md:82 src/mod/use.md:1
msgid "The `use` declaration"
msgstr "La declaración `use`"
#: src/SUMMARY.md:83 src/mod/super.md:1
msgid "`super` and `self`"
msgstr "`super` y `self`"
#: src/SUMMARY.md:84 src/mod/split.md:1
msgid "File hierarchy"
msgstr "Jerarquía de archivos"
#: src/SUMMARY.md:86 src/SUMMARY.md:98 src/crates.md:1 src/attribute/crate.md:1
#: src/std_misc/arg.md:30
msgid "Crates"
msgstr ""
#: src/SUMMARY.md:87 src/crates/lib.md:1
msgid "Creating a Library"
msgstr "Creando una Library"
#: src/SUMMARY.md:88 src/crates/using_lib.md:1
msgid "Using a Library"
msgstr "Usando un Library"
#: src/SUMMARY.md:90 src/cargo.md:1
msgid "Cargo"
msgstr ""
#: src/SUMMARY.md:91 src/cargo/deps.md:1
msgid "Dependencies"
msgstr "Dependencias"
#: src/SUMMARY.md:92 src/cargo/conventions.md:1
msgid "Conventions"
msgstr "Convenciones"
#: src/SUMMARY.md:93
msgid "Tests"
msgstr ""
#: src/SUMMARY.md:94 src/cargo/build_scripts.md:1
msgid "Build Scripts"
msgstr "Scripts de Build"
#: src/SUMMARY.md:96 src/attribute.md:1
msgid "Attributes"
msgstr "Atributos"
#: src/SUMMARY.md:97 src/attribute/unused.md:1
msgid "`dead_code`"
msgstr ""
#: src/SUMMARY.md:99 src/attribute/cfg.md:1
msgid "`cfg`"
msgstr ""
#: src/SUMMARY.md:100 src/attribute/cfg/custom.md:1
msgid "Custom"
msgstr "Personalizaciones"
#: src/SUMMARY.md:102 src/generics.md:1
msgid "Generics"
msgstr "Genéricos"
#: src/SUMMARY.md:104 src/generics/impl.md:1
msgid "Implementation"
msgstr "Implementación"
#: src/SUMMARY.md:105 src/SUMMARY.md:131 src/SUMMARY.md:137
#: src/generics/gen_trait.md:1 src/scope/lifetime/trait.md:1 src/trait.md:1
msgid "Traits"
msgstr ""
#: src/SUMMARY.md:106 src/SUMMARY.md:132 src/generics/bounds.md:1
#: src/scope/lifetime/lifetime_bounds.md:1
msgid "Bounds"
msgstr "Cotas"
#: src/SUMMARY.md:107 src/generics/bounds/testcase_empty.md:1
msgid "Testcase: empty bounds"
msgstr "Ejemplo: cotas vacías"
#: src/SUMMARY.md:108 src/generics/multi_bounds.md:1
msgid "Multiple bounds"
msgstr "Cotas Múltiples"
#: src/SUMMARY.md:109 src/generics/where.md:1
msgid "Where clauses"
msgstr "Cláusulas where"
#: src/SUMMARY.md:110 src/generics/new_types.md:1
msgid "New Type Idiom"
msgstr "Modismo New Type"
#: src/SUMMARY.md:111 src/generics/assoc_items.md:1
msgid "Associated items"
msgstr "Ítems asociados"
#: src/SUMMARY.md:112 src/generics/assoc_items/the_problem.md:1
msgid "The Problem"
msgstr "El Problema"
#: src/SUMMARY.md:113 src/generics/assoc_items/types.md:1
msgid "Associated types"
msgstr "Tipos Asociados"
#: src/SUMMARY.md:114 src/generics/phantom.md:1
msgid "Phantom type parameters"
msgstr "Parámetros Phantom Type"
#: src/SUMMARY.md:115 src/generics/phantom/testcase_units.md:1
msgid "Testcase: unit clarification"
msgstr "Ejemplo: clarificación de unidades"
#: src/SUMMARY.md:117 src/scope.md:1
msgid "Scoping rules"
msgstr "Reglas de alcance"
#: src/SUMMARY.md:118 src/scope/raii.md:1
msgid "RAII"
msgstr ""
#: src/SUMMARY.md:119 src/scope/move.md:1
msgid "Ownership and moves"
msgstr "Ownership y moves"
#: src/SUMMARY.md:121 src/scope/move/partial_move.md:1
msgid "Partial moves"
msgstr "Moves parciales"
#: src/SUMMARY.md:122 src/scope/borrow.md:1
msgid "Borrowing"
msgstr ""
#: src/SUMMARY.md:125 src/scope/borrow/ref.md:1
msgid "The ref pattern"
msgstr "El patrón de ref"
#: src/SUMMARY.md:126 src/scope/lifetime.md:1
msgid "Lifetimes"
msgstr ""
#: src/SUMMARY.md:127 src/scope/lifetime/explicit.md:1
msgid "Explicit annotation"
msgstr "Anotación explícita"
#: src/SUMMARY.md:130 src/scope/lifetime/struct.md:1
msgid "Structs"
msgstr ""
#: src/SUMMARY.md:133 src/scope/lifetime/lifetime_coercion.md:1
msgid "Coercion"
msgstr "Coerción"
#: src/SUMMARY.md:134 src/scope/lifetime/static_lifetime.md:1
msgid "Static"
msgstr ""
#: src/SUMMARY.md:135 src/scope/lifetime/elision.md:1
msgid "Elision"
msgstr "Elisión"
#: src/SUMMARY.md:138 src/trait/derive.md:1
msgid "Derive"
msgstr ""
#: src/SUMMARY.md:139 src/trait/dyn.md:1
msgid "Returning Traits with `dyn`"
msgstr "Retornando Traits con `dyn`"
#: src/SUMMARY.md:140 src/trait/ops.md:1
msgid "Operator Overloading"
msgstr "Sobrecarga de Operadores"
#: src/SUMMARY.md:141 src/trait/drop.md:1
msgid "Drop"
msgstr ""
#: src/SUMMARY.md:142 src/trait/iter.md:1
msgid "Iterators"
msgstr ""
#: src/SUMMARY.md:143 src/trait/impl_trait.md:1
msgid "`impl Trait`"
msgstr ""
#: src/SUMMARY.md:144 src/trait/clone.md:1
msgid "Clone"
msgstr ""
#: src/SUMMARY.md:145 src/trait/supertraits.md:1
msgid "Supertraits"
msgstr ""
#: src/SUMMARY.md:146 src/trait/disambiguating.md:1
msgid "Disambiguating overlapping traits"
msgstr "Desambiguando traits empalmados"
#: src/SUMMARY.md:148
msgid "macro_rules!"
msgstr ""
#: src/SUMMARY.md:149 src/macros/syntax.md:1
msgid "Syntax"
msgstr "Sintaxis"
#: src/SUMMARY.md:150 src/macros/designators.md:1
msgid "Designators"
msgstr "Designadores"
#: src/SUMMARY.md:151 src/macros/overload.md:1
msgid "Overload"
msgstr "Sobrecarga"
#: src/SUMMARY.md:152 src/macros/repeat.md:1
msgid "Repeat"
msgstr "Repetición"
#: src/SUMMARY.md:153 src/macros/dry.md:1
msgid "DRY (Don't Repeat Yourself)"
msgstr ""
#: src/SUMMARY.md:154
msgid "DSL (Domain Specific Languages)"
msgstr ""
#: src/SUMMARY.md:155
msgid "Variadics"
msgstr "Variádicas"
#: src/SUMMARY.md:157 src/error.md:1
msgid "Error handling"
msgstr "Manejo de Errores"
#: src/SUMMARY.md:158 src/error/panic.md:1
msgid "`panic`"
msgstr ""
#: src/SUMMARY.md:159
msgid "`abort` & `unwind`"
msgstr ""
#: src/SUMMARY.md:160 src/error/option_unwrap.md:1
msgid "`Option` & `unwrap`"
msgstr ""
#: src/SUMMARY.md:161 src/error/option_unwrap/question_mark.md:1
msgid "Unpacking options with `?`"
msgstr "Desempacando Options con `?`"
#: src/SUMMARY.md:162 src/error/option_unwrap/map.md:1
msgid "Combinators: `map`"
msgstr "Combinadores: `map`"
#: src/SUMMARY.md:163 src/error/option_unwrap/and_then.md:1
msgid "Combinators: `and_then`"
msgstr "Combinadores: `and_then`"
#: src/SUMMARY.md:164
msgid "Defaults: `or`, `or_else`, `get_or_insert`, `get_or_insert_with`"
msgstr ""
#: src/SUMMARY.md:165 src/SUMMARY.md:183 src/error/result.md:1
#: src/std/result.md:1
msgid "`Result`"
msgstr ""
#: src/SUMMARY.md:166 src/error/result/result_map.md:1
msgid "`map` for `Result`"
msgstr ""
#: src/SUMMARY.md:167 src/error/result/result_alias.md:1
msgid "aliases for `Result`"
msgstr "aliases para `Result`"
#: src/SUMMARY.md:168 src/error/result/early_returns.md:1
msgid "Early returns"
msgstr "Retornos tempranos"
#: src/SUMMARY.md:169 src/error/result/enter_question_mark.md:1
msgid "Introducing `?`"
msgstr "Introduciendo `?`"
#: src/SUMMARY.md:170 src/error/multiple_error_types.md:1
msgid "Multiple error types"
msgstr "Mùltiples tipos de errores"
#: src/SUMMARY.md:171 src/error/multiple_error_types/option_result.md:1
msgid "Pulling `Result`s out of `Option`s"
msgstr "Sacando `Result`s de `Option`s"
#: src/SUMMARY.md:172 src/error/multiple_error_types/define_error_type.md:1
msgid "Defining an error type"
msgstr "Definiendo un tipo de error"
#: src/SUMMARY.md:173 src/error/multiple_error_types/boxing_errors.md:1
msgid "`Box`ing errors"
msgstr "`Box`ing de errores"
#: src/SUMMARY.md:174 src/error/multiple_error_types/reenter_question_mark.md:1
msgid "Other uses of `?`"
msgstr "Otros usos de `?`"
#: src/SUMMARY.md:175 src/error/multiple_error_types/wrap_error.md:1
msgid "Wrapping errors"
msgstr "Envolviendo errores"
#: src/SUMMARY.md:176 src/error/iter_result.md:1
msgid "Iterating over `Result`s"
msgstr "Iterando sobre `Result`s"
#: src/SUMMARY.md:178 src/std.md:1
msgid "Std library types"
msgstr "Tipos de la biblioteca std"
#: src/SUMMARY.md:179 src/std/box.md:1
msgid "Box, stack and heap"
msgstr "Box, stack y heap"
#: src/SUMMARY.md:180 src/std/vec.md:1
msgid "Vectors"
msgstr "Vectores"
#: src/SUMMARY.md:181 src/std/str.md:1
msgid "Strings"
msgstr "Cadenas"
#: src/SUMMARY.md:182 src/std/option.md:1
msgid "`Option`"
msgstr "`Option`"
#: src/SUMMARY.md:184 src/std/result/question_mark.md:1
msgid "`?`"
msgstr "`?`"
#: src/SUMMARY.md:185 src/std/panic.md:1
msgid "`panic!`"
msgstr ""
#: src/SUMMARY.md:186 src/std/hash.md:1
msgid "HashMap"
msgstr ""
#: src/SUMMARY.md:187 src/std/hash/alt_key_types.md:1
msgid "Alternate/custom key types"
msgstr "Tipos de llaves personalizadas/alternas"
#: src/SUMMARY.md:188 src/std/hash/hashset.md:1
msgid "HashSet"
msgstr ""
#: src/SUMMARY.md:189 src/std/rc.md:1
msgid "`Rc`"
msgstr ""
#: src/SUMMARY.md:190
msgid "`Arc`"
msgstr ""
#: src/SUMMARY.md:192 src/std_misc.md:1
msgid "Std misc"
msgstr ""
#: src/SUMMARY.md:193 src/std_misc.md:6 src/std_misc/threads.md:1
msgid "Threads"
msgstr "Hilos"
#: src/SUMMARY.md:194 src/std_misc/threads/testcase_mapreduce.md:1
msgid "Testcase: map-reduce"
msgstr "Ejemplo: map-reduce"
#: src/SUMMARY.md:195 src/std_misc.md:7 src/std_misc/channels.md:1
msgid "Channels"
msgstr "Canales"
#: src/SUMMARY.md:196 src/std_misc/path.md:1
msgid "Path"
msgstr ""
#: src/SUMMARY.md:197 src/std_misc.md:8 src/std_misc/file.md:1
msgid "File I/O"
msgstr ""
#: src/SUMMARY.md:198 src/std_misc/file/open.md:1
msgid "`open`"
msgstr ""
#: src/SUMMARY.md:199 src/std_misc/file/create.md:1
msgid "`create`"
msgstr ""
#: src/SUMMARY.md:200 src/std_misc/file/read_lines.md:1
msgid "`read_lines`"
msgstr ""
#: src/SUMMARY.md:201 src/std_misc/process.md:1
msgid "Child processes"
msgstr "Procesos hijos"
#: src/SUMMARY.md:202 src/std_misc/process/pipe.md:1
msgid "Pipes"
msgstr ""
#: src/SUMMARY.md:203 src/std_misc/process/wait.md:1
msgid "Wait"
msgstr ""
#: src/SUMMARY.md:204 src/std_misc/fs.md:1
msgid "Filesystem Operations"
msgstr "Operaciones de Sistema Operativo"
#: src/SUMMARY.md:205 src/std_misc/arg.md:1
msgid "Program arguments"
msgstr "Argumentos del Programa"
#: src/SUMMARY.md:206 src/std_misc/arg/matching.md:1
msgid "Argument parsing"
msgstr "Parse de argumentos"
#: src/SUMMARY.md:207 src/std_misc/ffi.md:1
msgid "Foreign Function Interface"
msgstr ""
#: src/SUMMARY.md:209 src/cargo/test.md:1 src/testing.md:1
msgid "Testing"
msgstr "Pruebas"
#: src/SUMMARY.md:210 src/testing/unit_testing.md:1
msgid "Unit testing"
msgstr "Pruebas Unitarias"
#: src/SUMMARY.md:211 src/testing/doc_testing.md:1
msgid "Documentation testing"
msgstr "Pruebas de Documentación"
#: src/SUMMARY.md:212 src/testing/integration_testing.md:1
msgid "Integration testing"
msgstr "Pruebas de integración"
#: src/SUMMARY.md:213
msgid "Dev-dependencies"
msgstr "Dependencias de desarrollo"
#: src/SUMMARY.md:215 src/unsafe.md:1
msgid "Unsafe Operations"
msgstr "Operaciones Unsafe"
#: src/SUMMARY.md:216 src/unsafe/asm.md:1
msgid "Inline assembly"
msgstr "Ensamblador Inline"
#: src/SUMMARY.md:218 src/compatibility.md:1
msgid "Compatibility"
msgstr "Compatibilidad "
#: src/SUMMARY.md:219 src/compatibility/raw_identifiers.md:1
msgid "Raw identifiers"
msgstr "Identificadores llanos"
#: src/SUMMARY.md:221 src/meta.md:1
msgid "Meta"
msgstr ""
#: src/SUMMARY.md:222 src/meta/doc.md:1
msgid "Documentation"
msgstr "Documentación"
#: src/SUMMARY.md:223 src/meta/playground.md:1
msgid "Playground"
msgstr ""
#: src/index.md:1
msgid "Rust by Example"
msgstr ""
#: src/index.md:3
msgid ""
"[Rust](https://www.rust-lang.org/) is a modern systems programming language "
"focusing on safety, speed, and concurrency. It accomplishes these goals by "
"being memory safe without using garbage collection."
msgstr ""
"[Rust] (https://www.rust-lang.org/) es un lenguaje de programación de "
"sistemas modernosconcentrado en la seguridad, la velocidad y la "
"concurrencia. Logra estos objetivos altener seguridad de memoria sin usar la "
"recolección de basura."
#: src/index.md:7
msgid ""
"Rust by Example (RBE) is a collection of runnable examples that illustrate "
"various Rust concepts and standard libraries. To get even more out of these "
"examples, don't forget to [install Rust locally](https://www.rust-lang.org/"
"tools/install) and check out the [official docs](https://doc.rust-lang.org/"
"std/). Additionally for the curious, you can also [check out the source code "
"for this site](https://github.com/rust-lang/rust-by-example)."
msgstr ""
"Rust By Example (RBE) es una colección de ejemplos ejecutables que "
"ilustranvarios conceptos de Rust y sus biblioteca estándar. Para obtener aún "
"más de estosejemplos, no olvide [instalar Rust localmente] (https://www.rust-"
"lang.org/tools/install) y consulte los [documentos oficiales](https://doc."
"rust-lang.org/std/). Además, para la gente curiosa, también puede [ver el "
"código fuentepara este sitio](https://github.com/rust-lang/rust-by-example)."
#: src/index.md:12
msgid "Now let's begin!"
msgstr "¡Comencemos!"
#: src/index.md:14
msgid "[Hello World](hello.md) - Start with a traditional Hello World program."
msgstr ""
"[Hola Mundo](hello.md) - Empieza con el programa tradicional Hola Mundo."
#: src/index.md:16
msgid ""
"[Primitives](primitives.md) - Learn about signed integers, unsigned integers "
"and other primitives."
msgstr ""
"[Primitivas](primitives.md) - Aprende sobre enteros con signo, enteros sin "
"signo y otras primitivas."
#: src/index.md:18
msgid "[Custom Types](custom_types.md) - `struct` and `enum`."
msgstr "[Tipos Personalizados](custom_types.md) - `struct` y `enum`."
#: src/index.md:20
msgid ""
"[Variable Bindings](variable_bindings.md) - mutable bindings, scope, "
"shadowing."
msgstr ""
"[Enlaces de Variables](variable_bindings.md) - enlaces mutables, alcance, "
"sombreo."
#: src/index.md:22
msgid "[Types](types.md) - Learn about changing and defining types."
msgstr "[Tipos](types.md) - Aprende sobre cómo cambiar y definir tipos."
#: src/index.md:24
msgid ""
"[Conversion](conversion.md) - Convert between different types, such as "
"strings, integers, and floats."
msgstr ""
"[Conversión](conversion.md) - Convertir entre diferentes tipos, como "
"cadenas, enteros y flotantes."
#: src/index.md:26
msgid ""
"[Expressions](expression.md) - Learn about Expressions & how to use them."
msgstr ""
"[Expresiones](expression.md) - Aprenda sobre expresiones y cómo usarlas."
#: src/index.md:28
msgid "[Flow of Control](flow_control.md) - `if`/`else`, `for`, and others."
msgstr "[Control de Flujo](flow_control.md) - `if`/`else`, `for`, y otros."
#: src/index.md:30
msgid ""
"[Functions](fn.md) - Learn about Methods, Closures and Higher Order "
"Functions."
msgstr ""
"[Funciones](fn.md) - Aprender sobre métodos, closures y Funciones de Orden "
"Superior."
#: src/index.md:32
msgid "[Modules](mod.md) - Organize code using modules"
msgstr "[Módulos](mod.md) - Organizar código usando módulos"
#: src/index.md:34
msgid ""
"[Crates](crates.md) - A crate is a compilation unit in Rust. Learn to create "
"a library."
msgstr ""
"[Crates](crates.md) - Una caja es una unidad de compilación en Rust. Aprende "
"a crear una biblioteca."
#: src/index.md:36
msgid ""
"[Cargo](cargo.md) - Go through some basic features of the official Rust "
"package management tool."
msgstr ""
"[Cargo](cargo.md) - Realice algunas características básicas de la "
"herramienta de Rust oficial gestión de paquetes."
#: src/index.md:38
msgid ""
"[Attributes](attribute.md) - An attribute is metadata applied to some "
"module, crate or item."
msgstr ""
"[Atributos](attribute.md) - Un atributo son metadatos aplicados a algún "
"módulo, crate o ítem."
#: src/index.md:40
msgid ""
"[Generics](generics.md) - Learn about writing a function or data type which "
"can work for multiple types of arguments."
msgstr ""
"[Genéricos](generics.md) - Aprenda a escribir una función o tipo de datos "
"que puede funcionar para múltiples tipos de argumentos."
#: src/index.md:42
msgid ""
"[Scoping rules](scope.md) - Scopes play an important part in ownership, "
"borrowing, and lifetimes."
msgstr ""
"[Reglas de alcance](scope.md) - Los alcances juegan un papel importante del "
"ownership, borrowing y lifetimes."
#: src/index.md:44
msgid ""
"[Traits](trait.md) - A trait is a collection of methods defined for an "
"unknown type: `Self`"
msgstr ""
"[Traits](trait.md) - Un trait es una colección de métodos definidos para un "
"tipo desconocido: 'Self'"
#: src/index.md:46
msgid ""
"[Macros](macros.md) - Macros are a way of writing code that writes other "
"code, which is known as metaprogramming."
msgstr ""
"[Macros](macros.md) - Las macros son una forma de escribir código que "
"escribe a otroscódigos, lo cual se conoce como metaprogramación."
#: src/index.md:48
msgid "[Error handling](error.md) - Learn Rust way of handling failures."
msgstr "[Manejo de Errores](error.md) - Aprende a manejar errores con Rust."
#: src/index.md:50
msgid ""
"[Std library types](std.md) - Learn about some custom types provided by "
"`std` library."
msgstr ""
"[Tipos de la librería std](std.md) - Aprenda sobre algunos tipos de la "
"librería`std`."
#: src/index.md:52
msgid "[Std misc](std_misc.md) - More custom types for file handling, threads."
msgstr ""
"[Std misc](std_misc.md) - Más tipos personalizados para el manejo de "
"archivos, hilos."
#: src/index.md:54
#, fuzzy
msgid "[Testing](testing.md) - All sorts of testing in Rust."
msgstr "[Pruebas](testing.md) - Todo tipo de pruebas en Rust."
#: src/index.md:56
msgid ""
"[Unsafe Operations](unsafe.md) - Learn about entering a block of unsafe "
"operations."
msgstr ""
"[Operaciones Unsafe](unsafe.md) - Aprenda sobre el uso de bloques de "
"operaciones unsafe."
#: src/index.md:58
msgid ""
"[Compatibility](compatibility.md) - Handling Rust's evolution and potential "
"compatibility issues."
msgstr ""
"[Compatibilidad](compatibility.md) - Manejo de la evolución de Rust y "
"potenciales problemas de compatibilidad."
#: src/index.md:60
msgid "[Meta](meta.md) - Documentation, Benchmarking."
msgstr "[Meta](meta.md) - Documentación, Benchmarking."
#: src/hello.md:3
msgid "This is the source code of the traditional Hello World program."
msgstr "Este es el código fuente del programa tradicional Hello World."
#: src/hello.md:6
msgid ""
"// This is a comment, and is ignored by the compiler.\n"
"// You can test this code by clicking the \"Run\" button over there ->\n"
"// or if you prefer to use your keyboard, you can use the \"Ctrl + Enter\"\n"
"// shortcut.\n"
msgstr ""
"// Este es un comentario, y es ignorado por el compilador.\n"
"// Puede probar este código haciendo clic en el botón \"Run\" allí -> \n"
"// o si prefiere usar su teclado, puede usar el atajo \"Ctrl + Enter\".\n"
#: src/hello.md:10
msgid ""
"// This code is editable, feel free to hack it!\n"
"// You can always return to the original code by clicking the \"Reset\" "
"button ->\n"
msgstr ""
"// Este código es editable, ¡siéntete libre de hackearlo!\n"
"// Siempre puede volver al código original haciendo clic en \"Reset\" botón -"
"> \n"
#: src/hello.md:13
msgid "// This is the main function.\n"
msgstr "// Esta es la función main"
#: src/hello.md:16
msgid "// Statements here are executed when the compiled binary is called.\n"
msgstr ""
"// Las oraciones aquí se ejecutan cuando el binario compilado es llamado.\n"
#: src/hello.md:18
msgid "// Print text to the console.\n"
msgstr "// Imprime el texto a la consola.\n"
#: src/hello.md:19 src/error/result.md:55 src/meta/playground.md:12
msgid "\"Hello World!\""
msgstr "\"Hello World!\""
#: src/hello.md:23
msgid "`println!` is a [_macro_](macros.md) that prints text to the console."
msgstr "`println!` es un [_macro_](macros.md) que imprime text a la consola."
#: src/hello.md:26
msgid "A binary can be generated using the Rust compiler: `rustc`."
msgstr "Un binario se puede generar usand el compilador de Rust: `rustc`."
#: src/hello.md:32
msgid "`rustc` will produce a `hello` binary that can be executed."
msgstr "`rustc` producirá un binario `hello` que puede ser ejecutado."
#: src/hello.md:39 src/hello/print/print_display.md:107
#: src/hello/print/print_display/testcase_list.md:53 src/hello/print/fmt.md:70
#: src/primitives/tuples.md:64 src/custom_types/structs.md:89
msgid "Activity"
msgstr "Actividad"
#: src/hello.md:41
msgid ""
"Click 'Run' above to see the expected output. Next, add a new line with a "
"second `println!` macro so that the output shows:"
msgstr ""
"Haga clic en 'Run' arriba para ver la salida esperada. A continuación, "
"agregue una nueva línea con unsegundo `println!` macro para que la salida "
"muestre:"
#: src/hello/comment.md:3
msgid ""
"Any program requires comments, and Rust supports a few different varieties:"
msgstr ""
"Cualquier programa requiere comentarios, y Rust admite algunas variedades "
"diferentes:"
#: src/hello/comment.md:6
msgid "_Regular comments_ which are ignored by the compiler:"
msgstr "_Comentarios regulares_ que el compilador ignora:"
#: src/hello/comment.md:7
msgid "`// Line comments which go to the end of the line.`"
msgstr "`// Comentarios de línea que van al final de la línea.`"
#: src/hello/comment.md:8
msgid "`/* Block comments which go to the closing delimiter. */`"
msgstr "`/* Comentarios de bloque que van al delimitador de cierre. */`"
#: src/hello/comment.md:9
msgid ""
"_Doc comments_ which are parsed into HTML library [documentation](../meta/"
"doc.md):"
msgstr ""
"_Comentarios de Doc_ que se parsean en la librería HTML [documentation](../ "
"meta/doc.md):"
#: src/hello/comment.md:10
msgid "`/// Generate library docs for the following item.`"
msgstr "`/// Genera docs de librería para el siguiente elemento.`"
#: src/hello/comment.md:11
msgid "`//! Generate library docs for the enclosing item.`"
msgstr "`//! Genera docs de librería para el artículo adjunto.`"
#: src/hello/comment.md:15
msgid ""
"// This is an example of a line comment.\n"
" // There are two slashes at the beginning of the line.\n"
" // And nothing written after these will be read by the compiler.\n"
msgstr ""
"// Este es un ejemplo de un comentario de línea.\n"
" // Hay dos slashes al comienzo de la línea.\n"
" // y nada escrito después de estos será leído por el compilador.\n"
#: src/hello/comment.md:19
msgid "// println!(\"Hello, world!\");\n"
msgstr ""
#: src/hello/comment.md:21
msgid "// Run it. See? Now try deleting the two slashes, and run it again.\n"
msgstr ""
"// Ejecútalo. ¿Ves? Ahora intenta eliminar las dos barras y ejecútalo "
"nuevamente.\n"
#: src/hello/comment.md:23
msgid ""
"/*\n"
" * This is another type of comment, a block comment. In general,\n"
" * line comments are the recommended comment style. But block comments\n"
" * are extremely useful for temporarily disabling chunks of code.\n"
" * /* Block comments can be /* nested, */ */ so it takes only a few\n"
" * keystrokes to comment out everything in this main() function.\n"
" * /*/*/* Try it yourself! */*/*/\n"
" */"
msgstr ""
"/*\n"
"orte * Este es otro tipo de comentario, un comentario en bloque. En "
"general,\n"
" * los comentarios de línea son el estilo de comentarios recomendado. "
"Pero los comentarios de bloque\n"
" * son extremadamente útiles para deshabilitar temporalmente los "
"segmentos de código.\n"
" * /* Los comentarios de bloque pueden ser /* anidados, */ */ por lo que "
"solo se necesitan unos pocos\n"
" * teclazos para comentar todo en esta función main().\n"
" * /*/*/*¡Pruébalo! */*/*/\n"
" */"
#: src/hello/comment.md:32
msgid ""
"/*\n"
" Note: The previous column of `*` was entirely for style. There's\n"
" no actual need for it.\n"
" */"
msgstr ""
"/*\n"
" Nota: la columna anterior a `*` es completamente por estilo. No hay\n"
" hay necesidad real para ello. \n"
" */"
#: src/hello/comment.md:37
msgid ""
"// You can manipulate expressions more easily with block comments\n"
" // than with line comments. Try deleting the comment delimiters\n"
" // to change the result:\n"
msgstr ""
"// Puede manipular expresiones más fácilmente con comentarios de bloque \n"
" // que con comentarios de línea. Intente eliminar los delimitadores de "
"comentarios\n"
" // para cambiar el resultado:\n"
#: src/hello/comment.md:40
msgid "/* 90 + */"
msgstr ""
#: src/hello/comment.md:41
msgid "\"Is `x` 10 or 100? x = {}\""
msgstr "\"¿Es `x` 10 ó 100? x = {}\""
#: src/hello/comment.md:45 src/hello/print.md:103
#: src/hello/print/print_debug.md:75 src/hello/print/print_display.md:118
#: src/hello/print/print_display/testcase_list.md:62 src/hello/print/fmt.md:89
#: src/primitives.md:64 src/custom_types/enum.md:100
#: src/custom_types/enum/enum_use.md:45 src/custom_types/enum/c_like.md:33
#: src/custom_types/enum/testcase_linked_list.md:77
#: src/custom_types/constants.md:35 src/types/alias.md:30
#: src/flow_control/for.md:121
#: src/flow_control/match/destructuring/destructure_tuple.md:25
#: src/flow_control/match/destructuring/destructure_slice.md:46
#: src/flow_control/match/destructuring/destructure_enum.md:48
#: src/flow_control/match/destructuring/destructure_pointers.md:63
#: src/flow_control/match/destructuring/destructure_structures.md:45
#: src/flow_control/match/guard.md:43 src/flow_control/match/binding.md:49
#: src/flow_control/if_let.md:118 src/flow_control/let_else.md:55
#: src/flow_control/while_let.md:56 src/fn/closures/capture.md:110
#: src/fn/closures/input_parameters.md:84 src/fn/closures/anonymity.md:47
#: src/fn/closures/input_functions.md:32
#: src/fn/closures/output_parameters.md:49
#: src/fn/closures/closure_examples/iter_any.md:50
#: src/fn/closures/closure_examples/iter_find.md:68
#: src/mod/struct_visibility.md:53 src/attribute/cfg.md:39 src/generics.md:59
#: src/generics/gen_fn.md:54 src/generics/impl.md:48
#: src/generics/gen_trait.md:39 src/generics/bounds.md:73
#: src/generics/bounds/testcase_empty.md:37 src/generics/multi_bounds.md:32
#: src/generics/where.md:49 src/generics/new_types.md:54
#: src/generics/assoc_items.md:10 src/generics/assoc_items/the_problem.md:62
#: src/generics/phantom.md:56 src/generics/phantom/testcase_units.md:75
#: src/scope/raii.md:92 src/scope/move/partial_move.md:57
#: src/scope/borrow/mut.md:56 src/scope/lifetime/explicit.md:68
#: src/scope/lifetime/fn.md:58 src/scope/lifetime/methods.md:24
#: src/scope/lifetime/struct.md:41 src/scope/lifetime/trait.md:28
#: src/scope/lifetime/lifetime_bounds.md:46
#: src/scope/lifetime/static_lifetime.md:133 src/scope/lifetime/elision.md:39
#: src/trait/derive.md:65 src/trait/supertraits.md:40
#: src/trait/disambiguating.md:60 src/error/option_unwrap/map.md:79
#: src/error/option_unwrap/and_then.md:73
#: src/error/option_unwrap/defaults.md:115 src/error/result/result_alias.md:41
#: src/error/multiple_error_types/boxing_errors.md:57
#: src/error/multiple_error_types/reenter_question_mark.md:74
#: src/error/multiple_error_types/wrap_error.md:91 src/std.md:12
#: src/std/rc.md:55 src/std_misc.md:12
#: src/std_misc/threads/testcase_mapreduce.md:129 src/std_misc/path.md:54
#: src/std_misc/fs.md:150 src/meta/doc.md:109 src/meta/playground.md:49
msgid "See also:"
msgstr "Ver también"
#: src/hello/comment.md:47
msgid "[Library documentation](../meta/doc.md)"
msgstr "[Documentación de Librerías](../meta/doc.md)"
#: src/hello/print.md:3
msgid ""
"Printing is handled by a series of [`macros`](../macros.md) defined in "
"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) some of which are:"
msgstr ""
"La impresión se maneja por una serie de [`macros`](../macros.md) definida "
"en[`std::fmt`](https://doc.rust-lang.org/std/fmt/) algunos de los cuales "
"son: "
#: src/hello/print.md:6
msgid "`format!`: write formatted text to [`String`](../std/str.md)"
msgstr "`format!`: escribe el texto formateado a un [`String`](../std/str.md)"
#: src/hello/print.md:7
msgid ""
"`print!`: same as `format!` but the text is printed to the console (io::"
"stdout)."
msgstr ""
"`print!`: igual que `format!` pero el texto se imprime a la consola (io::"
"stdout)."
#: src/hello/print.md:9
msgid "`println!`: same as `print!` but a newline is appended."
msgstr "`println!`: es igual que `print!` pero se agrega un salto de línea"
#: src/hello/print.md:10
msgid ""
"`eprint!`: same as `print!` but the text is printed to the standard error "
"(io::stderr)."
msgstr ""
"`eprint!`: igual que `print!` pero el texto se imprime al error estándar "
"(io::stderr)."
#: src/hello/print.md:12
msgid "`eprintln!`: same as `eprint!` but a newline is appended."
msgstr "`eprintln!`: es igual que `eprint!` pero se agrega un salto de línea"
#: src/hello/print.md:14
#, fuzzy
msgid ""
"All parse text in the same fashion. As a plus, Rust checks formatting "
"correctness at compile time."
msgstr ""
"Parsea todo el texta de la misma manera. Como beneficio, Rust verifica el "
"formato // de los argumentos. Serán convertidos en cadenas.\n"
#: src/hello/print.md:19
#, fuzzy
msgid ""
"// In general, the `{}` will be automatically replaced with any\n"
" // arguments. These will be stringified.\n"
msgstr ""
"Parsea todo el texta de la misma manera. Como beneficio, Rust verifica el "
"formato // de los argumentos. Serán convertidos en cadenas.\n"
#: src/hello/print.md:21
msgid "\"{} days\""
msgstr "\"{} días\""
#: src/hello/print.md:23
msgid ""
"// Positional arguments can be used. Specifying an integer inside `{}`\n"
" // determines which additional argument will be replaced. Arguments "
"start\n"
" // at 0 immediately after the format string.\n"
msgstr ""
"// Se pueden usar argumentos posicionales. Especificar un entero dentro de "
"`{}`\n"
" // determina qué argumento adicional será reemplazado. Los "
"argumentoscomienzan \n"
" // en 0 inmediatamente después de la cadena de formato.\n"
#: src/hello/print.md:26
msgid "\"{0}, this is {1}. {1}, this is {0}\""
msgstr "\"{0}, esto es {1}. {1}, este es {0}\""
#: src/hello/print.md:26 src/scope/move/partial_move.md:31
msgid "\"Alice\""
msgstr "\"Alice\""
#: src/hello/print.md:26 src/flow_control/for.md:65 src/flow_control/for.md:85
#: src/flow_control/for.md:104
msgid "\"Bob\""
msgstr "\"Bob\""
#: src/hello/print.md:28
msgid "// As can named arguments.\n"
msgstr "// Como los argumentos nombrados.\n"
#: src/hello/print.md:29
msgid "\"{subject} {verb} {object}\""
msgstr "\"{sujeto} {verbo} {objeto}\""
#: src/hello/print.md:30
msgid "\"the lazy dog\""
msgstr ""
#: src/hello/print.md:31
msgid "\"the quick brown fox\""
msgstr ""
#: src/hello/print.md:32
msgid "\"jumps over\""
msgstr ""
#: src/hello/print.md:34
msgid ""
"// Different formatting can be invoked by specifying the format character\n"
" // after a `:`.\n"
msgstr ""
"// Se puede invocar diferentes formatos especificando el carácter del "
"formato\n"
" // después de un `:`.\n"
#: src/hello/print.md:36
msgid "\"Base 10: {}\""
msgstr ""
#: src/hello/print.md:36
msgid "// 69420\n"
msgstr ""
#: src/hello/print.md:37
msgid "\"Base 2 (binary): {:b}\""
msgstr "\"Base 2 (binario): {:b}\""
#: src/hello/print.md:37
msgid "// 10000111100101100\n"
msgstr ""
#: src/hello/print.md:38
msgid "\"Base 8 (octal): {:o}\""
msgstr ""
#: src/hello/print.md:38
msgid "// 207454\n"
msgstr ""
#: src/hello/print.md:39
msgid "\"Base 16 (hexadecimal): {:x}\""
msgstr ""
#: src/hello/print.md:39
msgid "// 10f2c\n"
msgstr ""
#: src/hello/print.md:41
msgid ""
"// You can right-justify text with a specified width. This will\n"
" // output \" 1\". (Four white spaces and a \"1\", for a total width "
"of 5.)\n"
msgstr ""
"// Puedes justificar el texto a la derecha con un ancho especificado. Esto "
"será\n"
"// salida \" 1 \". (Cuatro espacios blancos y un \"1\", para un ancho "
"totalde 5.)\n"
#: src/hello/print.md:43
msgid "\"{number:>5}\""
msgstr "\"{numero:>5}\""
#: src/hello/print.md:45
msgid "// You can pad numbers with extra zeroes,\n"
msgstr "// Puedes rellenar números con ceros adicionales,\n"
#: src/hello/print.md:46
msgid "\"{number:0>5}\""
msgstr "\"{numero:0>5}\""
#: src/hello/print.md:46
msgid ""
"// 00001\n"
" // and left-adjust by flipping the sign. This will output \"10000\".\n"
msgstr ""
"// 00001\n"
" // y justificar a la izquierda volteando el signo. Esto imprimirá "
"\"10000\".\n"
#: src/hello/print.md:48
msgid "\"{number:0<5}\""
msgstr "\"{numero:0<5}\""
#: src/hello/print.md:48
msgid "// 10000\n"
msgstr ""
#: src/hello/print.md:50
msgid ""
"// You can use named arguments in the format specifier by appending a `$`.\n"
msgstr ""
"// Puede usar argumentos con nombre en el formato especificador agregando un "
"`$`.\n"
#: src/hello/print.md:51
msgid "\"{number:0>width$}\""
msgstr "\"{numero:0>ancho$}\""
#: src/hello/print.md:53
msgid ""
"// Rust even checks to make sure the correct number of arguments are used.\n"
msgstr ""
"// Rust incluso verifica para asegurarse de que se usen el número correcto "
"de argumentos.\n"
#: src/hello/print.md:54
msgid "\"My name is {0}, {1} {0}\""
msgstr "\"Mi nombre es {0}, {1} {0}\""
#: src/hello/print.md:54
msgid "\"Bond\""
msgstr ""
#: src/hello/print.md:55
msgid "// FIXME ^ Add the missing argument: \"James\"\n"
msgstr ""
#: src/hello/print.md:57
msgid ""
"// Only types that implement fmt::Display can be formatted with `{}`. User-\n"
" // defined types do not implement fmt::Display by default.\n"
msgstr ""
"// Sólo los tipos que implementan `fmt::Display` pueden formatearse con `{}"
"`.\n"
" // Los tipos definidos por usuario no implementan `fmt::Display` de forma "
"predeterminada.\n"
#: src/hello/print.md:60
msgid "// disable `dead_code` which warn against unused module\n"
msgstr "// deshabilita `dead_code` el cual advierte contra módulos no usados\n"
#: src/hello/print.md:63
msgid ""
"// This will not compile because `Structure` does not implement\n"
" // fmt::Display.\n"
" // println!(\"This struct `{}` won't print...\", Structure(3));\n"
" // TODO ^ Try uncommenting this line\n"
msgstr ""
"// Esto no se compilará porque `Structure` no implementa \n"
" // `fmt::Display`.\n"
" // println!(\"esta estructura `{}` no va a imprimir... \", "
"Structure(3));\n"
" // TAREA ^ intente quitar el comentario de esta línea \n"
#: src/hello/print.md:68
msgid ""
"// For Rust 1.58 and above, you can directly capture the argument from a\n"
" // surrounding variable. Just like the above, this will output\n"
" // \" 1\", 4 white spaces and a \"1\".\n"
msgstr ""
"// Para Rust 1.58 y superior, puedes capturar directamente el argumento de "
"una\n"
"// variable en el entorno. Al igual que lo anterior, esto imprimirá \n"
"// \" 1\", 4 espacios blancos y a \"1\".\n"
#: src/hello/print.md:73
msgid "\"{number:>width$}\""
msgstr "\"{numero:>ancho$}\""
#: src/hello/print.md:77
msgid ""
"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) contains many [`traits`]"
"(https://doc.rust-lang.org/std/fmt/#formatting-traits) which govern the "
"display of text. The base form of two important ones are listed below:"
msgstr ""
"[`std::fmt`](https://doc.rust-lang.org/std/fmt/) contiene muchos [`traits`]"
"(https://doc.rust-lang.org/std/fmt/#formatting-traits) que rigen la "
"visualización de texto. La forma básica de dos de ellos se enumera a "
"continuación:"
#: src/hello/print.md:80
msgid ""
"`fmt::Debug`: Uses the `{:?}` marker. Format text for debugging purposes."
msgstr ""
"`fmt::Debug`: Usa el marcador `{:?}`. Formatea el texto para fines de "
"depuración."
#: src/hello/print.md:81
msgid ""
"`fmt::Display`: Uses the `{}` marker. Format text in a more elegant, user "
"friendly fashion."
msgstr ""
"`fmt::Display`: Usa el marcador `{}`. Formatea texto de una manera más "
"elegante y amistosa."
#: src/hello/print.md:84
msgid ""
"Here, we used `fmt::Display` because the std library provides "
"implementations for these types. To print text for custom types, more steps "
"are required."
msgstr ""
"Aquí, usamos `fmt::Display` porque la librería std proporciona "
"implementaciones para estos tipos. Para imprimir tipos personalizados, más "
"pasosson necesarios"
#: src/hello/print.md:87
msgid ""
"Implementing the `fmt::Display` trait automatically implements the "
"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) trait "
"which allows us to [convert](../conversion/string.md) the type to [`String`]"
"(../std/str.md)."
msgstr ""
"Implementar el rasgo `fmt::Display` implementa automáticamente el trait "
"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) que "
"nos permite [convertir](../conversion/string.md) el tipo en [`String`](../"
"std/str.md)."
#: src/hello/print.md:90
msgid ""
"In _line 43_, `#[allow(dead_code)]` is an [attribute](../attribute.md) which "
"only applies to the module after it."
msgstr ""
"En la _línea 43_,`#[allow(dead_code)]` es un [atributo](../ attribute.md) "
"quesolo se aplica al módulo después de él."
#: src/hello/print.md:92
msgid "Activities"
msgstr "Actividades"
#: src/hello/print.md:94
msgid ""
"Fix the issue in the above code (see FIXME) so that it runs without error."
msgstr ""
"Solucione el problema en el código anterior (ver el ARRÉGLAME) para que se "
"ejecute sin error."
#: src/hello/print.md:96
msgid ""
"Try uncommenting the line that attempts to format the `Structure` struct "
"(see TODO)"
msgstr ""
"Intente quitar el comentario de la línea que intenta formatear la estructura "
"`Structure`(ver TAREA)"
#: src/hello/print.md:98
msgid ""
"Add a `println!` macro call that prints: `Pi is roughly 3.142` by "
"controlling the number of decimal places shown. For the purposes of this "
"exercise, use `let pi = 3.141592` as an estimate for pi. (Hint: you may need "
"to check the [`std::fmt`](https://doc.rust-lang.org/std/fmt/) documentation "
"for setting the number of decimals to display)"
msgstr ""
"Agregue un macro `println!` que imprima: ` Pi es aproximadamente 3.142` "
"controlando el número de decimales mostrados. Para efectos de esteejercicio, "
"use `let Pi = 3.141592` como una estimación para pi. (Sugerencia: "
"puedesconsultar la documentación de [`std::fmt`](https://doc.rust-lang.org/"
"std/fmt/)para configurar el número de decimales desplegados)"
#: src/hello/print.md:105
msgid ""
"[`std::fmt`](https://doc.rust-lang.org/std/fmt/), [`macros`](../macros.md), "
"[`struct`](../custom_types/structs.md), [`traits`](https://doc.rust-lang.org/"
"std/fmt/#formatting-traits), and [`dead_code`](../attribute/unused.md)"
msgstr ""
"[`std::fmt`](https://doc.rust-lang.org/std/fmt/), [`macros`](../macros.md), "
"[`struct`](../custom_types/structs.md), [`traits`](https://doc.rust-lang.org/"
"std/fmt/#formatting-traits), y [`dead_code`](../attribute/unused.md)"
#: src/hello/print/print_debug.md:3
msgid ""
"All types which want to use `std::fmt` formatting `traits` require an "
"implementation to be printable. Automatic implementations are only provided "
"for types such as in the `std` library. All others _must_ be manually "
"implemented somehow."
msgstr ""
"Todos los tipos que quieren usar los traits de `std::fmt` requieren "
"unaimplementación para ser imprimible. Las implementaciones automáticas solo "
"se proporcionanpara tipos como en la biblioteca `std`. Todos los demás tipos "
"_deben_ ser manualmente implementados de alguna manera."
#: src/hello/print/print_debug.md:8
msgid ""
"The `fmt::Debug` `trait` makes this very straightforward. _All_ types can "
"`derive` (automatically create) the `fmt::Debug` implementation. This is not "
"true for `fmt::Display` which must be manually implemented."
msgstr ""
"El trait `fmt::Debug` hace que esto sea muy sencillo. Todos Los tipos "
"pueden`Derive` (crear automáticamente) la implementación `fmt::Debug`. Esto "
"no ciertopara `fmt::Display` el cual debe implementarse manualmente."
#: src/hello/print/print_debug.md:13
msgid ""
"// This structure cannot be printed either with `fmt::Display` or\n"
"// with `fmt::Debug`.\n"
msgstr ""
"// Esta estructura no se puede imprimir con `fmt::Display` o \n"
"// con `fmt::Debug`.\n"
" "
#: src/hello/print/print_debug.md:16
msgid ""
"// The `derive` attribute automatically creates the implementation\n"
"// required to make this `struct` printable with `fmt::Debug`.\n"
msgstr ""
"// El atributo `derive` crea automáticamente la implementación \n"
" // requerida para hacer esta `struct` imprimible con `fmt::Debug`. \n"
#: src/hello/print/print_debug.md:23
msgid "All `std` library types are automatically printable with `{:?}` too:"
msgstr ""
"Todos los tipos de biblioteca `std` se pueden imprimir automáticamente con "
"`{:?}` también:"
#: src/hello/print/print_debug.md:26
msgid ""
"// Derive the `fmt::Debug` implementation for `Structure`. `Structure`\n"
"// is a structure which contains a single `i32`.\n"
msgstr ""
"// Derive la implementación `fmt::Debug` para `Structure`. `Structure`\n"
"// es una estructura que contiene un solo `i32`.\n"
" "
#: src/hello/print/print_debug.md:30
msgid ""
"// Put a `Structure` inside of the structure `Deep`. Make it printable\n"
"// also.\n"
msgstr ""
"// Ponga una `Structure` dentro de la estructura `Deep`. Házlo imprimible \n"
"// también.\n"
#: src/hello/print/print_debug.md:37
msgid "// Printing with `{:?}` is similar to with `{}`.\n"
msgstr "// Imprimir con `{:?}` es similar a imprimir con `{}`.\n"
#: src/hello/print/print_debug.md:38
msgid "\"{:?} months in a year.\""
msgstr "\"{:?} meses en un año.\""
#: src/hello/print/print_debug.md:39
msgid "\"{1:?} {0:?} is the {actor:?} name.\""
msgstr "\"{1:?} {0:?} es el nombre del {actor:?}.\""
#: src/hello/print/print_debug.md:40
msgid "\"Slater\""
msgstr ""
#: src/hello/print/print_debug.md:41
msgid "\"Christian\""
msgstr ""
#: src/hello/print/print_debug.md:42
msgid "\"actor's\""
msgstr ""
#: src/hello/print/print_debug.md:44
msgid "// `Structure` is printable!\n"
msgstr "// ¡`Structure` también se puede imprimir!\n"
#: src/hello/print/print_debug.md:45 src/hello/print/print_debug.md:49
msgid "\"Now {:?} will print!\""
msgstr "\"Ahora {:?} imprimirá \""
#: src/hello/print/print_debug.md:47
msgid ""
"// The problem with `derive` is there is no control over how\n"
" // the results look. What if I want this to just show a `7`?\n"
msgstr ""
"// El problema con 'derive` es que no hay control sobre cómo \n"
" // los resultados se ven. ¿Qué pasa si quiero que esto solo muestre un "
"`7`?\n"
#: src/hello/print/print_debug.md:53
msgid ""
"So `fmt::Debug` definitely makes this printable but sacrifices some "
"elegance. Rust also provides \"pretty printing\" with `{:#?}`."
msgstr ""
"Entonces `fmt::Debug` definitivamente hace esto imprimible pero sacrifica "
"algo deelegancia. Rust también proporciona \"Impresión Bonita\" con `{:#?}`."
#: src/hello/print/print_debug.md:64 src/custom_types/structs.md:42
msgid "\"Peter\""
msgstr ""
#: src/hello/print/print_debug.md:68
msgid "// Pretty print\n"
msgstr "// Impresión bonita"
#: src/hello/print/print_debug.md:69
msgid "\"{:#?}\""
msgstr ""
#: src/hello/print/print_debug.md:73
msgid "One can manually implement `fmt::Display` to control the display."
msgstr ""
"Se puede implementar manualmente `fmt::Display` para controlar la impresión."
#: src/hello/print/print_debug.md:77
msgid ""
"[`attributes`](https://doc.rust-lang.org/reference/attributes.html), "
"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
"std/fmt/), and [`struct`](../../custom_types/structs.md)"
msgstr ""
"[`attributes`](https://doc.rust-lang.org/reference/attributes.html), "
"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
"std/fmt/), y [`struct`](../../custom_types/structs.md)"
#: src/hello/print/print_display.md:3
msgid ""
"`fmt::Debug` hardly looks compact and clean, so it is often advantageous to "
"customize the output appearance. This is done by manually implementing "
"[`fmt::Display`](https://doc.rust-lang.org/std/fmt/), which uses the `{}` "
"print marker. Implementing it looks like this:"
msgstr ""
"`fmt::Debug` escasamente parece compacto y limpio, por lo que a menudo es "
"ventajoso personalizar la apariencia de salida. Esto se hace implementando "
"manualmente[`fmt::Display`](https://doc.rust-lang.org/std/fmt/), que usa el "
"marcador `{}`. Implementarlo se ve así:"
#: src/hello/print/print_display.md:9
msgid "// Import (via `use`) the `fmt` module to make it available.\n"
msgstr ""
"// Importar (a través de `use`) el módulo `fmt` para ponerlo a disposición.\n"
#: src/hello/print/print_display.md:11
msgid ""
"// Define a structure for which `fmt::Display` will be implemented. This is\n"
"// a tuple struct named `Structure` that contains an `i32`.\n"
msgstr ""
"// Defina una estructura para la cual se implementará `fmt::Display`. Esto "
"es\n"
" // una estructura de tupla llamada `Estructura` que contiene un `i32`. \n"
#: src/hello/print/print_display.md:15
msgid ""
"// To use the `{}` marker, the trait `fmt::Display` must be implemented\n"
"// manually for the type.\n"
msgstr ""
"// Para usar el marcador `{}`, el trait `fmt::Display` debe implementarse\n"
"// manualmente para el tipo. \n"
#: src/hello/print/print_display.md:19
msgid "// This trait requires `fmt` with this exact signature.\n"
msgstr "// Este trait requiere de `fmt` con estos tipos exactos.\n"
#: src/hello/print/print_display.md:21
msgid ""
"// Write strictly the first element into the supplied output\n"
" // stream: `f`. Returns `fmt::Result` which indicates whether the\n"
" // operation succeeded or failed. Note that `write!` uses syntax "
"which\n"
" // is very similar to `println!`.\n"
msgstr ""
"// Escribe sólo el primer elemento en la salida suministrada \n"
"// stream: `f`. Devuelve `fmt::Result` que indica si\n"
"// la operación tuvo éxito o falló. Tenga en cuenta que 'write!` usa una "
"sintaxis que \n"
"// es muy similar a `println!`. \n"
#: src/hello/print/print_display.md:25
#: src/hello/print/print_display/testcase_list.md:13
#: src/hello/print/print_display/testcase_list.md:39
#: src/hello/print/print_display/testcase_list.md:49 src/hello/print/fmt.md:53
#: src/custom_types/enum/testcase_linked_list.md:73 src/conversion/string.md:25
#: src/flow_control/loop.md:26 src/flow_control/while.md:21
#: src/flow_control/for.md:23 src/flow_control/for.md:43 src/fn.md:40
#: src/fn/closures/capture.md:96 src/fn/closures/capture.md:97
#: src/fn/closures/anonymity.md:41 src/generics/bounds.md:12
#: src/macros/repeat.md:24 src/macros/repeat.md:25 src/macros/repeat.md:26
#: src/error/result.md:73 src/std/str.md:92 src/std/str.md:102
#: src/std/str.md:106 src/std/str.md:111 src/std/result.md:72
#: src/std/result/question_mark.md:57 src/std/result/question_mark.md:65
#: src/std_misc/file/read_lines.md:60 src/std_misc/arg/matching.md:9
#: src/std_misc/arg/matching.md:13
msgid "\"{}\""
msgstr ""
#: src/hello/print/print_display.md:30
msgid ""
"`fmt::Display` may be cleaner than `fmt::Debug` but this presents a problem "
"for the `std` library. How should ambiguous types be displayed? For example, "
"if the `std` library implemented a single style for all `Vec<T>`, what style "
"should it be? Would it be either of these two?"
msgstr ""
"`fmt::Display` puede ser más limpio que `fmt::Debug` pero esto presenta un "
"problemapara la biblioteca `std`. ¿Cómo se deben mostrar los tipos ambiguos? "
"Por ejemplo, si la biblioteca `std` implementó un sólo estilo para todos los "
"`Vec<T>`, ¿qué estilo debería ser? ¿Sería cualquiera de estos dos?"
#: src/hello/print/print_display.md:35
msgid "`Vec<path>`: `/:/etc:/home/username:/bin` (split on `:`)"
msgstr "`Vec<path>`: `/:/etc:/home/usuario:/bin` (split on `:`)"
#: src/hello/print/print_display.md:36
msgid "`Vec<number>`: `1,2,3` (split on `,`)"
msgstr "`Vec<numero>`: `1,2,3` (partido en `,`)"
#: src/hello/print/print_display.md:38
msgid ""
"No, because there is no ideal style for all types and the `std` library "
"doesn't presume to dictate one. `fmt::Display` is not implemented for "
"`Vec<T>` or for any other generic containers. `fmt::Debug` must then be used "
"for these generic cases."
msgstr ""
"No, porque no hay un estilo ideal para todos los tipos y la biblioteca `std` "
"no presume dictar uno. `fmt::Display` no se implementa para `Vec<T>` o para "
"cualquier otro contenedor genérico. `Fmt::Debug` debe usarse para estos "
"casos genéricos."
#: src/hello/print/print_display.md:43
msgid ""
"This is not a problem though because for any new _container_ type which is "
"_not_ generic, `fmt::Display` can be implemented."
msgstr ""
"Sin embargo, esto no es un problema porque para cualquier nuevo tipo "
"_contenedor_ que sea_no_ genérico, se puede implementar `fmt::Display`."
#: src/hello/print/print_display.md:47
msgid "// Import `fmt`\n"
msgstr "// Importar `fmt`\n"
#: src/hello/print/print_display.md:48
msgid ""
"// A structure holding two numbers. `Debug` will be derived so the results "
"can\n"
"// be contrasted with `Display`.\n"
msgstr ""
"// Una estructura que contiene dos números. Se derivará `Debug` para que los "
"resultadospuedan// ser contrastados con `Display`.\n"
#: src/hello/print/print_display.md:53
msgid "// Implement `Display` for `MinMax`.\n"
msgstr "// Implementa `Display` para `MinMax`.\n"
#: src/hello/print/print_display.md:57
msgid "// Use `self.number` to refer to each positional data point.\n"
msgstr "// Usa `self.number` para referirte a cada dato posicional.\n"
#: src/hello/print/print_display.md:58
msgid "\"({}, {})\""
msgstr ""
#: src/hello/print/print_display.md:61
msgid "// Define a structure where the fields are nameable for comparison.\n"
msgstr ""
"// Define una estructura donde los campos se puedan nombrar para "
"compararse.\n"
#: src/hello/print/print_display.md:68
msgid "// Similarly, implement `Display` for `Point2D`.\n"
msgstr "// Similarmente, implementa `Display` para `Point2D`.\n"
#: src/hello/print/print_display.md:72
msgid "// Customize so only `x` and `y` are denoted.\n"
msgstr "// Personalízalo para que sólo `x` y `y` sean denotados.\n"
#: src/hello/print/print_display.md:73
msgid "\"x: {}, y: {}\""
msgstr ""
#: src/hello/print/print_display.md:80
msgid "\"Compare structures:\""
msgstr "\"Compara estructuras:\""
#: src/hello/print/print_display.md:81 src/hello/print/print_display.md:94
msgid "\"Display: {}\""
msgstr ""
#: src/hello/print/print_display.md:82 src/hello/print/print_display.md:95
msgid "\"Debug: {:?}\""
msgstr ""
#: src/hello/print/print_display.md:87
msgid "\"The big range is {big} and the small is {small}\""
msgstr "\"El rango grande es {big} y el pequeño es {small}\""
#: src/hello/print/print_display.md:93
msgid "\"Compare points:\""
msgstr "\" Compara Puntos:\""
#: src/hello/print/print_display.md:97
msgid ""
"// Error. Both `Debug` and `Display` were implemented, but `{:b}`\n"
" // requires `fmt::Binary` to be implemented. This will not work.\n"
" // println!(\"What does Point2D look like in binary: {:b}?\", point);\n"
msgstr ""
"// Error. Ambos `Debug` y `Display` fueron implementados, pero `{:b}`\n"
" // requiere implementar `fmt::Binary`. Esto no funcionará.\n"
" // println!(\"¿Cómo se ve el Punto2D en binario: {:b}?\", point);\n"
#: src/hello/print/print_display.md:103
msgid ""
"So, `fmt::Display` has been implemented but `fmt::Binary` has not, and "
"therefore cannot be used. `std::fmt` has many such [`traits`](https://doc."
"rust-lang.org/std/fmt/#formatting-traits) and each requires its own "
"implementation. This is detailed further in [`std::fmt`](https://doc.rust-"
"lang.org/std/fmt/)."
msgstr ""
"Entonces, `fmt::Display` se ha implementado pero `fmt::Binary` no, ypor lo "
"tanto, no se puede usar. `std::fmt` tiene muchos de estos [`traits`](https://"
"doc.rust-lang.org/std/fmt/#formatting-traits) y cada uno requiere "
"suimplementación. Esto se detalla aún más en [`std::fmt`](https://doc.rust-"
"lang.org/std/fmt/)."
#: src/hello/print/print_display.md:109
msgid ""
"After checking the output of the above example, use the `Point2D` struct as "
"a guide to add a `Complex` struct to the example. When printed in the same "
"way, the output should be:"
msgstr ""
"Después de verificar la salida del ejemplo anterior, use la estructura "
"`Point2D` como una guía para agregar una estructura `Complex` al ejemplo. "
"Cuando se imprime de la misma manera, la salida debería ser:"
#: src/hello/print/print_display.md:120
msgid ""
"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
"std/fmt/), [`macros`](../../macros.md), [`struct`](../../custom_types/"
"structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-"
"traits), and [`use`](../../mod/use.md)"
msgstr ""
"[`derive`](../../trait/derive.md), [`std::fmt`](https://doc.rust-lang.org/"
"std/fmt/), [`macros`](../../macros.md), [`struct`](../../custom_types/"
"structs.md), [`trait`](https://doc.rust-lang.org/std/fmt/#formatting-"
"traits), y [`use`](../../mod/use.md)"
#: src/hello/print/print_display/testcase_list.md:3
msgid ""
"Implementing `fmt::Display` for a structure where the elements must each be "
"handled sequentially is tricky. The problem is that each `write!` generates "
"a `fmt::Result`. Proper handling of this requires dealing with _all_ the "
"results. Rust provides the `?` operator for exactly this purpose."
msgstr ""
"Implementar `fmt::Display` para una estructura donde los elementos deben ser "
"cada uno manejados secuencialmente es complicado. El problema es que cada "
"`write!` genera un `fmt::Result`. El manejo adecuado de esto requiere tratar "
"con _todos_ losresultados. Rust proporciona el operador `?` para exactamente "
"este propósito."
#: src/hello/print/print_display/testcase_list.md:8
msgid "Using `?` on `write!` looks like this:"
msgstr "Usar `?` con `write!` se ve así:"
#: src/hello/print/print_display/testcase_list.md:11
msgid ""
"// Try `write!` to see if it errors. If it errors, return\n"
"// the error. Otherwise continue.\n"
msgstr ""
"// Usa `write!` para ver si falla. Si hay errores, regresa\n"
"// el error. En otro caso, continúa.\n"
#: src/hello/print/print_display/testcase_list.md:16
msgid ""
"With `?` available, implementing `fmt::Display` for a `Vec` is "
"straightforward:"
msgstr ""
"Si disponemos de `?`, implementar `fmt::Display` para un `Vec` es directo:"
#: src/hello/print/print_display/testcase_list.md:20
msgid "// Import the `fmt` module.\n"
msgstr "// Importar el módulo `fmt`.\n"
#: src/hello/print/print_display/testcase_list.md:21
msgid "// Define a structure named `List` containing a `Vec`.\n"
msgstr "// Define una estructura llamada `List` que contiene un `Vec`.\n"
#: src/hello/print/print_display/testcase_list.md:27
msgid ""
"// Extract the value using tuple indexing,\n"
" // and create a reference to `vec`.\n"
msgstr ""
"// Extrae el valor usando indexación de tuplas,\n"
" // y crea una referencia a `vec`.\n"
#: src/hello/print/print_display/testcase_list.md:31
msgid "\"[\""
msgstr ""
#: src/hello/print/print_display/testcase_list.md:33
msgid ""
"// Iterate over `v` in `vec` while enumerating the iteration\n"
" // count in `count`.\n"
msgstr ""
"// Itera sobre `v` en un `vec` mientras enumeras la cuenta\n"
" // de la iteración en `count`.\n"
#: src/hello/print/print_display/testcase_list.md:36
msgid ""
"// For every element except the first, add a comma.\n"
" // Use the ? operator to return on errors.\n"
msgstr ""
"// Para cada element excepto el primero, agrega una coma.\n"
" // Usa el operador ? para regresar errroes.\n"
#: src/hello/print/print_display/testcase_list.md:38 src/std/str.md:36
msgid "\", \""
msgstr ""
#: src/hello/print/print_display/testcase_list.md:42
msgid "// Close the opened bracket and return a fmt::Result value.\n"
msgstr "// Cierra la llave abierta y regresa un valor de `fmt::Result`.\n"
#: src/hello/print/print_display/testcase_list.md:43
msgid "\"]\""
msgstr ""
#: src/hello/print/print_display/testcase_list.md:55
msgid ""
"Try changing the program so that the index of each element in the vector is "
"also printed. The new output should look like this:"
msgstr ""
"Intente cambiar el programa para que el índice de cada elemento en el vector "
"seatambién impreso. La nueva salida debería verse así:"
#: src/hello/print/print_display/testcase_list.md:64
msgid ""
"[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/ref."
"md), [`Result`](../../../std/result.md), [`struct`](../../../custom_types/"
"structs.md), [`?`](../../../std/result/question_mark.md), and [`vec!`]"
"(../../../std/vec.md)"
msgstr ""
"[`for`](../../../flow_control/for.md), [`ref`](../../../scope/borrow/ref."
"md), [`Result`](../../../std/result.md), [`struct`](../../../custom_types/"
"structs.md), [`?`](../../../std/result/question_mark.md), y [`vec!`]"
"(../../../std/vec.md)"
#: src/hello/print/fmt.md:3
msgid "We've seen that formatting is specified via a _format string_:"
msgstr ""
"Hemos visto que este formato se especifica via una _cadena de formato_:"
#: src/hello/print/fmt.md:5
msgid "`format!(\"{}\", foo)` -> `\"3735928559\"`"
msgstr ""
#: src/hello/print/fmt.md:6
msgid ""
"`format!(\"0x{:X}\", foo)` -> [`\"0xDEADBEEF\"`](https://en.wikipedia.org/"
"wiki/Deadbeef#Magic_debug_values)"
msgstr ""
#: src/hello/print/fmt.md:7
msgid "`format!(\"0o{:o}\", foo)` -> `\"0o33653337357\"`"
msgstr ""
#: src/hello/print/fmt.md:9
msgid ""
"The same variable (`foo`) can be formatted differently depending on which "
"_argument type_ is used: `X` vs `o` vs _unspecified_."
msgstr ""
"La misma variable (`foo`) puede formatearse de manera diferente dependiendo "
"de cuál sea _tipo de argumento_ utilizado: `X` vs `o` vs _no especificado_."
#: src/hello/print/fmt.md:12
msgid ""
"This formatting functionality is implemented via traits, and there is one "
"trait for each argument type. The most common formatting trait is `Display`, "
"which handles cases where the argument type is left unspecified: `{}` for "
"instance."
msgstr ""
"Esta funcionalidad de formato se implementa a través de traits, y hay trait "
"para cada tipo de argumento. El trait de formato más común es la `Display`, "
"que maneja casos en los que el tipo de argumento se deja sin especificar: `{}"
"`, por ejemplo."
#: src/hello/print/fmt.md:21
msgid "// Latitude\n"
msgstr "// Latitude\n"
#: src/hello/print/fmt.md:23
msgid "// Longitude\n"
msgstr "// Longitude\n"
#: src/hello/print/fmt.md:28
msgid ""
"// `f` is a buffer, and this method must write the formatted string into "
"it.\n"
msgstr ""
"// `f` es un búfer, y este método se usa para formatear y meterle una "
"cadena.\n"
#: src/hello/print/fmt.md:30
msgid "'N'"
msgstr ""
#: src/hello/print/fmt.md:30
msgid "'S'"
msgstr ""
#: src/hello/print/fmt.md:31
msgid "'E'"
msgstr ""
#: src/hello/print/fmt.md:31
msgid "'W'"
msgstr ""
#: src/hello/print/fmt.md:33
msgid ""
"// `write!` is like `format!`, but it will write the formatted string\n"
" // into a buffer (the first argument).\n"
msgstr ""
"// `write!` es como `format!`, pero escribirá la cadena formateada\n"
" // al búfer (el primer argumento).\n"
#: src/hello/print/fmt.md:35
msgid "\"{}: {:.3}°{} {:.3}°{}\""
msgstr ""
#: src/hello/print/fmt.md:49
msgid "\"Dublin\""
msgstr ""
#: src/hello/print/fmt.md:50
msgid "\"Oslo\""
msgstr ""
#: src/hello/print/fmt.md:51
msgid "\"Vancouver\""
msgstr ""
#: src/hello/print/fmt.md:60
msgid ""
"// Switch this to use {} once you've added an implementation\n"
" // for fmt::Display.\n"
msgstr ""
"// Cambia esto a {} una vez que hayas añadido una implementación\n"
" // para fmt::Display.\n"
#: src/hello/print/fmt.md:62 src/primitives/tuples.md:60
#: src/custom_types/structs.md:47 src/types/inference.md:23
#: src/conversion/string.md:76 src/generics/bounds.md:49
#: src/generics/where.md:38 src/std/str.md:137 src/std/result.md:59
#: src/std/result.md:61 src/std/result.md:63 src/std/arc.md:26
#: src/std_misc/channels.md:53
msgid "\"{:?}\""
msgstr ""
#: src/hello/print/fmt.md:67
msgid ""
"You can view a [full list of formatting traits](https://doc.rust-lang.org/"
"std/fmt/#formatting-traits) and their argument types in the [`std::fmt`]"
"(https://doc.rust-lang.org/std/fmt/) documentation."
msgstr ""
"Puede ver una [lista completa de traits de formato](https://doc.rust-lang."
"org/std/fmt/#formatting-traits) y sus tipos de argumentos en la "
"documentación de [`std::fmt`](https://doc.rust-lang.org/std/fmt/)."
#: src/hello/print/fmt.md:72
msgid ""
"Add an implementation of the `fmt::Display` trait for the `Color` struct "
"above so that the output displays as:"
msgstr ""
"Agrega una implementación del trait `fmt::Display` para la estructura "
"`Color`arriba para que la salida se muestre como:"
#: src/hello/print/fmt.md:81
msgid "Three hints if you get stuck:"
msgstr "Tres pistas por si te atoras:"
#: src/hello/print/fmt.md:83
msgid ""
"The formula for calculating a color in the RGB color space is: `RGB = "
"(R*65536)+(G*256)+B , (when R is RED, G is GREEN and B is BLUE)`. For more "
"see [RGB color format & calculation](https://www.rapidtables.com/web/color/"
"RGB_Color.html#rgb-format)."
msgstr ""
"La fórmula para calcular un color en el espacio de color RGB es: `RGB = "
"(R*65536)+(G*256)+B, (cuando R es ROJO, G es VERDE y B es AZUL)`. Para más "
"ver [Formato de color RGB y su cálculo](https://www.rapidtables.com/web/color/"
"RGB_Color.html#rgb-format)."
#: src/hello/print/fmt.md:86
msgid ""
"You [may need to list each color more than once](https://doc.rust-lang.org/"
"std/fmt/#named-parameters)."
msgstr ""
"Puede que [necesites enumerar cada color más de una vez](https://doc.rust-lang.org/"
"std/fmt/#named-parameters)."
#: src/hello/print/fmt.md:87
msgid ""
"You can [pad with zeros to a width of 2](https://doc.rust-lang.org/std/fmt/"
"#width) with `:0>2`."
msgstr ""
"Puedes [acolchonar con ceros a un ancho de 2](https://doc.rust-lang.org/std/fmt/"
"#width) usando `:0>2`."
#: src/hello/print/fmt.md:91
msgid "[`std::fmt`](https://doc.rust-lang.org/std/fmt/)"
msgstr ""
#: src/primitives.md:3
msgid ""
"Rust provides access to a wide variety of `primitives`. A sample includes:"
msgstr ""
"Rust proporciona acceso a una amplia variedad de `primitivas`. Algunos ejemplos son:"
#: src/primitives.md:5
msgid "Scalar Types"
msgstr "Tipos Escalares"
#: src/primitives.md:7
msgid ""
"Signed integers: `i8`, `i16`, `i32`, `i64`, `i128` and `isize` (pointer size)"
msgstr ""
"Enteros con signo: `i8`, `i16`, `i32`, `i64`, `i128` y `isize` (el tamaño del puntero)"
#: src/primitives.md:8
msgid ""
"Unsigned integers: `u8`, `u16`, `u32`, `u64`, `u128` and `usize` (pointer "
"size)"
msgstr ""
"Enteros sin signo: `u8`, `u16`, `u32`, `u64`, `u128` y `usize` (el tamaño del puntero"
")"
#: src/primitives.md:10
msgid "Floating point: `f32`, `f64`"
msgstr "Punto flotante: `f32`, `f64`"
#: src/primitives.md:11
msgid "`char` Unicode scalar values like `'a'`, `'α'` and `'∞'` (4 bytes each)"
msgstr "`char` Valores de Unicode escalares como `'a'`, `'α'` y `'∞'` (4 bytes cada uno)"
#: src/primitives.md:12
msgid "`bool` either `true` or `false`"
msgstr "`bool` puede ser `true` o `falso`"
#: src/primitives.md:13
msgid "The unit type `()`, whose only possible value is an empty tuple: `()`"
msgstr "El tipo unitario `()`, cuyo único posible valor es la tupla vacía: `()`"
#: src/primitives.md:15
msgid ""
"Despite the value of a unit type being a tuple, it is not considered a "
"compound type because it does not contain multiple values."
msgstr ""
"A pesar de que el valor de un tipo de unidad es una tupla, no se considera un"
"tipo de compuesto porque no contiene múltiples valores."
#: src/primitives.md:18
msgid "Compound Types"
msgstr "Tipos Compuestos"
#: src/primitives.md:20
msgid "Arrays like `[1, 2, 3]`"
msgstr "Arreglos como `[1, 2, 3]`"
#: src/primitives.md:21
msgid "Tuples like `(1, true)`"
msgstr "Tuplas como `(1, true)`"
#: src/primitives.md:23
msgid ""
"Variables can always be _type annotated_. Numbers may additionally be "
"annotated via a _suffix_ or _by default_. Integers default to `i32` and "
"floats to `f64`. Note that Rust can also infer types from context."
msgstr ""
"Las variables siempre pueden llevar _anotación de tipos_. Los números también pueden ser"
"anotados a través de un _sufijo_ o _por default_. Los enteros usan como default `i32` y "
"los flotantes usan a `f64`. Tenga en cuenta que Rust puede también puede inferir tipos."
#: src/primitives.md:29
msgid "// Variables can be type annotated.\n"
msgstr "// Las variables pueden llevar anotaciónes de tipo.\n"
#: src/primitives.md:32
msgid "// Regular annotation\n"
msgstr "// Anotación regular\n"
#: src/primitives.md:33
msgid "// Suffix annotation\n"
msgstr "// Anotación con sufijo\n"
#: src/primitives.md:35
msgid "// Or a default will be used.\n"
msgstr "// O se usará un default.\n"
#: src/primitives.md:36
msgid "// `f64`\n"
msgstr ""
#: src/primitives.md:37
msgid "// `i32`\n"
msgstr ""
#: src/primitives.md:39
msgid "// A type can also be inferred from context.\n"
msgstr "// Un tipo también se puede inferir por context.\n"
#: src/primitives.md:40
msgid "// Type i64 is inferred from another line.\n"
msgstr "// El tipo i64 se puede inferir de otra línea.\n"
#: src/primitives.md:43
msgid "// A mutable variable's value can be changed.\n"
msgstr "// Una mariable mutable puede cambiar.\n"
#: src/primitives.md:44
msgid "// Mutable `i32`\n"
msgstr "// `i32` Mutable\n"
#: src/primitives.md:47
msgid "// Error! The type of a variable can't be changed.\n"
msgstr "// Error! El tipo de la variable no se puede cambiar.\n"
#: src/primitives.md:50
msgid "// Variables can be overwritten with shadowing.\n"
msgstr "// Las variables se puede sobreescribir con sombreo.\n"
#: src/primitives.md:53
msgid "/* Compound types - Array and Tuple */"
msgstr "/* Tipos compuestos - Arreglo y Tupla */"
#: src/primitives.md:55
msgid "// Array signature consists of Type T and length as [T; length].\n"
msgstr "// La declaración del tipo de Arreglo consiste del tipo T y la longitud como [T; longitud].\n"
#: src/primitives.md:58
msgid ""
"// Tuple is a collection of values of different types \n"
" // and is constructed using parentheses ().\n"
msgstr ""
"// Una tupla es una colección de valores de diferentes tipos\n"
" // y se construye usando paréntesis ().\n"
#: src/primitives.md:66
msgid ""
"[the `std` library](https://doc.rust-lang.org/std/), [`mut`]"
"(variable_bindings/mut.md), [`inference`](types/inference.md), and "
"[`shadowing`](variable_bindings/scope.md)"
msgstr ""
"[the `std` library](https://doc.rust-lang.org/std/), [`mut`]"
"(variable_bindings/mut.md), [`inference`](types/inference.md), y "
"[`shadowing`](variable_bindings/scope.md)"
#: src/primitives/literals.md:3
msgid ""
"Integers `1`, floats `1.2`, characters `'a'`, strings `\"abc\"`, booleans "
"`true` and the unit type `()` can be expressed using literals."
msgstr ""
"Enteros `1`, flotantes `1.2`, caractéres `'a'`, cadenas `\"abc\"`, booleanos "
"`true` y el tipo unitario `()` se puede expresar con literales."
#: src/primitives/literals.md:6
msgid ""
"Integers can, alternatively, be expressed using hexadecimal, octal or binary "
"notation using these prefixes respectively: `0x`, `0o` or `0b`."
msgstr ""
"Los enteros pueden, alternativamente, expresarse utilizando notación hexadecimal, octal o binaria"
"usando estos prefijos respectivamente: `0x`, `0o` o` 0b`."
#: src/primitives/literals.md:9
msgid ""
"Underscores can be inserted in numeric literals to improve readability, e.g. "
"`1_000` is the same as `1000`, and `0.000_001` is the same as `0.000001`."
msgstr ""
"Se pueden insertar guíones bajos en literales numéricos para mejorar la legibilidad, por ejemplo,"
"`1_000` es lo mismo que `1000`, y `0.000_001` es lo mismo que `0.000001`."
#: src/primitives/literals.md:12
msgid ""
"Rust also supports scientific [E-notation](https://en.wikipedia.org/wiki/"
"Scientific_notation#E_notation), e.g. `1e6`, `7.6e-4`. The associated type "
"is `f64`."
msgstr ""
"Rust también admite [notación E científica](https://en.wikipedia.org/wiki/"
"Scientific_notation#E_notation), e.g. `1e6`, `7.6e-4`. El tipo asociado es "
"`f64`."
#: src/primitives/literals.md:15
msgid ""
"We need to tell the compiler the type of the literals we use. For now, we'll "
"use the `u32` suffix to indicate that the literal is an unsigned 32-bit "
"integer, and the `i32` suffix to indicate that it's a signed 32-bit integer."
msgstr ""
"Necesitamos decirle al compilador el tipo de literales que usamos. Por ahora, lo haremos"
"usando el sufijo `u32` para indicar que el literal es un entero sin signo de 32 bits "
", y el sufijo `i32` para indicar que es un entero con signo de 32 bits."
#: src/primitives/literals.md:19
msgid ""
"The operators available and their precedence [in Rust](https://doc.rust-lang."
"org/reference/expressions.html#expression-precedence) are similar to other "
"[C-like languages](https://en.wikipedia.org/wiki/"
"Operator_precedence#Programming_languages)."
msgstr ""
"Los operadores disponibles y su precedencia [en Rust](https://doc.rust-lang."
"org/reference/expressions.html#expression-precedence) es similar a otros "
"[lenguajes como C](https://en.wikipedia.org/wiki/"
"Operator_precedence#Programming_languages)."
#: src/primitives/literals.md:24
msgid "// Integer addition\n"
msgstr "// Suma de enteros"
#: src/primitives/literals.md:25
msgid "\"1 + 2 = {}\""
msgstr ""
#: src/primitives/literals.md:27
msgid "// Integer subtraction\n"
msgstr "// Resta de enteros"
#: src/primitives/literals.md:28
msgid "\"1 - 2 = {}\""
msgstr ""
#: src/primitives/literals.md:29
msgid ""
"// TODO ^ Try changing `1i32` to `1u32` to see why the type is important\n"
msgstr ""
"// TAREA ^ Intenta cambiar `1i32` a `1u32` para ver por qué el tipo es importante\n"
#: src/primitives/literals.md:31
msgid "// Scientific notation\n"
msgstr "// Notación científica"
#: src/primitives/literals.md:32
msgid "\"1e4 is {}, -2.5e-3 is {}\""
msgstr "\"1e4 es {}, -2.5e-3 es {}\""
#: src/primitives/literals.md:34
msgid "// Short-circuiting boolean logic\n"
msgstr "// Lógica booleana de corto circuito"
#: src/primitives/literals.md:35
msgid "\"true AND false is {}\""
msgstr "\"true Y false es {}\""
#: src/primitives/literals.md:36
msgid "\"true OR false is {}\""
msgstr "\"true O false es {}\""
#: src/primitives/literals.md:37
msgid "\"NOT true is {}\""
msgstr "\"NOT true es {}\""
#: src/primitives/literals.md:39
msgid "// Bitwise operations\n"
msgstr "// Operaciones sobre bits"
#: src/primitives/literals.md:40
msgid "\"0011 AND 0101 is {:04b}\""
msgstr "\"0011 AND 0101 es {:04b}\""
#: src/primitives/literals.md:41
msgid "\"0011 OR 0101 is {:04b}\""
msgstr "\"0011 OR 0101 es {:04b}\""
#: src/primitives/literals.md:42
msgid "\"0011 XOR 0101 is {:04b}\""
msgstr "\"0011 XOR 0101 es {:04b}\""
#: src/primitives/literals.md:43
msgid "\"1 << 5 is {}\""
msgstr "\"1 << 5 es {}\""
#: src/primitives/literals.md:44
msgid "\"0x80 >> 2 is 0x{:x}\""
msgstr "\"0x80 >> 2 es 0x{:x}\""
#: src/primitives/literals.md:46
msgid "// Use underscores to improve readability!\n"
msgstr "// ¡Usa guiones bajos para mejorar la legibilidad!\n"
#: src/primitives/literals.md:47
msgid "\"One million is written as {}\""
msgstr "\" Un millón se escribe como {}\""
#: src/primitives/tuples.md:3
msgid ""
"A tuple is a collection of values of different types. Tuples are constructed "
"using parentheses `()`, and each tuple itself is a value with type signature "
"`(T1, T2, ...)`, where `T1`, `T2` are the types of its members. Functions "
"can use tuples to return multiple values, as tuples can hold any number of "
"values."
msgstr ""
"Una tupla es una colección de valores de diferentes tipos. Se construyen tuplas"
"usando paréntesis `()`, y cada tupla en sí es un valor con la anotación de tipo"
"`(T1, t2, ...) `, donde `t1`, `t2` son los tipos de sus miembros. Las funciones"
"pueden usar tuplas para devolver múltiples valores, ya que las tuplas pueden contener cualquier número de"
"valores."
#: src/primitives/tuples.md:9
msgid "// Tuples can be used as function arguments and as return values.\n"
msgstr "// Las tuplas se pueden como argumentos de funciones y como sus valores de retorno.\n"
#: src/primitives/tuples.md:11
msgid "// `let` can be used to bind the members of a tuple to variables.\n"
msgstr "// `let` se puede usar para ligar los miembros de la tupla a variables.\n"
#: src/primitives/tuples.md:16
msgid "// The following struct is for the activity.\n"
msgstr "// La siguiente `struct` es para la actividad.\n"
#: src/primitives/tuples.md:22
msgid "// A tuple with a bunch of different types.\n"
msgstr "// Una tupla es montón de tipos diferentes.\n"
#: src/primitives/tuples.md:26 src/generics.md:50 src/generics.md:55
#: src/generics/gen_fn.md:47
msgid "'a'"
msgstr ""
#: src/primitives/tuples.md:28
msgid "// Values can be extracted from the tuple using tuple indexing.\n"
msgstr "// Se pueden extraer valores de la tupla indexando"
#: src/primitives/tuples.md:29
msgid "\"Long tuple first value: {}\""
msgstr "\"Tupla grande primer valor: {}\""
#: src/primitives/tuples.md:30
msgid "\"Long tuple second value: {}\""
msgstr "\"Tupla grande segundo valor: {}\""
#: src/primitives/tuples.md:32
msgid "// Tuples can be tuple members.\n"
msgstr "// Tuplas con tuplas como miembros.\n"
#: src/primitives/tuples.md:35
msgid "// Tuples are printable.\n"
msgstr "// Las tuples se pueden imprimir.\n"
#: src/primitives/tuples.md:36
msgid "\"tuple of tuples: {:?}\""
msgstr "\"tupla de tuplas: {:?}\""
#: src/primitives/tuples.md:38
msgid ""
"// But long Tuples (more than 12 elements) cannot be printed.\n"
" //let too_long_tuple = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);\n"
" //println!(\"Too long tuple: {:?}\", too_long_tuple);\n"
" // TODO ^ Uncomment the above 2 lines to see the compiler error\n"
msgstr ""
"// Pero no se pueden imprimir tuplas demasadio grandes (más de 12 elementos).\n"
" // let tupla_demasiado_grande = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);\n"
" // println!(\"Tupla demasiado grande: {:?}\", tupla_demasiado_grande);\n"
" // TAREA ^ Quita el comentario de las 2 líneas anteriores para ver el error del compilador\n"
#: src/primitives/tuples.md:44
msgid "\"Pair is {:?}\""
msgstr "\"Par es {:?}\""
#: src/primitives/tuples.md:46
msgid "\"The reversed pair is {:?}\""
msgstr "\"El par invertido es {:?}\""
#: src/primitives/tuples.md:48
msgid ""
"// To create one element tuples, the comma is required to tell them apart\n"
" // from a literal surrounded by parentheses.\n"
msgstr ""
"// Para crear un tuplas de un sólo elemento, se requiere la coma para distinguirlas\n"
" // de un literal rodeado de paréntesis.\n"
#: src/primitives/tuples.md:50
msgid "\"One element tuple: {:?}\""
msgstr "\"Una tupla de 1 elemento: {:?}\""
#: src/primitives/tuples.md:51
msgid "\"Just an integer: {:?}\""
msgstr "\"Sólo un entero: {:?}\""
#: src/primitives/tuples.md:53
msgid "// Tuples can be destructured to create bindings.\n"
msgstr "// Las tuplas puede desestructurar para crear variables.\n"
#: src/primitives/tuples.md:54 src/conversion/from_into.md:17
#: src/fn/closures/input_parameters.md:52 src/std_misc/fs.md:51
msgid "\"hello\""
msgstr ""
#: src/primitives/tuples.md:57
msgid "\"{:?}, {:?}, {:?}, {:?}\""
msgstr ""
#: src/primitives/tuples.md:66
msgid ""
"_Recap_: Add the `fmt::Display` trait to the `Matrix` struct in the above "
"example, so that if you switch from printing the debug format `{:?}` to the "
"display format `{}`, you see the following output:"
msgstr ""
"_Recapitulando_: Agrega el rasgo `fmt::Display` a `Matrix` en el ejemplo"
"anterior, de modo que si cambias de imprimir el formato de depuración `{:?}` al"
"formato de visualización `{}`, ves la siguiente salida:"
#: src/primitives/tuples.md:75
msgid ""
"You may want to refer back to the example for [print display](../hello/print/"
"print_display.md)."
msgstr ""
"Es posible que desee consultar el ejemplo de [impresión a pantalla](../hello/print/"
"print_display.md)."
#: src/primitives/tuples.md:76
msgid ""
"Add a `transpose` function using the `reverse` function as a template, which "
"accepts a matrix as an argument, and returns a matrix in which two elements "
"have been swapped. For example:"
msgstr ""
"Agrega una función `transpose` usando la función `reverse` como una plantilla, el cual"
"acepta una matriz como argumento y devuelve una matriz en la que dos elementos"
"han sido intercambiados. Por ejemplo:"
#: src/primitives/tuples.md:81
msgid "\"Matrix:\\n{}\""
msgstr "\"Matriz:\\n{}\""
#: src/primitives/tuples.md:82
msgid "\"Transpose:\\n{}\""
msgstr "\"Transpuesta:\\n{}\""
#: src/primitives/tuples.md:85
msgid "Results in the output:"
msgstr "Resultados en el output:"
#: src/primitives/array.md:3
msgid ""
"An array is a collection of objects of the same type `T`, stored in "
"contiguous memory. Arrays are created using brackets `[]`, and their length, "
"which is known at compile time, is part of their type signature `[T; "
"length]`."
msgstr ""
"Un arreglo es una colección de objetos del mismo tipo `t`, almacenado en "
"memoria contigua. Los arreglos se crean usando corchetes cuardrados `[]`, y su longitud, "
"que se conoce en el momento de la compilación, es parte de su anotación de tipo `[T; "
"longitud]`."
#: src/primitives/array.md:7
msgid ""
"Slices are similar to arrays, but their length is not known at compile time. "
"Instead, a slice is a two-word object; the first word is a pointer to the "
"data, the second word is the length of the slice. The word size is the same "
"as usize, determined by the processor architecture, e.g. 64 bits on an "
"x86-64. Slices can be used to borrow a section of an array and have the type "
"signature `&[T]`."
msgstr ""
"Las slices son similares a los arreglos, pero su longitud no se conoce al momento de compilar."
"En cambio, un slice es un objeto de dos 'words' del procesador; la primera palabra es un puntero a los"
"datos, la segunda palabra es la longitud del slice. El tamaño de la palabra es el mismo"
"que usize, el cual se determina por la arquitectura del procesador, e.g. 64 bits en "
"x86-64. Los slices se pueden usar para tomar un `borrow` de una sección de un arreglo y tener la anotación"
"de tipo `&[t]`."
#: src/primitives/array.md:15
msgid "// This function borrows a slice.\n"
msgstr "// Esta funcion hace borrow a una slice.\n"
#: src/primitives/array.md:18
msgid "\"First element of the slice: {}\""
msgstr "\" El primer elemento de un slice: {}\""
#: src/primitives/array.md:19
msgid "\"The slice has {} elements\""
msgstr "\"El slice tiene {} elementos\""
#: src/primitives/array.md:23
msgid "// Fixed-size array (type signature is superfluous).\n"
msgstr "// Arreglos de tamaño fijo (su anotación de tipo es superflua).\n"
#: src/primitives/array.md:26
msgid "// All elements can be initialized to the same value.\n"
msgstr "// Todos los elementos pueden ser inicializados al mismo valor.\n"
#: src/primitives/array.md:29
msgid "// Indexing starts at 0.\n"
msgstr "// Los índices empiezan en 0.\n"
#: src/primitives/array.md:30
msgid "\"First element of the array: {}\""
msgstr "\"El primer elemento del arreglo: {}\""
#: src/primitives/array.md:31
msgid "\"Second element of the array: {}\""
msgstr "\"El segundo elemento del arreglo: {}\""
#: src/primitives/array.md:33
msgid "// `len` returns the count of elements in the array.\n"
msgstr "// `len` regresa cuántos elementos hay en el arreglo.\n"
#: src/primitives/array.md:34
msgid "\"Number of elements in array: {}\""
msgstr "\"Número de elementos en el arreglo: {} \""
#: src/primitives/array.md:36
msgid "// Arrays are stack allocated.\n"
msgstr "// Los arreglos se colocan en el stack.\n"
#: src/primitives/array.md:37
msgid "\"Array occupies {} bytes\""
msgstr "\"Los arreglos ocupan {} bytes\""
#: src/primitives/array.md:39
msgid "// Arrays can be automatically borrowed as slices.\n"
msgstr "// Los arreglos pueden ser `borrowed` como slices.\n"
#: src/primitives/array.md:40
msgid "\"Borrow the whole array as a slice.\""
msgstr "\"Hace borrow de todo el arreglo como un slice.\""
#: src/primitives/array.md:43
msgid ""
"// Slices can point to a section of an array.\n"
" // They are of the form [starting_index..ending_index].\n"
" // `starting_index` is the first position in the slice.\n"
" // `ending_index` is one more than the last position in the slice.\n"
msgstr ""
"// Los slices pueden apuntar a una sección de un arreglo.\n"
" // Estos son de la forma [índice_inicial..índice_final].\n"
" // `índice_inicial` es la primera posición en el slice.\n"
" // `índice_final` es uno más que la última posición en la porción.\n"
#: src/primitives/array.md:47
msgid "\"Borrow a section of the array as a slice.\""
msgstr "\"Hace Borrow de una sección del arreglo como un slice.\""
#: src/primitives/array.md:50
msgid "// Example of empty slice `&[]`:\n"
msgstr "// Un ejemplo de un slice vacío `&[]`:\n"
#: src/primitives/array.md:53
msgid "// Same but more verbose\n"
msgstr "// Lo mismo pero menos conciso"
#: src/primitives/array.md:55
msgid ""
"// Arrays can be safely accessed using `.get`, which returns an\n"
" // `Option`. This can be matched as shown below, or used with\n"
" // `.expect()` if you would like the program to exit with a nice\n"
" // message instead of happily continue.\n"
msgstr ""
"// Se pueden acceder a las arreglos de forma segura usando `.get`, el cual devuelve un \n"
" // `Option'. Aquí se puede usar un match como se muestra a continuación, o en su caso con \n"
" // `.expect()` si desees que el programa termine con un amable\n"
" // mensaje en lugar de continuar felizmente.\n"
#: src/primitives/array.md:59
msgid "// Oops, one element too far!\n"
msgstr "// ¡Oops!, un elemento de sobra.\n"
#: src/primitives/array.md:61
msgid "\"{}: {}\""
msgstr ""
#: src/primitives/array.md:62
msgid "\"Slow down! {} is too far!\""
msgstr "\"¡Para! {} es demasiado lejos\""
#: src/primitives/array.md:66
msgid ""
"// Out of bound indexing on array with constant value causes compile time "
"error.\n"
" //println!(\"{}\", xs[5]);\n"
" // Out of bound indexing on slice causes runtime error.\n"
" //println!(\"{}\", xs[..][5]);\n"
msgstr ""
"// Usar un índice constante que se encuentra fuera del rango válido causa un error de compilación.\n"
" //println!(\"{}\", xs[5]);\n"
" // Usar un índice fuera de rango en un slice causa un error de compilación.\n"
" //println!(\"{}\", xs[..][5]);\n"
#: src/custom_types.md:3
msgid "Rust custom data types are formed mainly through the two keywords:"
msgstr "Los tipos de datos personalizados en Rust se logran principalmente con 2 palabras clave:"
#: src/custom_types.md:5
msgid "`struct`: define a structure"
msgstr "`struct`: define una estructura"
#: src/custom_types.md:6
msgid "`enum`: define an enumeration"
msgstr "`enum`: define una enumeración"
#: src/custom_types.md:8
msgid "Constants can also be created via the `const` and `static` keywords."
msgstr "Las constantes se crean con las palabras clave `const` o `static`."
#: src/custom_types/structs.md:3
msgid ""
"There are three types of structures (\"structs\") that can be created using "
"the `struct` keyword:"
msgstr ""
"Hay tres tipos de estructuras (\"struct\") que se pueden crear usando"
"la palabra clave 'struct`:"
#: src/custom_types/structs.md:6
msgid "Tuple structs, which are, basically, named tuples."
msgstr "Estructuras de tupla, las cuales son básicamente tuplas nombradas."
#: src/custom_types/structs.md:7
msgid ""
"The classic [C structs](https://en.wikipedia.org/wiki/"
"Struct_(C_programming_language))"
msgstr ""
"Las clásicas estructuras [struct de C](https://en.wikipedia.org/wiki/"
"Struct_(C_programming_language))"
#: src/custom_types/structs.md:8
msgid "Unit structs, which are field-less, are useful for generics."
msgstr "Las structs unitarias, las cuales no tienen campos, y son útiles para los genéricos."
#: src/custom_types/structs.md:11 src/custom_types/enum/enum_use.md:6
#: src/custom_types/enum/c_like.md:6
msgid "// An attribute to hide warnings for unused code.\n"
msgstr "// Un atributo para esconder las advertencias del código no utilizado.\n"
#: src/custom_types/structs.md:19
msgid "// A unit struct\n"
msgstr "// Una struct unitaria"
#: src/custom_types/structs.md:22
msgid "// A tuple struct\n"
msgstr "// Una struct de tupla"
#: src/custom_types/structs.md:25
msgid "// A struct with two fields\n"
msgstr "// Una struct de dos campos\n"
#: src/custom_types/structs.md:31
msgid "// Structs can be reused as fields of another struct\n"
msgstr "// Las Structs pueden reutilizar los campos de otras structs\n"
#: src/custom_types/structs.md:34
msgid ""
"// A rectangle can be specified by where the top left and bottom right\n"
" // corners are in space.\n"
msgstr ""
"// Un rectángulo se puede escpecificar por dónde las esquinas de arriba a la izquierda y abajo a la derecha"
" // se encuentran en el espacio.\n"
#: src/custom_types/structs.md:41
msgid "// Create struct with field init shorthand\n"
msgstr "// Abreviación para crear un struct con un campo ya inicializado\n"
#: src/custom_types/structs.md:46
msgid "// Print debug struct\n"
msgstr "// Imprime un struct de depuración\n"
#: src/custom_types/structs.md:49
msgid "// Instantiate a `Point`\n"
msgstr "// Instanciar un `Point`\n"
#: src/custom_types/structs.md:53
msgid "// Access the fields of the point\n"
msgstr "// Accesa los campos del punto\n"
#: src/custom_types/structs.md:54
msgid "\"point coordinates: ({}, {})\""
msgstr "\"coordenadas del punto: ({}, {})\""
#: src/custom_types/structs.md:56
msgid ""
"// Make a new point by using struct update syntax to use the fields of our\n"
" // other one\n"
msgstr ""
"// Crea un nuevo punto usando la sintáxis de update de struct para usar los campos\n"
" // del otro struct\n"
#: src/custom_types/structs.md:60
msgid ""
"// `bottom_right.y` will be the same as `another_point.y` because we used "
"that field\n"
" // from `another_point`\n"
msgstr ""
"// `abajo_derecha.y` va a ser lo mismo que `otro_punto.y` por que usamos ese "
"campo \n"
" // de `otro_punto`\n"
#: src/custom_types/structs.md:62
msgid "\"second point: ({}, {})\""
msgstr "\"segundo punto: ({}, {})\""
#: src/custom_types/structs.md:64
msgid "// Destructure the point using a `let` binding\n"
msgstr "// Destructura el punto con un enlace `let`\n"
#: src/custom_types/structs.md:68
msgid "// struct instantiation is an expression too\n"
msgstr "// también se puede hacer la instanciación de un struct con una expresión"
#: src/custom_types/structs.md:73
msgid "// Instantiate a unit struct\n"
msgstr "// Instacia una struct unitaria"
#: src/custom_types/structs.md:76
msgid "// Instantiate a tuple struct\n"
msgstr "// Instancia una estructura de tupla\n"
#: src/custom_types/structs.md:79
msgid "// Access the fields of a tuple struct\n"
msgstr "// Accesa los campos de una estructura de tupla\n"
#: src/custom_types/structs.md:80 src/custom_types/structs.md:85
msgid "\"pair contains {:?} and {:?}\""
msgstr "\"un par contiene {:?} y {:?}\""
#: src/custom_types/structs.md:82
msgid "// Destructure a tuple struct\n"
msgstr "// Destructura una estructura de tupla"
#: src/custom_types/structs.md:91
msgid ""
"Add a function `rect_area` which calculates the area of a `Rectangle` (try "
"using nested destructuring)."
msgstr ""
"Agregue una función `rect_area` que calcula el área de un `Rectangle` (intenta"
"usar de la destructación anidada)."
#: src/custom_types/structs.md:93
msgid ""
"Add a function `square` which takes a `Point` and a `f32` as arguments, and "
"returns a `Rectangle` with its top left corner on the point, and a width and "
"height corresponding to the `f32`."
msgstr ""
"Agregue una función `square` que toma un `Punto` y un `f32` como argumentos, y "
"devuelve un `Rectangle` con su esquina superior izquierda en el punto, y un ancho y"
"altura correspondiente al `f32`."
#: src/custom_types/structs.md:97
msgid "See also"
msgstr "Véase también"
#: src/custom_types/structs.md:99
msgid ""
"[`attributes`](../attribute.md), [raw identifiers](../compatibility/"
"raw_identifiers.md) and [destructuring](../flow_control/match/destructuring."
"md)"
msgstr ""
"[`attributes`](../attribute.md), [raw identifiers](../compatibility/"
"raw_identifiers.md) y [destructuring](../flow_control/match/destructuring."
"md)"
#: src/custom_types/enum.md:3
msgid ""
"The `enum` keyword allows the creation of a type which may be one of a few "
"different variants. Any variant which is valid as a `struct` is also valid "
"in an `enum`."
msgstr ""
"La palabra clave `enum` permite la creación de un tipo que puede ser uno de unas pocas"
"diferentes variantes. Cualquier variante que sea válida como `struct` también es válida"
"en un `enum`."
#: src/custom_types/enum.md:8
msgid ""
"// Create an `enum` to classify a web event. Note how both\n"
"// names and type information together specify the variant:\n"
"// `PageLoad != PageUnload` and `KeyPress(char) != Paste(String)`.\n"
"// Each is different and independent.\n"
msgstr ""
"// Cree un `enum` para clasificar un evento web. Tenga en cuenta cómo ambos los\n"
"// nombres y los tipos juntos especifican la variante:\n"
"// `PageLoad != PageUnload` y `KeyPress(char) != Paste(String)`.\n"
"// Cada uno es diferente e independiente.\n"
#: src/custom_types/enum.md:13
msgid "// An `enum` variant may either be `unit-like`,\n"
msgstr "// Una variante `enum` puede ser `cuasi-unitaria`,\n"
#: src/custom_types/enum.md:16
msgid "// like tuple structs,\n"
msgstr "// como estructuras de tuplas"
#: src/custom_types/enum.md:19
msgid "// or c-like structures.\n"
msgstr "// o estructuras estilo C.\n"
#: src/custom_types/enum.md:22
msgid ""
"// A function which takes a `WebEvent` enum as an argument and\n"
"// returns nothing.\n"
msgstr ""
"// Una función que toma un enum 'WebEvent` como argumento y \n"
"// no devuelve nada.\n"
#: src/custom_types/enum.md:27
msgid "\"page loaded\""
msgstr "\"página cargada\""
#: src/custom_types/enum.md:28
msgid "\"page unloaded\""
msgstr "\"página descargada \""
#: src/custom_types/enum.md:29
msgid "// Destructure `c` from inside the `enum` variant.\n"
msgstr "// Destructura `c` desde dentro de la variante `enum`.\n"
#: src/custom_types/enum.md:30
msgid "\"pressed '{}'.\""
msgstr "\"presionaste '{}'.\""
#: src/custom_types/enum.md:31
msgid "\"pasted \\\"{}\\\".\""
msgstr "\"pegaste \\\"{}\\\".\""
#: src/custom_types/enum.md:32
msgid "// Destructure `Click` into `x` and `y`.\n"
msgstr "// Destructura `Click` en `x` y `y`.\n"
#: src/custom_types/enum.md:34
msgid "\"clicked at x={}, y={}.\""
msgstr "\"click en x={}, y={}.\""
#: src/custom_types/enum.md:40
msgid "'x'"
msgstr ""
#: src/custom_types/enum.md:41
msgid "// `to_owned()` creates an owned `String` from a string slice.\n"
msgstr "// `to_owned()` crea un `String` que es owned de slice de cadena.\n"
#: src/custom_types/enum.md:42
msgid "\"my text\""
msgstr "\"mi texto\""
#: src/custom_types/enum.md:56
msgid "Type aliases"
msgstr "Aliases de tipos"
#: src/custom_types/enum.md:58
msgid ""
"If you use a type alias, you can refer to each enum variant via its alias. "
"This might be useful if the enum's name is too long or too generic, and you "
"want to rename it."
msgstr ""
"Si usa un alias de tipo, puedes consultar cada variante de enum a través de su alias."
"Esto podría ser útil si el nombre del enum es demasiado largo o demasiado genérico, y lo "
"quieres renombrar."
#: src/custom_types/enum.md:67
msgid "// Creates a type alias\n"
msgstr "// Crear un alias de tipo\n"
#: src/custom_types/enum.md:72
msgid ""
"// We can refer to each variant via its alias, not its long and "
"inconvenient\n"
" // name.\n"
msgstr ""
"// Podemos referirnos a cada variante a través de su alias, y no su largo e"
"inconveniente \n"
" // nombre. \n"
#: src/custom_types/enum.md:78
msgid ""
"The most common place you'll see this is in `impl` blocks using the `Self` "
"alias."
msgstr ""
"El lugar más común que verás esto es en los bloques de `impl` usando el alias `Self` "
"."
#: src/custom_types/enum.md:96
msgid ""
"To learn more about enums and type aliases, you can read the [stabilization "
"report](https://github.com/rust-lang/rust/pull/61682/"
"#issuecomment-502472847) from when this feature was stabilized into Rust."
msgstr ""
"Para obtener más información sobre enums y alias de tipo, puedes leer el [informe "
"estabilización](https://github.com/rust-lang/rust/pull/61682/"
"#issuecomment-502472847) de cuando este feature se estabilizó en Rust."
#: src/custom_types/enum.md:102
msgid ""
"[`match`](../flow_control/match.md), [`fn`](../fn.md), and [`String`](../std/"
"str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/"
"rfcs/2338-type-alias-enum-variants.html)"
msgstr ""
"[`match`](../flow_control/match.md), [`fn`](../fn.md), y [`String`](../std/"
"str.md), [\"Type alias enum variants\" RFC](https://rust-lang.github.io/"
"rfcs/2338-type-alias-enum-variants.html)"
#: src/custom_types/enum/enum_use.md:3
msgid "The `use` declaration can be used so manual scoping isn't needed:"
msgstr "La declaración `use` se puede usar de tal manera que no se necesiten alcances manuales:"
#: src/custom_types/enum/enum_use.md:20
msgid ""
"// Explicitly `use` each name so they are available without\n"
" // manual scoping.\n"
msgstr ""
"// Explícitamente `use` (usa) cada nombre para que estén disponibles sin \n "
" // alcance manual. \n"
#: src/custom_types/enum/enum_use.md:23
msgid "// Automatically `use` each name inside `Role`.\n"
msgstr "// Hace `use` automaticamente para cada nombre dentro de `Role`.\n"
#: src/custom_types/enum/enum_use.md:26
msgid "// Equivalent to `Stage::Beginner`.\n"
msgstr "// Equivalente a `Stage::Beginner`.\n"
#: src/custom_types/enum/enum_use.md:28
msgid "// Equivalent to `Role::Student`.\n"
msgstr "// Equivalente a `Role::Student`.\n"
#: src/custom_types/enum/enum_use.md:32
msgid "// Note the lack of scoping because of the explicit `use` above.\n"
msgstr "// Notamos que la falta de alcances se debe al uso explícito de `use` arriba.\n"
#: src/custom_types/enum/enum_use.md:33
msgid "\"Beginners are starting their learning journey!\""
msgstr "\"¡Los principiantes están comenzando su aprendizaje!\""
#: src/custom_types/enum/enum_use.md:34
msgid "\"Advanced learners are mastering their subjects...\""
msgstr "\"Los estudiantes avanzados están dominando sus materias...\""
#: src/custom_types/enum/enum_use.md:38
msgid "// Note again the lack of scoping.\n"
msgstr "// Notamos otra vez la falta de alcances.\n"
#: src/custom_types/enum/enum_use.md:39
msgid "\"Students are acquiring knowledge!\""
msgstr "\"¡Los estudiantes están adquiriendo conocimiento!\""
#: src/custom_types/enum/enum_use.md:40
msgid "\"Teachers are spreading knowledge!\""
msgstr ""
#: src/custom_types/enum/enum_use.md:47
msgid "[`match`](../../flow_control/match.md) and [`use`](../../mod/use.md)"
msgstr ""
#: src/custom_types/enum/c_like.md:3
msgid "`enum` can also be used as C-like enums."
msgstr ""
#: src/custom_types/enum/c_like.md:8
msgid "// enum with implicit discriminator (starts at 0)\n"
msgstr ""
#: src/custom_types/enum/c_like.md:15
msgid "// enum with explicit discriminator\n"
msgstr ""
#: src/custom_types/enum/c_like.md:24
msgid "// `enums` can be cast as integers.\n"
msgstr ""
#: src/custom_types/enum/c_like.md:25
msgid "\"zero is {}\""
msgstr ""
#: src/custom_types/enum/c_like.md:26
msgid "\"one is {}\""
msgstr ""
#: src/custom_types/enum/c_like.md:28
msgid "\"roses are #{:06x}\""
msgstr ""
#: src/custom_types/enum/c_like.md:29
msgid "\"violets are #{:06x}\""
msgstr ""
#: src/custom_types/enum/c_like.md:35
msgid "[casting](../../types/cast.md)"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:3
msgid "A common way to implement a linked-list is via `enums`:"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:9
msgid ""
"// Cons: Tuple struct that wraps an element and a pointer to the next node\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:11
msgid "// Nil: A node that signifies the end of the linked list\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:14
msgid "// Methods can be attached to an enum\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:17
msgid "// Create an empty list\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:19
msgid "// `Nil` has type `List`\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:23
msgid ""
"// Consume a list, and return the same list with a new element at its front\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:25
msgid "// `Cons` also has type List\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:29
msgid "// Return the length of the list\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:31
msgid ""
"// `self` has to be matched, because the behavior of this method\n"
" // depends on the variant of `self`\n"
" // `self` has type `&List`, and `*self` has type `List`, matching on "
"a\n"
" // concrete type `T` is preferred over a match on a reference `&T`\n"
" // after Rust 2018 you can use self here and tail (with no ref) "
"below as well,\n"
" // rust will infer &s and ref tail. \n"
" // See https://doc.rust-lang.org/edition-guide/rust-2018/ownership-"
"and-lifetimes/default-match-bindings.html\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:39
msgid ""
"// Can't take ownership of the tail, because `self` is borrowed;\n"
" // instead take a reference to the tail\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:42
msgid "// Base Case: An empty list has zero length\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:47
msgid "// Return representation of the list as a (heap allocated) string\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:51
msgid ""
"// `format!` is similar to `print!`, but returns a heap\n"
" // allocated string instead of printing to the console\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:53 src/generics/impl.md:44
msgid "\"{}, {}\""
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:56
msgid "\"Nil\""
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:63
msgid "// Create an empty linked list\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:66
msgid "// Prepend some elements\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:71
msgid "// Show the final state of the list\n"
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:72
msgid "\"linked list has length: {}\""
msgstr ""
#: src/custom_types/enum/testcase_linked_list.md:79
msgid "[`Box`](../../std/box.md) and [methods](../../fn/methods.md)"
msgstr ""
#: src/custom_types/constants.md:3
msgid ""
"Rust has two different types of constants which can be declared in any scope "
"including global. Both require explicit type annotation:"
msgstr ""
#: src/custom_types/constants.md:6
msgid "`const`: An unchangeable value (the common case)."
msgstr ""
#: src/custom_types/constants.md:7
msgid ""
"`static`: A possibly mutable variable with [`'static`](../scope/lifetime/"
"static_lifetime.md) lifetime. The static lifetime is inferred and does not "
"have to be specified. Accessing or modifying a mutable static variable is "
"[`unsafe`](../unsafe.md)."
msgstr ""
#: src/custom_types/constants.md:12
msgid "// Globals are declared outside all other scopes.\n"
msgstr ""
#: src/custom_types/constants.md:13
msgid "\"Rust\""
msgstr ""
#: src/custom_types/constants.md:17
msgid "// Access constant in some function\n"
msgstr ""
#: src/custom_types/constants.md:24
msgid "// Access constant in the main thread\n"
msgstr ""
#: src/custom_types/constants.md:25
msgid "\"This is {}\""
msgstr ""
#: src/custom_types/constants.md:26
msgid "\"The threshold is {}\""
msgstr ""
#: src/custom_types/constants.md:27
msgid "\"{} is {}\""
msgstr ""
#: src/custom_types/constants.md:27
msgid "\"big\""
msgstr ""
#: src/custom_types/constants.md:27
msgid "\"small\""
msgstr ""
#: src/custom_types/constants.md:29
msgid "// Error! Cannot modify a `const`.\n"
msgstr ""
#: src/custom_types/constants.md:31 src/variable_bindings/scope.md:22
#: src/variable_bindings/declare.md:27 src/variable_bindings/freeze.md:16
#: src/types/cast.md:19 src/types/cast.md:28 src/flow_control/for.md:95
#: src/scope/borrow.md:41 src/scope/borrow/mut.md:52 src/std/vec.md:32
#: src/std/vec.md:45 src/std/hash/hashset.md:48
msgid "// FIXME ^ Comment out this line\n"
msgstr ""
#: src/custom_types/constants.md:37
msgid ""
"[The `const`/`static` RFC](https://github.com/rust-lang/rfcs/blob/master/"
"text/0246-const-vs-static.md), [`'static` lifetime](../scope/lifetime/"
"static_lifetime.md)"
msgstr ""
#: src/variable_bindings.md:3
msgid ""
"Rust provides type safety via static typing. Variable bindings can be type "
"annotated when declared. However, in most cases, the compiler will be able "
"to infer the type of the variable from the context, heavily reducing the "
"annotation burden."
msgstr ""
#: src/variable_bindings.md:8
msgid ""
"Values (like literals) can be bound to variables, using the `let` binding."
msgstr ""
#: src/variable_bindings.md:16
msgid "// copy `an_integer` into `copied_integer`\n"
msgstr ""
#: src/variable_bindings.md:19
msgid "\"An integer: {:?}\""
msgstr ""
#: src/variable_bindings.md:20
msgid "\"A boolean: {:?}\""
msgstr ""
#: src/variable_bindings.md:21
msgid "\"Meet the unit value: {:?}\""
msgstr ""
#: src/variable_bindings.md:23
msgid ""
"// The compiler warns about unused variable bindings; these warnings can\n"
" // be silenced by prefixing the variable name with an underscore\n"
msgstr ""
#: src/variable_bindings.md:28
msgid ""
"// FIXME ^ Prefix with an underscore to suppress the warning\n"
" // Please note that warnings may not be shown in a browser\n"
msgstr ""
#: src/variable_bindings/mut.md:3
msgid ""
"Variable bindings are immutable by default, but this can be overridden using "
"the `mut` modifier."
msgstr ""
#: src/variable_bindings/mut.md:11
msgid "\"Before mutation: {}\""
msgstr ""
#: src/variable_bindings/mut.md:13
msgid "// Ok\n"
msgstr ""
#: src/variable_bindings/mut.md:16
msgid "\"After mutation: {}\""
msgstr ""
#: src/variable_bindings/mut.md:18
msgid "// Error! Cannot assign a new value to an immutable variable\n"
msgstr ""
#: src/variable_bindings/mut.md:23
msgid "The compiler will throw a detailed diagnostic about mutability errors."
msgstr ""
#: src/variable_bindings/scope.md:3
msgid ""
"Variable bindings have a scope, and are constrained to live in a _block_. A "
"block is a collection of statements enclosed by braces `{}`."
msgstr ""
#: src/variable_bindings/scope.md:8
msgid "// This binding lives in the main function\n"
msgstr ""
#: src/variable_bindings/scope.md:11
msgid "// This is a block, and has a smaller scope than the main function\n"
msgstr ""
#: src/variable_bindings/scope.md:13
msgid "// This binding only exists in this block\n"
msgstr ""
#: src/variable_bindings/scope.md:16
msgid "\"inner short: {}\""
msgstr ""
#: src/variable_bindings/scope.md:18
msgid "// End of the block\n"
msgstr ""
#: src/variable_bindings/scope.md:20
msgid "// Error! `short_lived_binding` doesn't exist in this scope\n"
msgstr ""
#: src/variable_bindings/scope.md:21
msgid "\"outer short: {}\""
msgstr ""
#: src/variable_bindings/scope.md:24
msgid "\"outer long: {}\""
msgstr ""
#: src/variable_bindings/scope.md:28
msgid ""
"Also, [variable shadowing](https://en.wikipedia.org/wiki/Variable_shadowing) "
"is allowed."
msgstr ""
#: src/variable_bindings/scope.md:35
msgid "\"before being shadowed: {}\""
msgstr ""
#: src/variable_bindings/scope.md:37
msgid "// This binding *shadows* the outer one\n"
msgstr ""
#: src/variable_bindings/scope.md:38
msgid "\"abc\""
msgstr ""
#: src/variable_bindings/scope.md:40
msgid "\"shadowed in inner block: {}\""
msgstr ""
#: src/variable_bindings/scope.md:42
msgid "\"outside inner block: {}\""
msgstr ""
#: src/variable_bindings/scope.md:44
msgid "// This binding *shadows* the previous binding\n"
msgstr ""
#: src/variable_bindings/scope.md:46
msgid "\"shadowed in outer block: {}\""
msgstr ""
#: src/variable_bindings/declare.md:3
msgid ""
"It is possible to declare variable bindings first and initialize them later, "
"but all variable bindings must be initialized before they are used: the "
"compiler forbids use of uninitialized variable bindings, as it would lead to "
"undefined behavior."
msgstr ""
#: src/variable_bindings/declare.md:5
msgid ""
"It is not common to declare a variable binding and initialize it later in "
"the function. It is more difficult for a reader to find the initialization "
"when initialization is separated from declaration. It is common to declare "
"and initialize a variable binding near where the variable will be used."
msgstr ""
#: src/variable_bindings/declare.md:11
msgid "// Declare a variable binding\n"
msgstr ""
#: src/variable_bindings/declare.md:17
msgid "// Initialize the binding\n"
msgstr ""
#: src/variable_bindings/declare.md:21
msgid "\"a binding: {}\""
msgstr ""
#: src/variable_bindings/declare.md:25
msgid "// Error! Use of uninitialized binding\n"
msgstr ""
#: src/variable_bindings/declare.md:26 src/variable_bindings/declare.md:31
msgid "\"another binding: {}\""
msgstr ""
#: src/variable_bindings/freeze.md:3
msgid ""
"When data is bound by the same name immutably, it also _freezes_. _Frozen_ "
"data can't be modified until the immutable binding goes out of scope:"
msgstr ""
#: src/variable_bindings/freeze.md:11
msgid "// Shadowing by immutable `_mutable_integer`\n"
msgstr ""
#: src/variable_bindings/freeze.md:14
msgid "// Error! `_mutable_integer` is frozen in this scope\n"
msgstr ""
#: src/variable_bindings/freeze.md:18
msgid "// `_mutable_integer` goes out of scope\n"
msgstr ""
#: src/variable_bindings/freeze.md:21
msgid "// Ok! `_mutable_integer` is not frozen in this scope\n"
msgstr ""
#: src/types.md:3
msgid ""
"Rust provides several mechanisms to change or define the type of primitive "
"and user defined types. The following sections cover:"
msgstr ""
#: src/types.md:6
msgid "[Casting](types/cast.md) between primitive types"
msgstr ""
#: src/types.md:7
msgid "Specifying the desired type of [literals](types/literals.md)"
msgstr ""
#: src/types.md:8
msgid "Using [type inference](types/inference.md)"
msgstr ""
#: src/types.md:9
msgid "[Aliasing](types/alias.md) types"
msgstr ""
#: src/types/cast.md:3
msgid ""
"Rust provides no implicit type conversion (coercion) between primitive "
"types. But, explicit type conversion (casting) can be performed using the "
"`as` keyword."
msgstr ""
#: src/types/cast.md:6
msgid ""
"Rules for converting between integral types follow C conventions generally, "
"except in cases where C has undefined behavior. The behavior of all casts "
"between integral types is well defined in Rust."
msgstr ""
#: src/types/cast.md:11
msgid "// Suppress all warnings from casts which overflow.\n"
msgstr ""
#: src/types/cast.md:17
msgid "// Error! No implicit conversion\n"
msgstr ""
#: src/types/cast.md:21
msgid "// Explicit conversion\n"
msgstr ""
#: src/types/cast.md:25
msgid ""
"// Error! There are limitations in conversion rules.\n"
" // A float cannot be directly converted to a char.\n"
msgstr ""
#: src/types/cast.md:30
msgid "\"Casting: {} -> {} -> {}\""
msgstr ""
#: src/types/cast.md:32
msgid ""
"// when casting any value to an unsigned type, T,\n"
" // T::MAX + 1 is added or subtracted until the value\n"
" // fits into the new type\n"
msgstr ""
#: src/types/cast.md:36
msgid "// 1000 already fits in a u16\n"
msgstr ""
#: src/types/cast.md:37
msgid "\"1000 as a u16 is: {}\""
msgstr ""
#: src/types/cast.md:39
msgid ""
"// 1000 - 256 - 256 - 256 = 232\n"
" // Under the hood, the first 8 least significant bits (LSB) are kept,\n"
" // while the rest towards the most significant bit (MSB) get truncated.\n"
msgstr ""
#: src/types/cast.md:42 src/types/cast.md:61
msgid "\"1000 as a u8 is : {}\""
msgstr ""
#: src/types/cast.md:43
msgid "// -1 + 256 = 255\n"
msgstr ""
#: src/types/cast.md:44
msgid "\" -1 as a u8 is : {}\""
msgstr ""
#: src/types/cast.md:46
msgid "// For positive numbers, this is the same as the modulus\n"
msgstr ""
#: src/types/cast.md:47
msgid "\"1000 mod 256 is : {}\""
msgstr ""
#: src/types/cast.md:49
msgid ""
"// When casting to a signed type, the (bitwise) result is the same as\n"
" // first casting to the corresponding unsigned type. If the most "
"significant\n"
" // bit of that value is 1, then the value is negative.\n"
msgstr ""
#: src/types/cast.md:53
msgid "// Unless it already fits, of course.\n"
msgstr ""
#: src/types/cast.md:54
msgid "\" 128 as a i16 is: {}\""
msgstr ""
#: src/types/cast.md:56
msgid ""
"// In boundary case 128 value in 8-bit two's complement representation is "
"-128\n"
msgstr ""
#: src/types/cast.md:57
msgid "\" 128 as a i8 is : {}\""
msgstr ""
#: src/types/cast.md:59
msgid ""
"// repeating the example above\n"
" // 1000 as u8 -> 232\n"
msgstr ""
#: src/types/cast.md:62
msgid ""
"// and the value of 232 in 8-bit two's complement representation is -24\n"
msgstr ""
#: src/types/cast.md:63
msgid "\" 232 as a i8 is : {}\""
msgstr ""
#: src/types/cast.md:65
msgid ""
"// Since Rust 1.45, the `as` keyword performs a *saturating cast*\n"
" // when casting from float to int. If the floating point value exceeds\n"
" // the upper bound or is less than the lower bound, the returned value\n"
" // will be equal to the bound crossed.\n"
msgstr ""
#: src/types/cast.md:70
msgid "// 300.0 as u8 is 255\n"
msgstr ""
#: src/types/cast.md:71 src/types/cast.md:82
msgid "\" 300.0 as u8 is : {}\""
msgstr ""
#: src/types/cast.md:72
msgid "// -100.0 as u8 is 0\n"
msgstr ""
#: src/types/cast.md:73 src/types/cast.md:84
msgid "\"-100.0 as u8 is : {}\""
msgstr ""
#: src/types/cast.md:74 src/types/cast.md:85
msgid "// nan as u8 is 0\n"
msgstr ""
#: src/types/cast.md:75 src/types/cast.md:86
msgid "\" nan as u8 is : {}\""
msgstr ""
#: src/types/cast.md:77
msgid ""
"// This behavior incurs a small runtime cost and can be avoided\n"
" // with unsafe methods, however the results might overflow and\n"
" // return **unsound values**. Use these methods wisely:\n"
msgstr ""
#: src/types/cast.md:81
msgid "// 300.0 as u8 is 44\n"
msgstr ""
#: src/types/cast.md:83
msgid "// -100.0 as u8 is 156\n"
msgstr ""
#: src/types/literals.md:3
msgid ""
"Numeric literals can be type annotated by adding the type as a suffix. As an "
"example, to specify that the literal `42` should have the type `i32`, write "
"`42i32`."
msgstr ""
#: src/types/literals.md:6
msgid ""
"The type of unsuffixed numeric literals will depend on how they are used. If "
"no constraint exists, the compiler will use `i32` for integers, and `f64` "
"for floating-point numbers."
msgstr ""
#: src/types/literals.md:12
msgid "// Suffixed literals, their types are known at initialization\n"
msgstr ""
#: src/types/literals.md:17
msgid "// Unsuffixed literals, their types depend on how they are used\n"
msgstr ""
#: src/types/literals.md:21
msgid "// `size_of_val` returns the size of a variable in bytes\n"
msgstr ""
#: src/types/literals.md:22
msgid "\"size of `x` in bytes: {}\""
msgstr ""
#: src/types/literals.md:23
msgid "\"size of `y` in bytes: {}\""
msgstr ""
#: src/types/literals.md:24
msgid "\"size of `z` in bytes: {}\""
msgstr ""
#: src/types/literals.md:25
msgid "\"size of `i` in bytes: {}\""
msgstr ""
#: src/types/literals.md:26
msgid "\"size of `f` in bytes: {}\""
msgstr ""
#: src/types/literals.md:30
msgid ""
"There are some concepts used in the previous code that haven't been "
"explained yet, here's a brief explanation for the impatient readers:"
msgstr ""
#: src/types/literals.md:33
msgid ""
"`std::mem::size_of_val` is a function, but called with its _full path_. Code "
"can be split in logical units called _modules_. In this case, the "
"`size_of_val` function is defined in the `mem` module, and the `mem` module "
"is defined in the `std` _crate_. For more details, see [modules](../mod.md) "
"and [crates](../crates.md)."
msgstr ""
#: src/types/inference.md:3
msgid ""
"The type inference engine is pretty smart. It does more than looking at the "
"type of the value expression during an initialization. It also looks at how "
"the variable is used afterwards to infer its type. Here's an advanced "
"example of type inference:"
msgstr ""
#: src/types/inference.md:10
msgid ""
"// Because of the annotation, the compiler knows that `elem` has type u8.\n"
msgstr ""
#: src/types/inference.md:13
msgid "// Create an empty vector (a growable array).\n"
msgstr ""
#: src/types/inference.md:15
msgid ""
"// At this point the compiler doesn't know the exact type of `vec`, it\n"
" // just knows that it's a vector of something (`Vec<_>`).\n"
msgstr ""
#: src/types/inference.md:18
msgid "// Insert `elem` in the vector.\n"
msgstr ""
#: src/types/inference.md:20
msgid ""
"// Aha! Now the compiler knows that `vec` is a vector of `u8`s (`Vec<u8>`)\n"
" // TODO ^ Try commenting out the `vec.push(elem)` line\n"
msgstr ""
#: src/types/inference.md:27
msgid ""
"No type annotation of variables was needed, the compiler is happy and so is "
"the programmer!"
msgstr ""
#: src/types/alias.md:3
msgid ""
"The `type` statement can be used to give a new name to an existing type. "
"Types must have `UpperCamelCase` names, or the compiler will raise a "
"warning. The exception to this rule are the primitive types: `usize`, `f32`, "
"etc."
msgstr ""
#: src/types/alias.md:8
msgid "// `NanoSecond`, `Inch`, and `U64` are new names for `u64`.\n"
msgstr ""
#: src/types/alias.md:14
msgid "// `NanoSecond` = `Inch` = `U64` = `u64`.\n"
msgstr ""
#: src/types/alias.md:18
msgid ""
"// Note that type aliases *don't* provide any extra type safety, because\n"
" // aliases are *not* new types\n"
msgstr ""
#: src/types/alias.md:20
msgid "\"{} nanoseconds + {} inches = {} unit?\""
msgstr ""
#: src/types/alias.md:27
msgid ""
"The main use of aliases is to reduce boilerplate; for example the `io::"
"Result<T>` type is an alias for the `Result<T, io::Error>` type."
msgstr ""
#: src/types/alias.md:32
msgid "[Attributes](../attribute.md)"
msgstr ""
#: src/conversion.md:3
msgid ""
"Primitive types can be converted to each other through [casting](types/cast."
"md)."
msgstr ""
#: src/conversion.md:5
msgid ""
"Rust addresses conversion between custom types (i.e., `struct` and `enum`) "
"by the use of [traits](trait.md). The generic conversions will use the "
"[`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and [`Into`]"
"(https://doc.rust-lang.org/std/convert/trait.Into.html) traits. However "
"there are more specific ones for the more common cases, in particular when "
"converting to and from `String`s."
msgstr ""
#: src/conversion/from_into.md:3
msgid ""
"The [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) and "
"[`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) traits are "
"inherently linked, and this is actually part of its implementation. If you "
"are able to convert type A from type B, then it should be easy to believe "
"that we should be able to convert type B to type A."
msgstr ""
#: src/conversion/from_into.md:7
msgid "`From`"
msgstr ""
#: src/conversion/from_into.md:9
msgid ""
"The [`From`](https://doc.rust-lang.org/std/convert/trait.From.html) trait "
"allows for a type to define how to create itself from another type, hence "
"providing a very simple mechanism for converting between several types. "
"There are numerous implementations of this trait within the standard library "
"for conversion of primitive and common types."
msgstr ""
#: src/conversion/from_into.md:14
msgid "For example we can easily convert a `str` into a `String`"
msgstr ""
#: src/conversion/from_into.md:21
msgid "We can do something similar for defining a conversion for our own type."
msgstr ""
#: src/conversion/from_into.md:39 src/conversion/from_into.md:68
#: src/conversion/from_into.md:98
msgid "\"My number is {:?}\""
msgstr ""
#: src/conversion/from_into.md:43
msgid "`Into`"
msgstr ""
#: src/conversion/from_into.md:45
msgid ""
"The [`Into`](https://doc.rust-lang.org/std/convert/trait.Into.html) trait is "
"simply the reciprocal of the `From` trait. It defines how to convert a type "
"into another type."
msgstr ""
#: src/conversion/from_into.md:48
msgid ""
"Calling `into()` typically requires us to specify the result type as the "
"compiler is unable to determine this most of the time."
msgstr ""
#: src/conversion/from_into.md:66
msgid "// Try removing the type annotation\n"
msgstr ""
#: src/conversion/from_into.md:72
msgid "`From` and `Into` are interchangeable"
msgstr ""
#: src/conversion/from_into.md:74
msgid ""
"`From` and `Into` are designed to be complementary. We do not need to "
"provide an implementation for both traits. If you have implemented the "
"`From` trait for your type, `Into` will call it when necessary. Note, "
"however, that the converse is not true: implementing `Into` for your type "
"will not automatically provide it with an implementation of `From`."
msgstr ""
#: src/conversion/from_into.md:86
msgid "// Define `From`\n"
msgstr ""
#: src/conversion/from_into.md:96
msgid "// use `Into`\n"
msgstr ""
#: src/conversion/try_from_try_into.md:3
msgid ""
"Similar to [`From` and `Into`](from_into.html), [`TryFrom`](https://doc.rust-"
"lang.org/std/convert/trait.TryFrom.html) and [`TryInto`](https://doc.rust-"
"lang.org/std/convert/trait.TryInto.html) are generic traits for converting "
"between types. Unlike `From`/`Into`, the `TryFrom`/`TryInto` traits are used "
"for fallible conversions, and as such, return [`Result`](https://doc.rust-"
"lang.org/std/result/enum.Result.html)s."
msgstr ""
#: src/conversion/try_from_try_into.md:33
msgid "// TryFrom\n"
msgstr ""
#: src/conversion/try_from_try_into.md:38
msgid "// TryInto\n"
msgstr ""
#: src/conversion/string.md:1
msgid "To and from Strings"
msgstr ""
#: src/conversion/string.md:3
msgid "Converting to String"
msgstr ""
#: src/conversion/string.md:5
msgid ""
"To convert any type to a `String` is as simple as implementing the "
"[`ToString`](https://doc.rust-lang.org/std/string/trait.ToString.html) trait "
"for the type. Rather than doing so directly, you should implement the [`fmt::"
"Display`](https://doc.rust-lang.org/std/fmt/trait.Display.html) trait which "
"automatically provides [`ToString`](https://doc.rust-lang.org/std/string/"
"trait.ToString.html) and also allows printing the type as discussed in the "
"section on [`print!`](../hello/print.md)."
msgstr ""
#: src/conversion/string.md:19
msgid "\"Circle of radius {}\""
msgstr ""
#: src/conversion/string.md:29
msgid "Parsing a String"
msgstr ""
#: src/conversion/string.md:31
msgid ""
"It's useful to convert strings into many types, but one of the more common "
"string operations is to convert them from string to number. The idiomatic "
"approach to this is to use the [`parse`](https://doc.rust-lang.org/std/"
"primitive.str.html#method.parse) function and either to arrange for type "
"inference or to specify the type to parse using the 'turbofish' syntax. Both "
"alternatives are shown in the following example."
msgstr ""
#: src/conversion/string.md:37
msgid ""
"This will convert the string into the type specified as long as the "
"[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html) trait is "
"implemented for that type. This is implemented for numerous types within the "
"standard library."
msgstr ""
#: src/conversion/string.md:43 src/std_misc/process/wait.md:10
msgid "\"5\""
msgstr ""
#: src/conversion/string.md:44 src/error/result.md:33 src/error/result.md:68
#: src/error/result/result_map.md:42 src/error/result/result_map.md:75
#: src/error/result/result_alias.md:36 src/error/result/early_returns.md:36
#: src/error/result/enter_question_mark.md:34
#: src/error/result/enter_question_mark.md:67
msgid "\"10\""
msgstr ""
#: src/conversion/string.md:47
msgid "\"Sum: {:?}\""
msgstr ""
#: src/conversion/string.md:51
msgid ""
"To obtain this functionality on a user defined type simply implement the "
"[`FromStr`](https://doc.rust-lang.org/std/str/trait.FromStr.html) trait for "
"that type."
msgstr ""
#: src/conversion/string.md:74
msgid "\" 3 \""
msgstr ""
#: src/expression.md:3
msgid "A Rust program is (mostly) made up of a series of statements:"
msgstr ""
#: src/expression.md:7
msgid ""
"// statement\n"
" // statement\n"
" // statement\n"
msgstr ""
#: src/expression.md:13
msgid ""
"There are a few kinds of statements in Rust. The most common two are "
"declaring a variable binding, and using a `;` with an expression:"
msgstr ""
#: src/expression.md:18
msgid "// variable binding\n"
msgstr ""
#: src/expression.md:21
msgid "// expression;\n"
msgstr ""
#: src/expression.md:28
msgid ""
"Blocks are expressions too, so they can be used as values in assignments. "
"The last expression in the block will be assigned to the place expression "
"such as a local variable. However, if the last expression of the block ends "
"with a semicolon, the return value will be `()`."
msgstr ""
#: src/expression.md:41
msgid "// This expression will be assigned to `y`\n"
msgstr ""
#: src/expression.md:46
msgid ""
"// The semicolon suppresses this expression and `()` is assigned to `z`\n"
msgstr ""
#: src/expression.md:50
msgid "\"x is {:?}\""
msgstr ""
#: src/expression.md:51
msgid "\"y is {:?}\""
msgstr ""
#: src/expression.md:52
msgid "\"z is {:?}\""
msgstr ""
#: src/flow_control.md:3
msgid ""
"An integral part of any programming language are ways to modify control "
"flow: `if`/`else`, `for`, and others. Let's talk about them in Rust."
msgstr ""
#: src/flow_control/if_else.md:3
msgid ""
"Branching with `if`\\-`else` is similar to other languages. Unlike many of "
"them, the boolean condition doesn't need to be surrounded by parentheses, "
"and each condition is followed by a block. `if`\\-`else` conditionals are "
"expressions, and, all branches must return the same type."
msgstr ""
#: src/flow_control/if_else.md:13
msgid "\"{} is negative\""
msgstr ""
#: src/flow_control/if_else.md:15
msgid "\"{} is positive\""
msgstr ""
#: src/flow_control/if_else.md:17
msgid "\"{} is zero\""
msgstr ""
#: src/flow_control/if_else.md:22
msgid "\", and is a small number, increase ten-fold\""
msgstr ""
#: src/flow_control/if_else.md:24
msgid "// This expression returns an `i32`.\n"
msgstr ""
#: src/flow_control/if_else.md:27
msgid "\", and is a big number, halve the number\""
msgstr ""
#: src/flow_control/if_else.md:29
msgid "// This expression must return an `i32` as well.\n"
msgstr ""
#: src/flow_control/if_else.md:31
msgid "// TODO ^ Try suppressing this expression with a semicolon.\n"
msgstr ""
#: src/flow_control/if_else.md:33
msgid ""
"// ^ Don't forget to put a semicolon here! All `let` bindings need it.\n"
msgstr ""
#: src/flow_control/if_else.md:35 src/flow_control/match.md:35
msgid "\"{} -> {}\""
msgstr ""
#: src/flow_control/loop.md:3
msgid "Rust provides a `loop` keyword to indicate an infinite loop."
msgstr ""
#: src/flow_control/loop.md:5
msgid ""
"The `break` statement can be used to exit a loop at anytime, whereas the "
"`continue` statement can be used to skip the rest of the iteration and start "
"a new one."
msgstr ""
#: src/flow_control/loop.md:13
msgid "\"Let's count until infinity!\""
msgstr ""
#: src/flow_control/loop.md:15
msgid "// Infinite loop\n"
msgstr ""
#: src/flow_control/loop.md:20
msgid "\"three\""
msgstr ""
#: src/flow_control/loop.md:22
msgid "// Skip the rest of this iteration\n"
msgstr ""
#: src/flow_control/loop.md:29
msgid "\"OK, that's enough\""
msgstr ""
#: src/flow_control/loop.md:31
msgid "// Exit this loop\n"
msgstr ""
#: src/flow_control/loop/nested.md:3
msgid ""
"It's possible to `break` or `continue` outer loops when dealing with nested "
"loops. In these cases, the loops must be annotated with some `'label`, and "
"the label must be passed to the `break`/`continue` statement."
msgstr ""
#: src/flow_control/loop/nested.md:12
msgid "\"Entered the outer loop\""
msgstr ""
#: src/flow_control/loop/nested.md:15
msgid "\"Entered the inner loop\""
msgstr ""
#: src/flow_control/loop/nested.md:17
msgid ""
"// This would break only the inner loop\n"
" //break;\n"
msgstr ""
#: src/flow_control/loop/nested.md:20
msgid "// This breaks the outer loop\n"
msgstr ""
#: src/flow_control/loop/nested.md:24
msgid "\"This point will never be reached\""
msgstr ""
#: src/flow_control/loop/nested.md:27
msgid "\"Exited the outer loop\""
msgstr ""
#: src/flow_control/loop/return.md:3
msgid ""
"One of the uses of a `loop` is to retry an operation until it succeeds. If "
"the operation returns a value though, you might need to pass it to the rest "
"of the code: put it after the `break`, and it will be returned by the `loop` "
"expression."
msgstr ""
#: src/flow_control/while.md:3
msgid ""
"The `while` keyword can be used to run a loop while a condition is true."
msgstr ""
#: src/flow_control/while.md:5
msgid ""
"Let's write the infamous [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz) "
"using a `while` loop."
msgstr ""
#: src/flow_control/while.md:9
msgid "// A counter variable\n"
msgstr ""
#: src/flow_control/while.md:12
msgid "// Loop while `n` is less than 101\n"
msgstr ""
#: src/flow_control/while.md:15 src/flow_control/for.md:17
#: src/flow_control/for.md:37 src/fn.md:34
msgid "\"fizzbuzz\""
msgstr ""
#: src/flow_control/while.md:17 src/flow_control/for.md:19
#: src/flow_control/for.md:39 src/fn.md:36
msgid "\"fizz\""
msgstr ""
#: src/flow_control/while.md:19 src/flow_control/for.md:21
#: src/flow_control/for.md:41 src/fn.md:38
msgid "\"buzz\""
msgstr ""
#: src/flow_control/while.md:24
msgid "// Increment counter\n"
msgstr ""
#: src/flow_control/for.md:1
msgid "for loops"
msgstr ""
#: src/flow_control/for.md:5
msgid ""
"The `for in` construct can be used to iterate through an `Iterator`. One of "
"the easiest ways to create an iterator is to use the range notation `a..b`. "
"This yields values from `a` (inclusive) to `b` (exclusive) in steps of one."
msgstr ""
#: src/flow_control/for.md:10
msgid "Let's write FizzBuzz using `for` instead of `while`."
msgstr ""
#: src/flow_control/for.md:14 src/flow_control/for.md:34
msgid "// `n` will take the values: 1, 2, ..., 100 in each iteration\n"
msgstr ""
#: src/flow_control/for.md:29
msgid ""
"Alternatively, `a..=b` can be used for a range that is inclusive on both "
"ends. The above can be written as:"
msgstr ""
#: src/flow_control/for.md:49
msgid "for and iterators"
msgstr ""
#: src/flow_control/for.md:51
msgid ""
"The `for in` construct is able to interact with an `Iterator` in several "
"ways. As discussed in the section on the [Iterator](../trait/iter.md) trait, "
"by default the `for` loop will apply the `into_iter` function to the "
"collection. However, this is not the only means of converting collections "
"into iterators."
msgstr ""
#: src/flow_control/for.md:56
msgid ""
"`into_iter`, `iter` and `iter_mut` all handle the conversion of a collection "
"into an iterator in different ways, by providing different views on the data "
"within."
msgstr ""
#: src/flow_control/for.md:60
msgid ""
"`iter` - This borrows each element of the collection through each iteration. "
"Thus leaving the collection untouched and available for reuse after the loop."
msgstr ""
#: src/flow_control/for.md:65 src/flow_control/for.md:85
#: src/flow_control/for.md:104
msgid "\"Frank\""
msgstr ""
#: src/flow_control/for.md:65 src/flow_control/for.md:69
#: src/flow_control/for.md:85 src/flow_control/for.md:89
#: src/flow_control/for.md:104 src/flow_control/for.md:108
msgid "\"Ferris\""
msgstr ""
#: src/flow_control/for.md:69 src/flow_control/for.md:89
#: src/flow_control/for.md:108
msgid "\"There is a rustacean among us!\""
msgstr ""
#: src/flow_control/for.md:70
msgid "// TODO ^ Try deleting the & and matching just \"Ferris\"\n"
msgstr ""
#: src/flow_control/for.md:71 src/flow_control/for.md:90
msgid "\"Hello {}\""
msgstr ""
#: src/flow_control/for.md:75 src/flow_control/for.md:94
#: src/flow_control/for.md:113
msgid "\"names: {:?}\""
msgstr ""
#: src/flow_control/for.md:79
msgid ""
"`into_iter` - This consumes the collection so that on each iteration the "
"exact data is provided. Once the collection has been consumed it is no "
"longer available for reuse as it has been 'moved' within the loop."
msgstr ""
#: src/flow_control/for.md:99
msgid ""
"`iter_mut` - This mutably borrows each element of the collection, allowing "
"for the collection to be modified in place."
msgstr ""
#: src/flow_control/for.md:109
msgid "\"Hello\""
msgstr ""
#: src/flow_control/for.md:117
msgid ""
"In the above snippets note the type of `match` branch, that is the key "
"difference in the types of iteration. The difference in type then of course "
"implies differing actions that are able to be performed."
msgstr ""
#: src/flow_control/for.md:123
msgid "[Iterator](../trait/iter.md)"
msgstr ""
#: src/flow_control/match.md:3
msgid ""
"Rust provides pattern matching via the `match` keyword, which can be used "
"like a C `switch`. The first matching arm is evaluated and all possible "
"values must be covered."
msgstr ""
#: src/flow_control/match.md:10
msgid "// TODO ^ Try different values for `number`\n"
msgstr ""
#: src/flow_control/match.md:12
msgid "\"Tell me about {}\""
msgstr ""
#: src/flow_control/match.md:14
msgid "// Match a single value\n"
msgstr ""
#: src/flow_control/match.md:15
msgid "\"One!\""
msgstr ""
#: src/flow_control/match.md:16
msgid "// Match several values\n"
msgstr ""
#: src/flow_control/match.md:17
msgid "\"This is a prime\""
msgstr ""
#: src/flow_control/match.md:18
msgid ""
"// TODO ^ Try adding 13 to the list of prime values\n"
" // Match an inclusive range\n"
msgstr ""
#: src/flow_control/match.md:20
msgid "\"A teen\""
msgstr ""
#: src/flow_control/match.md:21
msgid "// Handle the rest of cases\n"
msgstr ""
#: src/flow_control/match.md:22
msgid "\"Ain't special\""
msgstr ""
#: src/flow_control/match.md:23
msgid "// TODO ^ Try commenting out this catch-all arm\n"
msgstr ""
#: src/flow_control/match.md:27
msgid "// Match is an expression too\n"
msgstr ""
#: src/flow_control/match.md:29
msgid "// The arms of a match must cover all the possible values\n"
msgstr ""
#: src/flow_control/match.md:32
msgid "// TODO ^ Try commenting out one of these arms\n"
msgstr ""
#: src/flow_control/match/destructuring.md:3
msgid "A `match` block can destructure items in a variety of ways."
msgstr ""
#: src/flow_control/match/destructuring.md:5
msgid "[Destructuring Tuples](destructuring/destructure_tuple.md)"
msgstr ""
#: src/flow_control/match/destructuring.md:6
msgid "[Destructuring Arrays and Slices](destructuring/destructure_slice.md)"
msgstr ""
#: src/flow_control/match/destructuring.md:7
msgid "[Destructuring Enums](destructuring/destructure_enum.md)"
msgstr ""
#: src/flow_control/match/destructuring.md:8
msgid "[Destructuring Pointers](destructuring/destructure_pointers.md)"
msgstr ""
#: src/flow_control/match/destructuring.md:9
msgid "[Destructuring Structures](destructuring/destructure_structures.md)"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:3
msgid "Tuples can be destructured in a `match` as follows:"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:8
msgid "// TODO ^ Try different values for `triple`\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:10
msgid "\"Tell me about {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:11
msgid "// Match can be used to destructure a tuple\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:13
msgid "// Destructure the second and third elements\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:14
msgid "\"First is `0`, `y` is {:?}, and `z` is {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:15
msgid "\"First is `1` and the rest doesn't matter\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:16
msgid "\"last is `2` and the rest doesn't matter\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:17
msgid "\"First is `3`, last is `4`, and the rest doesn't matter\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:18
msgid "// `..` can be used to ignore the rest of the tuple\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:19
msgid "\"It doesn't matter what they are\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:20
msgid "// `_` means don't bind the value to a variable\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_tuple.md:27
msgid "[Tuples](../../../primitives/tuples.md)"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:3
msgid "Like tuples, arrays and slices can be destructured this way:"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:7
msgid "// Try changing the values in the array, or make it a slice!\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:11
msgid ""
"// Binds the second and the third elements to the respective variables\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:13
msgid "\"array[0] = 0, array[1] = {}, array[2] = {}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:15
msgid "// Single values can be ignored with _\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:17
msgid "\"array[0] = 1, array[2] = {} and array[1] was ignored\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:21
msgid "// You can also bind some and ignore the rest\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:23
msgid "\"array[0] = -1, array[1] = {} and all the other ones were ignored\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:26
msgid ""
"// The code below would not compile\n"
" // [-1, second] => ...\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:29
msgid ""
"// Or store them in another array/slice (the type depends on\n"
" // that of the value that is being matched against)\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:32
msgid "\"array[0] = 3, array[1] = {} and the other elements were {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:36
msgid ""
"// Combining these patterns, we can, for example, bind the first and\n"
" // last values, and store the rest of them in a single array\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:39
msgid "\"array[0] = {}, middle = {:?}, array[2] = {}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_slice.md:48
msgid ""
"[Arrays and Slices](../../../primitives/array.md) and [Binding](../binding."
"md) for `@` sigil"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:3
msgid "An `enum` is destructured similarly:"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:6
msgid ""
"// `allow` required to silence warnings because only\n"
"// one variant is used.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:10
msgid "// These 3 are specified solely by their name.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:14
msgid "// These likewise tie `u32` tuples to different names: color models.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:24
msgid "// TODO ^ Try different variants for `color`\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:26
msgid "\"What color is it?\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:27
msgid "// An `enum` can be destructured using a `match`.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:29
msgid "\"The color is Red!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:30
msgid "\"The color is Blue!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:31
msgid "\"The color is Green!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:33
msgid "\"Red: {}, green: {}, and blue: {}!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:35
msgid "\"Hue: {}, saturation: {}, value: {}!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:37
msgid "\"Hue: {}, saturation: {}, lightness: {}!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:39
msgid "\"Cyan: {}, magenta: {}, yellow: {}!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:41
msgid "\"Cyan: {}, magenta: {}, yellow: {}, key (black): {}!\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:43
msgid "// Don't need another arm because all variants have been examined\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_enum.md:50
msgid ""
"[`#[allow(...)]`](../../../attribute/unused.md), [color models](https://en."
"wikipedia.org/wiki/Color_model) and [`enum`](../../../custom_types/enum.md)"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:3
msgid ""
"For pointers, a distinction needs to be made between destructuring and "
"dereferencing as they are different concepts which are used differently from "
"languages like C/C++."
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:7
msgid "Dereferencing uses `*`"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:8
msgid "Destructuring uses `&`, `ref`, and `ref mut`"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:12
msgid ""
"// Assign a reference of type `i32`. The `&` signifies there\n"
" // is a reference being assigned.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:17
msgid ""
"// If `reference` is pattern matched against `&val`, it results\n"
" // in a comparison like:\n"
" // `&i32`\n"
" // `&val`\n"
" // ^ We see that if the matching `&`s are dropped, then the `i32`\n"
" // should be assigned to `val`.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:23
msgid "\"Got a value via destructuring: {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:26
msgid "// To avoid the `&`, you dereference before matching.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:28
msgid "\"Got a value via dereferencing: {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:31
msgid ""
"// What if you don't start with a reference? `reference` was a `&`\n"
" // because the right side was already a reference. This is not\n"
" // a reference because the right side is not one.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:36
msgid ""
"// Rust provides `ref` for exactly this purpose. It modifies the\n"
" // assignment so that a reference is created for the element; this\n"
" // reference is assigned.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:41
msgid ""
"// Accordingly, by defining 2 values without references, references\n"
" // can be retrieved via `ref` and `ref mut`.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:46
msgid "// Use `ref` keyword to create a reference.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:48
msgid "\"Got a reference to a value: {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:51
msgid "// Use `ref mut` similarly.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:54
msgid ""
"// Got a reference. Gotta dereference it before we can\n"
" // add anything to it.\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:57
msgid "\"We added 10. `mut_value`: {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_pointers.md:65
msgid "[The ref pattern](../../../scope/borrow/ref.md)"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:3
msgid "Similarly, a `struct` can be destructured as shown:"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:12
msgid "// Try changing the values in the struct to see what happens\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:16
msgid "\"First of x is 1, b = {}, y = {} \""
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:18
msgid ""
"// you can destructure structs and rename the variables,\n"
" // the order is not important\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:20
msgid "\"y is 2, i = {:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:22
msgid "// and you can also ignore some variables:\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:23
msgid "\"y = {}, we don't care about x\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:24
msgid ""
"// this will give an error: pattern does not mention field `x`\n"
" //Foo { y } => println!(\"y = {}\", y),\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:30
msgid "// You do not need a match block to destructure structs:\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:32
msgid "\"Outside: x0 = {x0:?}, y0 = {y0}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:34
msgid "// Destructuring works with nested structs as well:\n"
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:41
msgid "\"Nested: nested_x = {nested_x:?}, nested_y = {nested_y:?}\""
msgstr ""
#: src/flow_control/match/destructuring/destructure_structures.md:47
msgid "[Structs](../../../custom_types/structs.md)"
msgstr ""
#: src/flow_control/match/guard.md:3
msgid "A `match` _guard_ can be added to filter the arm."
msgstr ""
#: src/flow_control/match/guard.md:14
msgid "// ^ TODO try different values for `temperature`\n"
msgstr ""
#: src/flow_control/match/guard.md:17
msgid "\"{}C is above 30 Celsius\""
msgstr ""
#: src/flow_control/match/guard.md:18
msgid "// The `if condition` part ^ is a guard\n"
msgstr ""
#: src/flow_control/match/guard.md:19
msgid "\"{}C is equal to or below 30 Celsius\""
msgstr ""
#: src/flow_control/match/guard.md:21
msgid "\"{}F is above 86 Fahrenheit\""
msgstr ""
#: src/flow_control/match/guard.md:22
msgid "\"{}F is equal to or below 86 Fahrenheit\""
msgstr ""
#: src/flow_control/match/guard.md:27
msgid ""
"Note that the compiler won't take guard conditions into account when "
"checking if all patterns are covered by the match expression."
msgstr ""
#: src/flow_control/match/guard.md:35
msgid "\"Zero\""
msgstr ""
#: src/flow_control/match/guard.md:36
msgid "\"Greater than zero\""
msgstr ""
#: src/flow_control/match/guard.md:37
msgid ""
"// _ => unreachable!(\"Should never happen.\"),\n"
" // TODO ^ uncomment to fix compilation\n"
msgstr ""
#: src/flow_control/match/guard.md:45
msgid ""
"[Tuples](../../primitives/tuples.md) [Enums](../../custom_types/enum.md)"
msgstr ""
#: src/flow_control/match/binding.md:3
msgid ""
"Indirectly accessing a variable makes it impossible to branch and use that "
"variable without re-binding. `match` provides the `@` sigil for binding "
"values to names:"
msgstr ""
#: src/flow_control/match/binding.md:8
msgid "// A function `age` which returns a `u32`.\n"
msgstr ""
#: src/flow_control/match/binding.md:14
msgid "\"Tell me what type of person you are\""
msgstr ""
#: src/flow_control/match/binding.md:17
msgid "\"I haven't celebrated my first birthday yet\""
msgstr ""
#: src/flow_control/match/binding.md:18
msgid ""
"// Could `match` 1 ..= 12 directly but then what age\n"
" // would the child be? Instead, bind to `n` for the\n"
" // sequence of 1 ..= 12. Now the age can be reported.\n"
msgstr ""
#: src/flow_control/match/binding.md:21
msgid "\"I'm a child of age {:?}\""
msgstr ""
#: src/flow_control/match/binding.md:22
msgid "\"I'm a teen of age {:?}\""
msgstr ""
#: src/flow_control/match/binding.md:23
msgid "// Nothing bound. Return the result.\n"
msgstr ""
#: src/flow_control/match/binding.md:24
msgid "\"I'm an old person of age {:?}\""
msgstr ""
#: src/flow_control/match/binding.md:29
msgid ""
"You can also use binding to \"destructure\" `enum` variants, such as "
"`Option`:"
msgstr ""
#: src/flow_control/match/binding.md:38
msgid ""
"// Got `Some` variant, match if its value, bound to `n`,\n"
" // is equal to 42.\n"
msgstr ""
#: src/flow_control/match/binding.md:40
msgid "\"The Answer: {}!\""
msgstr ""
#: src/flow_control/match/binding.md:41
msgid "// Match any other number.\n"
msgstr ""
#: src/flow_control/match/binding.md:42
msgid "\"Not interesting... {}\""
msgstr ""
#: src/flow_control/match/binding.md:43
msgid "// Match anything else (`None` variant).\n"
msgstr ""
#: src/flow_control/match/binding.md:51
msgid ""
"[`functions`](../../fn.md), [`enums`](../../custom_types/enum.md) and "
"[`Option`](../../std/option.md)"
msgstr ""
#: src/flow_control/if_let.md:3
msgid ""
"For some use cases, when matching enums, `match` is awkward. For example:"
msgstr ""
#: src/flow_control/if_let.md:6 src/flow_control/while_let.md:7
#: src/flow_control/while_let.md:35
msgid "// Make `optional` of type `Option<i32>`\n"
msgstr ""
#: src/flow_control/if_let.md:10
msgid "\"This is a really long string and `{:?}`\""
msgstr ""
#: src/flow_control/if_let.md:12
msgid ""
"// ^ Required because `match` is exhaustive. Doesn't it seem\n"
" // like wasted space?\n"
msgstr ""
#: src/flow_control/if_let.md:18
msgid ""
"`if let` is cleaner for this use case and in addition allows various failure "
"options to be specified:"
msgstr ""
#: src/flow_control/if_let.md:23
msgid "// All have type `Option<i32>`\n"
msgstr ""
#: src/flow_control/if_let.md:28
msgid ""
"// The `if let` construct reads: \"if `let` destructures `number` into\n"
" // `Some(i)`, evaluate the block (`{}`).\n"
msgstr ""
#: src/flow_control/if_let.md:31 src/flow_control/if_let.md:36
#: src/flow_control/if_let.md:46
msgid "\"Matched {:?}!\""
msgstr ""
#: src/flow_control/if_let.md:34
msgid "// If you need to specify a failure, use an else:\n"
msgstr ""
#: src/flow_control/if_let.md:38
msgid "// Destructure failed. Change to the failure case.\n"
msgstr ""
#: src/flow_control/if_let.md:39 src/flow_control/if_let.md:50
msgid "\"Didn't match a number. Let's go with a letter!\""
msgstr ""
#: src/flow_control/if_let.md:42
msgid "// Provide an altered failing condition.\n"
msgstr ""
#: src/flow_control/if_let.md:47
msgid ""
"// Destructure failed. Evaluate an `else if` condition to see if the\n"
" // alternate failure branch should be taken:\n"
msgstr ""
#: src/flow_control/if_let.md:52
msgid "// The condition evaluated false. This branch is the default:\n"
msgstr ""
#: src/flow_control/if_let.md:53
msgid "\"I don't like letters. Let's go with an emoticon :)!\""
msgstr ""
#: src/flow_control/if_let.md:58
msgid "In the same way, `if let` can be used to match any enum value:"
msgstr ""
#: src/flow_control/if_let.md:61
msgid "// Our example enum\n"
msgstr ""
#: src/flow_control/if_let.md:69
msgid "// Create example variables\n"
msgstr ""
#: src/flow_control/if_let.md:74 src/flow_control/if_let.md:110
msgid "// Variable a matches Foo::Bar\n"
msgstr ""
#: src/flow_control/if_let.md:76 src/flow_control/if_let.md:113
msgid "\"a is foobar\""
msgstr ""
#: src/flow_control/if_let.md:79
msgid ""
"// Variable b does not match Foo::Bar\n"
" // So this will print nothing\n"
msgstr ""
#: src/flow_control/if_let.md:82
msgid "\"b is foobar\""
msgstr ""
#: src/flow_control/if_let.md:85
msgid ""
"// Variable c matches Foo::Qux which has a value\n"
" // Similar to Some() in the previous example\n"
msgstr ""
#: src/flow_control/if_let.md:88
msgid "\"c is {}\""
msgstr ""
#: src/flow_control/if_let.md:91
msgid "// Binding also works with `if let`\n"
msgstr ""
#: src/flow_control/if_let.md:93
msgid "\"c is one hundred\""
msgstr ""
#: src/flow_control/if_let.md:98
msgid ""
"Another benefit is that `if let` allows us to match non-parameterized enum "
"variants. This is true even in cases where the enum doesn't implement or "
"derive `PartialEq`. In such cases `if Foo::Bar == a` would fail to compile, "
"because instances of the enum cannot be equated, however `if let` will "
"continue to work."
msgstr ""
#: src/flow_control/if_let.md:100
msgid "Would you like a challenge? Fix the following example to use `if let`:"
msgstr ""
#: src/flow_control/if_let.md:103
msgid ""
"// This enum purposely neither implements nor derives PartialEq.\n"
"// That is why comparing Foo::Bar == a fails below.\n"
msgstr ""
#: src/flow_control/if_let.md:112
msgid "// ^-- this causes a compile-time error. Use `if let` instead.\n"
msgstr ""
#: src/flow_control/if_let.md:120
msgid ""
"[`enum`](../custom_types/enum.md), [`Option`](../std/option.md), and the "
"[RFC](https://github.com/rust-lang/rfcs/pull/160)"
msgstr ""
#: src/flow_control/let_else.md:3
msgid "🛈 stable since: rust 1.65"
msgstr ""
#: src/flow_control/let_else.md:5
msgid ""
"🛈 you can target specific edition by compiling like this `rustc --"
"edition=2021 main.rs`"
msgstr ""
#: src/flow_control/let_else.md:8
msgid ""
"With `let`\\-`else`, a refutable pattern can match and bind variables in the "
"surrounding scope like a normal `let`, or else diverge (e.g. `break`, "
"`return`, `panic!`) when the pattern doesn't match."
msgstr ""
#: src/flow_control/let_else.md:16 src/flow_control/let_else.md:39
#: src/std/str.md:41
msgid "' '"
msgstr ""
#: src/flow_control/let_else.md:18 src/flow_control/let_else.md:42
msgid "\"Can't segment count item pair: '{s}'\""
msgstr ""
#: src/flow_control/let_else.md:21 src/flow_control/let_else.md:47
msgid "\"Can't parse integer: '{count_str}'\""
msgstr ""
#: src/flow_control/let_else.md:27 src/flow_control/let_else.md:52
msgid "\"3 chairs\""
msgstr ""
#: src/flow_control/let_else.md:27 src/flow_control/let_else.md:52
msgid "\"chairs\""
msgstr ""
#: src/flow_control/let_else.md:31
msgid ""
"The scope of name bindings is the main thing that makes this different from "
"`match` or `if let`\\-`else` expressions. You could previously approximate "
"these patterns with an unfortunate bit of repetition and an outer `let`:"
msgstr ""
#: src/flow_control/let_else.md:57
msgid ""
"[option](../std/option.md), [match](./match.md), [if let](./if_let.md) and "
"the [let-else RFC](https://rust-lang.github.io/rfcs/3137-let-else.ht
gitextract_2dn170dt/ ├── .gitattributes ├── .github/ │ └── workflows/ │ └── rbe.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── TRANSLATING.md ├── TRANSLATING_JA.md ├── TRANSLATING_ZH.md ├── book.toml ├── po/ │ ├── es.po │ ├── ja.po │ ├── ko.po │ └── zh.po ├── src/ │ ├── SUMMARY.md │ ├── attribute/ │ │ ├── cfg/ │ │ │ └── custom.md │ │ ├── cfg.md │ │ ├── crate.md │ │ └── unused.md │ ├── attribute.md │ ├── cargo/ │ │ ├── build_scripts.md │ │ ├── conventions.md │ │ ├── deps.md │ │ └── test.md │ ├── cargo.md │ ├── compatibility/ │ │ └── raw_identifiers.md │ ├── compatibility.md │ ├── conversion/ │ │ ├── from_into.md │ │ ├── string.md │ │ └── try_from_try_into.md │ ├── conversion.md │ ├── crates/ │ │ ├── lib.md │ │ └── using_lib.md │ ├── crates.md │ ├── custom_types/ │ │ ├── constants.md │ │ ├── enum/ │ │ │ ├── c_like.md │ │ │ ├── enum_use.md │ │ │ └── testcase_linked_list.md │ │ ├── enum.md │ │ └── structs.md │ ├── custom_types.md │ ├── error/ │ │ ├── abort_unwind.md │ │ ├── iter_result.md │ │ ├── multiple_error_types/ │ │ │ ├── boxing_errors.md │ │ │ ├── define_error_type.md │ │ │ ├── option_result.md │ │ │ ├── reenter_question_mark.md │ │ │ └── wrap_error.md │ │ ├── multiple_error_types.md │ │ ├── option_unwrap/ │ │ │ ├── and_then.md │ │ │ ├── defaults.md │ │ │ ├── map.md │ │ │ └── question_mark.md │ │ ├── option_unwrap.md │ │ ├── panic.md │ │ ├── result/ │ │ │ ├── early_returns.md │ │ │ ├── enter_question_mark.md │ │ │ ├── result_alias.md │ │ │ └── result_map.md │ │ └── result.md │ ├── error.md │ ├── expression.md │ ├── flow_control/ │ │ ├── for.md │ │ ├── if_else.md │ │ ├── if_let.md │ │ ├── let_else.md │ │ ├── loop/ │ │ │ ├── nested.md │ │ │ └── return.md │ │ ├── loop.md │ │ ├── match/ │ │ │ ├── binding.md │ │ │ ├── destructuring/ │ │ │ │ ├── destructure_enum.md │ │ │ │ ├── destructure_pointers.md │ │ │ │ ├── destructure_slice.md │ │ │ │ ├── destructure_structures.md │ │ │ │ └── destructure_tuple.md │ │ │ ├── destructuring.md │ │ │ └── guard.md │ │ ├── match.md │ │ ├── while.md │ │ └── while_let.md │ ├── flow_control.md │ ├── fn/ │ │ ├── closures/ │ │ │ ├── anonymity.md │ │ │ ├── capture.md │ │ │ ├── closure_examples/ │ │ │ │ ├── iter_any.md │ │ │ │ └── iter_find.md │ │ │ ├── closure_examples.md │ │ │ ├── input_functions.md │ │ │ ├── input_parameters.md │ │ │ └── output_parameters.md │ │ ├── closures.md │ │ ├── diverging.md │ │ ├── hof.md │ │ └── methods.md │ ├── fn.md │ ├── generics/ │ │ ├── assoc_items/ │ │ │ ├── the_problem.md │ │ │ └── types.md │ │ ├── assoc_items.md │ │ ├── bounds/ │ │ │ └── testcase_empty.md │ │ ├── bounds.md │ │ ├── gen_fn.md │ │ ├── gen_trait.md │ │ ├── impl.md │ │ ├── multi_bounds.md │ │ ├── new_types.md │ │ ├── phantom/ │ │ │ └── testcase_units.md │ │ ├── phantom.md │ │ └── where.md │ ├── generics.md │ ├── hello/ │ │ ├── comment.md │ │ ├── print/ │ │ │ ├── fmt.md │ │ │ ├── print_debug.md │ │ │ ├── print_display/ │ │ │ │ └── testcase_list.md │ │ │ └── print_display.md │ │ └── print.md │ ├── hello.md │ ├── index.md │ ├── macros/ │ │ ├── designators.md │ │ ├── dry.md │ │ ├── dsl.md │ │ ├── overload.md │ │ ├── repeat.md │ │ ├── syntax.md │ │ └── variadics.md │ ├── macros.md │ ├── meta/ │ │ ├── doc.md │ │ └── playground.md │ ├── meta.md │ ├── mod/ │ │ ├── split.md │ │ ├── struct_visibility.md │ │ ├── super.md │ │ ├── use.md │ │ └── visibility.md │ ├── mod.md │ ├── primitives/ │ │ ├── array.md │ │ ├── literals.md │ │ └── tuples.md │ ├── primitives.md │ ├── scope/ │ │ ├── borrow/ │ │ │ ├── alias.md │ │ │ ├── mut.md │ │ │ └── ref.md │ │ ├── borrow.md │ │ ├── lifetime/ │ │ │ ├── elision.md │ │ │ ├── explicit.md │ │ │ ├── fn.md │ │ │ ├── lifetime_bounds.md │ │ │ ├── lifetime_coercion.md │ │ │ ├── methods.md │ │ │ ├── static_lifetime.md │ │ │ ├── struct.md │ │ │ └── trait.md │ │ ├── lifetime.md │ │ ├── move/ │ │ │ ├── mut.md │ │ │ └── partial_move.md │ │ ├── move.md │ │ └── raii.md │ ├── scope.md │ ├── std/ │ │ ├── arc.md │ │ ├── box.md │ │ ├── hash/ │ │ │ ├── alt_key_types.md │ │ │ └── hashset.md │ │ ├── hash.md │ │ ├── option.md │ │ ├── panic.md │ │ ├── rc.md │ │ ├── result/ │ │ │ └── question_mark.md │ │ ├── result.md │ │ ├── str.md │ │ └── vec.md │ ├── std.md │ ├── std_misc/ │ │ ├── arg/ │ │ │ └── matching.md │ │ ├── arg.md │ │ ├── channels.md │ │ ├── ffi.md │ │ ├── file/ │ │ │ ├── create.md │ │ │ ├── open.md │ │ │ └── read_lines.md │ │ ├── file.md │ │ ├── fs.md │ │ ├── path.md │ │ ├── process/ │ │ │ ├── pipe.md │ │ │ └── wait.md │ │ ├── process.md │ │ ├── threads/ │ │ │ └── testcase_mapreduce.md │ │ └── threads.md │ ├── std_misc.md │ ├── testing/ │ │ ├── dev_dependencies.md │ │ ├── doc_testing.md │ │ ├── integration_testing.md │ │ └── unit_testing.md │ ├── testing.md │ ├── trait/ │ │ ├── clone.md │ │ ├── derive.md │ │ ├── disambiguating.md │ │ ├── drop.md │ │ ├── dyn.md │ │ ├── impl_trait.md │ │ ├── iter.md │ │ ├── ops.md │ │ └── supertraits.md │ ├── trait.md │ ├── types/ │ │ ├── alias.md │ │ ├── cast.md │ │ ├── inference.md │ │ └── literals.md │ ├── types.md │ ├── unsafe/ │ │ └── asm.md │ ├── unsafe.md │ ├── variable_bindings/ │ │ ├── declare.md │ │ ├── freeze.md │ │ ├── mut.md │ │ └── scope.md │ └── variable_bindings.md ├── theme/ │ ├── css/ │ │ └── language-picker.css │ └── head.hbs └── triagebot.toml
Condensed preview — 217 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,841K chars).
[
{
"path": ".gitattributes",
"chars": 92,
"preview": "# Set the default behavior, in case people don't have core.autocrlf set.\n* text=auto eol=lf\n"
},
{
"path": ".github/workflows/rbe.yml",
"chars": 2170,
"preview": "name: CI\non: [push, pull_request]\n\nenv:\n # Update the language picker in index.hbs to link new languages.\n LANGUAGES: "
},
{
"path": ".gitignore",
"chars": 77,
"preview": "book\n\npo/messages.pot\n\n.vscode/\n\n# Auto-generated files from macOS\n.DS_Store\n"
},
{
"path": "CODE_OF_CONDUCT.md",
"chars": 5265,
"preview": "# The Rust Code of Conduct\n\nA version of this document [can be found online](https://www.rust-lang.org/conduct.html).\n\n#"
},
{
"path": "CONTRIBUTING.md",
"chars": 2832,
"preview": "# Rust by Example contribution guidelines\n\nThank you for your interest in making Rust by Example (also known as RBE)\nbet"
},
{
"path": "LICENSE-APACHE",
"chars": 10847,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "LICENSE-MIT",
"chars": 1058,
"preview": "Copyright (c) 2014 Jorge Aparicio\n\nPermission is hereby granted, free of charge, to any\nperson obtaining a copy of this "
},
{
"path": "README.md",
"chars": 2717,
"preview": "# Rust By Example\n\n[](h"
},
{
"path": "TRANSLATING.md",
"chars": 2803,
"preview": "# Rust by Example translation guidelines\n\nPlease see the [CONTRIBUTING.md] file for general contribution guidelines.\nThi"
},
{
"path": "TRANSLATING_JA.md",
"chars": 10523,
"preview": "# Rust by Example 日本語版 翻訳ガイド\n\n日本語版の翻訳は https://github.com/rust-lang-ja/rust-by-example にて日本語のレビューを行います。\n翻訳に貢献される方は以下のフロー"
},
{
"path": "TRANSLATING_ZH.md",
"chars": 794,
"preview": "# Rust by Example 中文版翻译指南\n\nRust by Example 中文版的翻译在 https://github.com/rust-lang-cn/rust-by-example 仓库进行审核和校对。\n\n如果您希望参与翻译"
},
{
"path": "book.toml",
"chars": 702,
"preview": "[book]\ntitle = \"Rust By Example\"\ndescription = \"Rust by Example (RBE) is a collection of runnable examples that illustra"
},
{
"path": "po/es.po",
"chars": 454291,
"preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Rust By Example\\n\"\n\"POT-Creation-Date: 2025-01-30T21:37:19-06:00\\n\"\n\"PO-Revision"
},
{
"path": "po/ja.po",
"chars": 572315,
"preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Rust By Example\\n\"\n\"POT-Creation-Date: 2024-06-14T21:07:36+09:00\\n\"\n\"PO-Revision"
},
{
"path": "po/ko.po",
"chars": 599006,
"preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Rust By Example\\n\"\n\"POT-Creation-Date: 2026-01-13T13:46:42+09:00\\n\"\n\"PO-Revision"
},
{
"path": "po/zh.po",
"chars": 559034,
"preview": "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Rust By Example\\n\"\n\"POT-Creation-Date: 2025-08-08T08:55:44+08:00\\n\"\n\"PO-Revision"
},
{
"path": "src/SUMMARY.md",
"chars": 9129,
"preview": "# Summary\n\n[Introduction](index.md)\n\n- [Hello World](hello.md)\n - [Comments](hello/comment.md)\n - [Formatted print"
},
{
"path": "src/attribute/cfg/custom.md",
"chars": 505,
"preview": "# Custom\n\nSome conditionals like `target_os` are implicitly provided by `rustc`, but\ncustom conditionals must be passed "
},
{
"path": "src/attribute/cfg.md",
"chars": 1446,
"preview": "# `cfg`\n\nConfiguration conditional checks are possible through two different operators:\n\n* the `cfg` attribute: `#[cfg(."
},
{
"path": "src/attribute/crate.md",
"chars": 1077,
"preview": "# Crates\n\nThe `crate_type` attribute can be used to tell the compiler whether a crate is\na binary or a library (and even"
},
{
"path": "src/attribute/unused.md",
"chars": 663,
"preview": "# `dead_code`\n\nThe compiler provides a `dead_code`\n[*lint*][lint] that will warn\nabout unused functions. An *attribute* "
},
{
"path": "src/attribute.md",
"chars": 2046,
"preview": "# Attributes\n\nAn attribute is metadata applied to some module, crate or item. This metadata\ncan be used to/for:\n\n<!-- TO"
},
{
"path": "src/cargo/build_scripts.md",
"chars": 1433,
"preview": "# Build Scripts\n\nSometimes a normal build from `cargo` is not enough. Perhaps your crate needs\nsome pre-requisites befor"
},
{
"path": "src/cargo/conventions.md",
"chars": 901,
"preview": "# Conventions\n\nIn the previous chapter, we saw the following directory hierarchy:\n\n```txt\nfoo\n├── Cargo.toml\n└── src\n "
},
{
"path": "src/cargo/deps.md",
"chars": 3015,
"preview": "# Dependencies\n\nMost programs have dependencies on some libraries. If you have ever managed\ndependencies by hand, you kn"
},
{
"path": "src/cargo/test.md",
"chars": 3732,
"preview": "# Testing\n\nAs we know testing is integral to any piece of software! Rust has first-class\nsupport for unit and integratio"
},
{
"path": "src/cargo.md",
"chars": 475,
"preview": "# Cargo\n\n`cargo` is the official Rust package management tool. It has lots of really\nuseful features to improve code qua"
},
{
"path": "src/compatibility/raw_identifiers.md",
"chars": 1113,
"preview": "# Raw identifiers\n\nRust, like many programming languages, has the concept of \"keywords\".\nThese identifiers mean somethin"
},
{
"path": "src/compatibility.md",
"chars": 239,
"preview": "# Compatibility\n\nThe Rust language is evolving rapidly, and because of this certain compatibility\nissues can arise, desp"
},
{
"path": "src/conversion/from_into.md",
"chars": 2515,
"preview": "# `From` and `Into`\n\nThe [`From`] and [`Into`] traits are inherently linked, and this is actually part of\nits implementa"
},
{
"path": "src/conversion/string.md",
"chars": 2346,
"preview": "# To and from Strings\n\n## Converting to String\n\nTo convert any type to a `String` is as simple as implementing the [`ToS"
},
{
"path": "src/conversion/try_from_try_into.md",
"chars": 1216,
"preview": "# `TryFrom` and `TryInto`\n\nSimilar to [`From` and `Into`][from-into], [`TryFrom`] and [`TryInto`] are\ngeneric traits for"
},
{
"path": "src/conversion.md",
"chars": 537,
"preview": "# Conversion\n\nPrimitive types can be converted to each other through [casting].\n\nRust addresses conversion between custo"
},
{
"path": "src/crates/lib.md",
"chars": 739,
"preview": "# Creating a Library\n\nLet's create a library, and then see how to link it to another crate.\n\nIn `rary.rs`:\n\n```rust,igno"
},
{
"path": "src/crates/using_lib.md",
"chars": 782,
"preview": "# Using a Library\n\nTo link a crate to this new library you may use `rustc`'s `--extern` flag. All\nof its items will then"
},
{
"path": "src/crates.md",
"chars": 621,
"preview": "# Crates\n\nA crate is a compilation unit in Rust. Whenever `rustc some_file.rs` is called,\n`some_file.rs` is treated as t"
},
{
"path": "src/custom_types/constants.md",
"chars": 1208,
"preview": "# constants\n\nRust has two different types of constants which can be declared in any scope\nincluding global. Both require"
},
{
"path": "src/custom_types/enum/c_like.md",
"chars": 678,
"preview": "# C-like\n\n`enum` can also be used as C-like enums.\n\n```rust,editable\n// An attribute to hide warnings for unused code.\n#"
},
{
"path": "src/custom_types/enum/enum_use.md",
"chars": 1183,
"preview": "# use\n\nThe `use` declaration can be used to avoid typing the full module path to access a name:\n\n```rust,editable\n// An "
},
{
"path": "src/custom_types/enum/testcase_linked_list.md",
"chars": 2548,
"preview": "# Testcase: linked-list\n\nA common way to implement a linked-list is via `enums`:\n\n```rust,editable\nuse crate::List::*;\n\n"
},
{
"path": "src/custom_types/enum.md",
"chars": 3104,
"preview": "# Enums\n\nThe `enum` keyword allows the creation of a type which may be one of a few\ndifferent variants. Any variant whic"
},
{
"path": "src/custom_types/structs.md",
"chars": 2892,
"preview": "# Structures\n\nThere are three types of structures (\"structs\") that can be created using the\n`struct` keyword:\n\n* Tuple s"
},
{
"path": "src/custom_types.md",
"chars": 217,
"preview": "# Custom Types\n\nRust custom data types are formed mainly through the two keywords:\n\n* `struct`: define a structure\n* `en"
},
{
"path": "src/error/abort_unwind.md",
"chars": 1433,
"preview": "# `abort` and `unwind`\n\nThe previous section illustrates the error handling mechanism `panic`. Different code paths can"
},
{
"path": "src/error/iter_result.md",
"chars": 2816,
"preview": "# Iterating over `Result`s\n\nAn `Iter::map` operation might fail, for example:\n\n```rust,editable\nfn main() {\n let stri"
},
{
"path": "src/error/multiple_error_types/boxing_errors.md",
"chars": 1903,
"preview": "# `Box`ing errors\n\nA way to write simple code while preserving the original errors is to [`Box`][box]\nthem. The drawbac"
},
{
"path": "src/error/multiple_error_types/define_error_type.md",
"chars": 2198,
"preview": "# Defining an error type\n\nSometimes it simplifies the code to mask all of the different errors with a\nsingle type of err"
},
{
"path": "src/error/multiple_error_types/option_result.md",
"chars": 1589,
"preview": "# Pulling `Result`s out of `Option`s\n\nThe most basic way of handling mixed error types is to just embed them in each\noth"
},
{
"path": "src/error/multiple_error_types/reenter_question_mark.md",
"chars": 2438,
"preview": "# Other uses of `?`\n\nNotice in the previous example that our immediate reaction to calling\n`parse` is to `map` the error"
},
{
"path": "src/error/multiple_error_types/wrap_error.md",
"chars": 3008,
"preview": "# Wrapping errors\n\nAn alternative to boxing errors is to wrap them in your own error type.\n\n```rust,editable\nuse std::er"
},
{
"path": "src/error/multiple_error_types.md",
"chars": 1303,
"preview": "# Multiple error types\n\nThe previous examples have always been very convenient; `Result`s interact\nwith other `Result`s "
},
{
"path": "src/error/option_unwrap/and_then.md",
"chars": 2704,
"preview": "# Combinators: `and_then`\n\n`map()` was described as a chainable way to simplify `match` statements.\nHowever, using `map("
},
{
"path": "src/error/option_unwrap/defaults.md",
"chars": 4992,
"preview": "# Unpacking options and defaults\n\nThere is more than one way to unpack an `Option` and fall back on a default if it is `"
},
{
"path": "src/error/option_unwrap/map.md",
"chars": 2691,
"preview": "# Combinators: `map`\n\n`match` is a valid method for handling `Option`s. However, you may\neventually find heavy usage ted"
},
{
"path": "src/error/option_unwrap/question_mark.md",
"chars": 1612,
"preview": "# Unpacking options with `?`\n\nYou can unpack `Option`s by using `match` statements, but it's often easier to\nuse the `?`"
},
{
"path": "src/error/option_unwrap.md",
"chars": 2244,
"preview": "# `Option` & `unwrap`\n\nIn the last example, we showed that we can induce program failure at will.\nWe told our program to"
},
{
"path": "src/error/panic.md",
"chars": 637,
"preview": "# `panic`\n\nThe simplest error handling mechanism we will see is `panic`. It prints an\nerror message, starts unwinding th"
},
{
"path": "src/error/result/early_returns.md",
"chars": 1474,
"preview": "# Early returns\n\nIn the previous example, we explicitly handled the errors using combinators.\nAnother way to deal with t"
},
{
"path": "src/error/result/enter_question_mark.md",
"chars": 2309,
"preview": "# Introducing `?`\n\nSometimes we just want the simplicity of `unwrap` without the possibility of\na `panic`. Until now, `u"
},
{
"path": "src/error/result/result_alias.md",
"chars": 1475,
"preview": "# aliases for `Result`\n\nHow about when we want to reuse a specific `Result` type many times?\nRecall that Rust allows us "
},
{
"path": "src/error/result/result_map.md",
"chars": 2963,
"preview": "# `map` for `Result`\n\nPanicking in the previous example's `multiply` does not make for robust code.\nGenerally, we want t"
},
{
"path": "src/error/result.md",
"chars": 2908,
"preview": "# `Result`\n\n[`Result`][result] is a richer version of the [`Option`][option] type that\ndescribes possible *error* instea"
},
{
"path": "src/error.md",
"chars": 1637,
"preview": "# Error handling\n\nError handling is the process of handling the possibility of failure. For\nexample, failing to read a f"
},
{
"path": "src/expression.md",
"chars": 1129,
"preview": "# Expressions\n\nA Rust program is (mostly) made up of a series of statements:\n\n```rust,editable\nfn main() {\n // statem"
},
{
"path": "src/flow_control/for.md",
"chars": 3445,
"preview": "# for loops\n\n## for and range\n\nThe `for in` construct can be used to iterate through an `Iterator`.\nOne of the easiest w"
},
{
"path": "src/flow_control/if_else.md",
"chars": 1047,
"preview": "# if/else\n\nBranching with `if`-`else` is similar to other languages. Unlike many of them,\nthe boolean condition doesn't "
},
{
"path": "src/flow_control/if_let.md",
"chars": 3401,
"preview": "# if let\n\nFor some use cases, when matching enums, `match` is awkward. For example:\n\n```rust\n// Make `optional` of type "
},
{
"path": "src/flow_control/let_else.md",
"chars": 1789,
"preview": "# let-else\n\n> 🛈 stable since: rust 1.65\n>\n> 🛈 you can target specific edition by compiling like this\n> `rustc --edition="
},
{
"path": "src/flow_control/loop/nested.md",
"chars": 704,
"preview": "# Nesting and labels\n\nIt's possible to `break` or `continue` outer loops when dealing with nested\nloops. In these cases,"
},
{
"path": "src/flow_control/loop/return.md",
"chars": 477,
"preview": "# Returning from loops\n\nOne of the uses of a `loop` is to retry an operation until it succeeds. If the\noperation returns"
},
{
"path": "src/flow_control/loop.md",
"chars": 694,
"preview": "# loop\n\nRust provides a `loop` keyword to indicate an infinite loop.\n\nThe `break` statement can be used to exit a loop a"
},
{
"path": "src/flow_control/match/binding.md",
"chars": 2377,
"preview": "# Binding\n\nIndirectly accessing a variable makes it impossible to branch and use that\nvariable without re-binding. `matc"
},
{
"path": "src/flow_control/match/destructuring/destructure_enum.md",
"chars": 1691,
"preview": "# enums\n\nAn `enum` is destructured similarly:\n\n```rust,editable\n// `allow` required to silence warnings because only\n// "
},
{
"path": "src/flow_control/match/destructuring/destructure_pointers.md",
"chars": 2009,
"preview": "# pointers/ref\n\nFor pointers, a distinction needs to be made between destructuring\nand dereferencing as they are differe"
},
{
"path": "src/flow_control/match/destructuring/destructure_slice.md",
"chars": 1574,
"preview": "# arrays/slices\n\nLike tuples, arrays and slices can be destructured this way:\n\n```rust,editable\nfn main() {\n // Try c"
},
{
"path": "src/flow_control/match/destructuring/destructure_structures.md",
"chars": 1295,
"preview": "# structs\n\nSimilarly, a `struct` can be destructured as shown:\n\n```rust,editable\nfn main() {\n struct Foo {\n x:"
},
{
"path": "src/flow_control/match/destructuring/destructure_tuple.md",
"chars": 902,
"preview": "# tuples\n\nTuples can be destructured in a `match` as follows:\n\n```rust,editable\nfn main() {\n let triple = (0, -2, 3);"
},
{
"path": "src/flow_control/match/destructuring.md",
"chars": 609,
"preview": "# Destructuring\n\nA `match` block can destructure items in a variety of ways.\n\n* [Destructuring Tuples][tuple]\n* [Destruc"
},
{
"path": "src/flow_control/match/guard.md",
"chars": 1239,
"preview": "# Guards\n\nA `match` *guard* can be added to filter the arm.\n\n```rust,editable\n#[allow(dead_code)]\nenum Temperature {\n "
},
{
"path": "src/flow_control/match.md",
"chars": 1076,
"preview": "# match\n\nRust provides pattern matching via the `match` keyword, which can be used like\na C `switch`. The first matching"
},
{
"path": "src/flow_control/while.md",
"chars": 636,
"preview": "# while\n\nThe `while` keyword can be used to run a loop while a condition is true.\n\nLet's write the infamous [FizzBuzz][f"
},
{
"path": "src/flow_control/while_let.md",
"chars": 1768,
"preview": "# while let\n\nSimilar to `if let`, `while let` can make awkward `match` sequences\nmore tolerable. Consider the following "
},
{
"path": "src/flow_control.md",
"chars": 160,
"preview": "# Flow of Control\n\nAn integral part of any programming language are ways to modify control flow:\n`if`/`else`, `for`, and"
},
{
"path": "src/fn/closures/anonymity.md",
"chars": 1743,
"preview": "# Type anonymity\n\nClosures succinctly capture variables from enclosing scopes. Does this have\nany consequences? It surel"
},
{
"path": "src/fn/closures/capture.md",
"chars": 3546,
"preview": "# Capturing\n\nClosures are inherently flexible and will do what the functionality requires\nto make the closure work witho"
},
{
"path": "src/fn/closures/closure_examples/iter_any.md",
"chars": 1908,
"preview": "# Iterator::any\n\n`Iterator::any` is a function which when passed an iterator, will return\n`true` if any element satisfie"
},
{
"path": "src/fn/closures/closure_examples/iter_find.md",
"chars": 3055,
"preview": "# Searching through iterators\n\n`Iterator::find` is a function which iterates over an iterator and searches for the\nfirst"
},
{
"path": "src/fn/closures/closure_examples.md",
"chars": 100,
"preview": "# Examples in `std`\n\nThis section contains a few examples of using closures from the `std` library.\n"
},
{
"path": "src/fn/closures/input_functions.md",
"chars": 1094,
"preview": "# Input functions\n\nSince closures may be used as arguments, you might wonder if the same can be said\nabout functions. An"
},
{
"path": "src/fn/closures/input_parameters.md",
"chars": 3196,
"preview": "# As input parameters\n\nWhile Rust chooses how to capture variables on the fly mostly without type\nannotation, this ambig"
},
{
"path": "src/fn/closures/output_parameters.md",
"chars": 1375,
"preview": "# As output parameters\n\nClosures as input parameters are possible, so returning closures as\noutput parameters should als"
},
{
"path": "src/fn/closures.md",
"chars": 1930,
"preview": "# Closures\n\nClosures are functions that can capture the enclosing environment. For\nexample, a closure that captures the "
},
{
"path": "src/fn/diverging.md",
"chars": 2215,
"preview": "# Diverging functions\n\nDiverging functions never return. They are marked using `!`, which is an empty type.\n\n```rust\nfn "
},
{
"path": "src/fn/hof.md",
"chars": 1353,
"preview": "# Higher Order Functions\n\nRust provides Higher Order Functions (HOF). These are functions that\ntake one or more function"
},
{
"path": "src/fn/methods.md",
"chars": 3392,
"preview": "# Associated functions & Methods\n\nSome functions are connected to a particular type. These come in two forms:\nassociated"
},
{
"path": "src/fn.md",
"chars": 1436,
"preview": "# Functions\n\nFunctions are declared using the `fn` keyword. Its arguments are type\nannotated, just like variables, and, "
},
{
"path": "src/generics/assoc_items/the_problem.md",
"chars": 2206,
"preview": "# The Problem\n\nA `trait` that is generic over its container type has type specification\nrequirements - users of the `tra"
},
{
"path": "src/generics/assoc_items/types.md",
"chars": 2369,
"preview": "# Associated types\n\nThe use of \"Associated types\" improves the overall readability of code\nby moving inner types locally"
},
{
"path": "src/generics/assoc_items.md",
"chars": 505,
"preview": "# Associated items\n\n\"Associated Items\" refers to a set of rules pertaining to [`item`][items]s\nof various types. It is a"
},
{
"path": "src/generics/bounds/testcase_empty.md",
"chars": 1211,
"preview": "# Testcase: empty bounds\n\nA consequence of how bounds work is that even if a `trait` doesn't\ninclude any functionality, "
},
{
"path": "src/generics/bounds.md",
"chars": 2251,
"preview": "# Bounds\n\nWhen working with generics, the type parameters often must use traits as *bounds* to\nstipulate what functional"
},
{
"path": "src/generics/gen_fn.md",
"chars": 2181,
"preview": "# Functions\n\nThe same set of rules can be applied to functions: a type `T` becomes\ngeneric when preceded by `<T>`.\n\nUsin"
},
{
"path": "src/generics/gen_trait.md",
"chars": 1066,
"preview": "# Traits\n\nOf course `trait`s can also be generic. Here we define one which reimplements\nthe `Drop` `trait` as a generic "
},
{
"path": "src/generics/impl.md",
"chars": 1125,
"preview": "# Implementation\n\nSimilar to functions, implementations require care to remain generic.\n\n```rust\nstruct S; // Concrete t"
},
{
"path": "src/generics/multi_bounds.md",
"chars": 754,
"preview": "# Multiple bounds\n\nMultiple bounds for a single type can be applied with a `+`. Like normal, different types are\nseparat"
},
{
"path": "src/generics/new_types.md",
"chars": 1264,
"preview": "# New Type Idiom\n\nThe `newtype` idiom gives compile time guarantees that the right type of value is supplied\nto a progra"
},
{
"path": "src/generics/phantom/testcase_units.md",
"chars": 2758,
"preview": "# Testcase: unit clarification\n\nA useful method of unit conversions can be examined by implementing `Add`\nwith a phantom"
},
{
"path": "src/generics/phantom.md",
"chars": 2253,
"preview": "# Phantom type parameters\n\nA phantom type parameter is one that doesn't show up at runtime,\nbut is checked statically (a"
},
{
"path": "src/generics/where.md",
"chars": 1549,
"preview": "# Where clauses\n\nA bound can also be expressed using a `where` clause immediately\nbefore the opening `{`, rather than at"
},
{
"path": "src/generics.md",
"chars": 2369,
"preview": "# Generics\n\n*Generics* is the topic of generalizing types and functionalities to broader\ncases. This is extremely useful"
},
{
"path": "src/hello/comment.md",
"chars": 1648,
"preview": "# Comments\n\nAny program requires comments, and Rust supports\na few different varieties:\n\n## Regular Comments\n\nThese are "
},
{
"path": "src/hello/print/fmt.md",
"chars": 3300,
"preview": "# Formatting\n\nWe've seen that formatting is specified via a *format string*:\n\n* `format!(\"{}\", foo)` -> `\"3735928559\"`\n*"
},
{
"path": "src/hello/print/print_debug.md",
"chars": 2376,
"preview": "# Debug\n\nAll types which want to use `std::fmt` formatting `traits` require an\nimplementation to be printable. Automatic"
},
{
"path": "src/hello/print/print_display/testcase_list.md",
"chars": 2000,
"preview": "# Testcase: List\n\nImplementing `fmt::Display` for a structure where the elements must each be\nhandled sequentially is tr"
},
{
"path": "src/hello/print/print_display.md",
"chars": 4683,
"preview": "# Display\n\n`fmt::Debug` hardly looks compact and clean, so it is often advantageous to\ncustomize the output appearance. "
},
{
"path": "src/hello/print.md",
"chars": 4724,
"preview": "# Formatted print\n\nPrinting is handled by a series of [`macros`][macros] defined in\n[`std::fmt`][fmt] some of which are:"
},
{
"path": "src/hello.md",
"chars": 1080,
"preview": "# Hello World\n\nThis is the source code of the traditional Hello World program.\n\n```rust,editable\n// This is a comment, a"
},
{
"path": "src/index.md",
"chars": 2757,
"preview": "# Rust by Example\n\n[Rust][rust] is a modern systems programming language focusing on safety, speed,\nand concurrency. It "
},
{
"path": "src/macros/designators.md",
"chars": 1727,
"preview": "# Designators\n\nThe arguments of a macro are prefixed by a dollar sign `$` and type annotated\nwith a *designator*:\n\n```ru"
},
{
"path": "src/macros/dry.md",
"chars": 2170,
"preview": "# DRY (Don't Repeat Yourself)\n\nMacros allow writing DRY code by factoring out the common parts of functions\nand/or test "
},
{
"path": "src/macros/dsl.md",
"chars": 1212,
"preview": "# Domain Specific Languages (DSLs)\n\nA DSL is a mini \"language\" embedded in a Rust macro. It is completely valid\nRust bec"
},
{
"path": "src/macros/overload.md",
"chars": 909,
"preview": "# Overload\n\nMacros can be overloaded to accept different combinations of arguments.\nIn that regard, `macro_rules!` can w"
},
{
"path": "src/macros/repeat.md",
"chars": 822,
"preview": "# Repeat\n\nMacros can use `+` in the argument list to indicate that an argument may\nrepeat at least once, or `*`, to indi"
},
{
"path": "src/macros/syntax.md",
"chars": 289,
"preview": "# Syntax\n\nIn following subsections, we will show how to define macros in Rust.\nThere are three basic ideas:\n\n- [Patterns"
},
{
"path": "src/macros/variadics.md",
"chars": 888,
"preview": "# Variadic Interfaces\n\nA _variadic_ interface takes an arbitrary number of arguments. For example,\n`println!` can take a"
},
{
"path": "src/macros.md",
"chars": 1515,
"preview": "# `macro_rules!`\n\nRust provides a powerful macro system that allows metaprogramming. As you've\nseen in previous chapters"
},
{
"path": "src/meta/doc.md",
"chars": 3544,
"preview": "# Documentation\n\nUse `cargo doc` to build documentation in `target/doc`, `cargo doc --open`\nwill automatically open it i"
},
{
"path": "src/meta/playground.md",
"chars": 1700,
"preview": "# Playground\n\nThe [Rust Playground](https://play.rust-lang.org/) is a way to experiment with\nRust code through a web int"
},
{
"path": "src/meta.md",
"chars": 415,
"preview": "# Meta\n\nSome topics aren't exactly relevant to how you program runs but provide you\ntooling or infrastructure support wh"
},
{
"path": "src/mod/split.md",
"chars": 1691,
"preview": "# File hierarchy\n\nModules can be mapped to a file/directory hierarchy. Let's break down the\n[visibility example][visibil"
},
{
"path": "src/mod/struct_visibility.md",
"chars": 1819,
"preview": "# Struct visibility\n\nStructs have an extra level of visibility with their fields. The visibility\ndefaults to private, an"
},
{
"path": "src/mod/super.md",
"chars": 1487,
"preview": "# `super` and `self`\n\nThe `super` and `self` keywords can be used in the path to remove ambiguity\nwhen accessing items a"
},
{
"path": "src/mod/use.md",
"chars": 1216,
"preview": "# The `use` declaration\n\nThe `use` declaration can be used to bind a full path to a new name, for easier\naccess. It is o"
},
{
"path": "src/mod/visibility.md",
"chars": 4342,
"preview": "# Visibility\n\nBy default, the items in a module have private visibility, but this can be\noverridden with the `pub` modif"
},
{
"path": "src/mod.md",
"chars": 280,
"preview": "# Modules\n\nRust provides a powerful module system that can be used to hierarchically split\ncode in logical units (module"
},
{
"path": "src/primitives/array.md",
"chars": 2761,
"preview": "# Arrays and Slices\n\nAn array is a collection of objects of the same type `T`, stored in contiguous\nmemory. Arrays are c"
},
{
"path": "src/primitives/literals.md",
"chars": 2068,
"preview": "# Literals and operators\n\nIntegers `1`, floats `1.2`, characters `'a'`, strings `\"abc\"`, booleans `true`\nand the unit ty"
},
{
"path": "src/primitives/tuples.md",
"chars": 3009,
"preview": "# Tuples\n\nA tuple is a collection of values of different types. Tuples are constructed\nusing parentheses `()`, and each "
},
{
"path": "src/primitives.md",
"chars": 2237,
"preview": "# Primitives\n\nRust provides access to a wide variety of `primitives`. A sample includes:\n\n### Scalar Types\n\n* Signed int"
},
{
"path": "src/scope/borrow/alias.md",
"chars": 2146,
"preview": "# Aliasing\n\nData can be immutably borrowed any number of times, but while immutably\nborrowed, the original data can't be"
},
{
"path": "src/scope/borrow/mut.md",
"chars": 1665,
"preview": "# Mutability\n\nMutable data can be mutably borrowed using `&mut T`. This is called\na *mutable reference* and gives read/w"
},
{
"path": "src/scope/borrow/ref.md",
"chars": 1639,
"preview": "# The ref pattern\n\nWhen doing pattern matching or destructuring via the `let` binding, the `ref`\nkeyword can be used to "
},
{
"path": "src/scope/borrow.md",
"chars": 1750,
"preview": "# Borrowing\n\nMost of the time, we'd like to access data without taking ownership over\nit. To accomplish this, Rust uses "
},
{
"path": "src/scope/lifetime/elision.md",
"chars": 1257,
"preview": "# Elision\n\nSome lifetime patterns are overwhelmingly common and so the borrow checker\nwill allow you to omit them to sav"
},
{
"path": "src/scope/lifetime/explicit.md",
"chars": 2564,
"preview": "# Explicit annotation\n\nThe borrow checker uses explicit lifetime annotations to determine\nhow long references should be "
},
{
"path": "src/scope/lifetime/fn.md",
"chars": 1803,
"preview": "# Functions\n\nIgnoring [elision], function signatures with lifetimes have a few constraints:\n\n* any reference *must* have"
},
{
"path": "src/scope/lifetime/lifetime_bounds.md",
"chars": 1530,
"preview": "# Bounds\n\nJust like generic types can be bounded, lifetimes (themselves generic)\nuse bounds as well. The `:` character h"
},
{
"path": "src/scope/lifetime/lifetime_coercion.md",
"chars": 948,
"preview": "# Coercion\n\nA longer lifetime can be coerced into a shorter one\nso that it works inside a scope it normally wouldn't wor"
},
{
"path": "src/scope/lifetime/methods.md",
"chars": 440,
"preview": "# Methods\n\nMethods are annotated similarly to functions:\n\n```rust,editable\nstruct Owner(i32);\n\nimpl Owner {\n // Annot"
},
{
"path": "src/scope/lifetime/static_lifetime.md",
"chars": 3852,
"preview": "# Static\n\nRust has a few reserved lifetime names. One of those is `'static`. You\nmight encounter it in two situations:\n\n"
},
{
"path": "src/scope/lifetime/struct.md",
"chars": 1016,
"preview": "# Structs\n\nAnnotation of lifetimes in structures are also similar to functions:\n\n```rust,editable\n// A type `Borrowed` w"
},
{
"path": "src/scope/lifetime/trait.md",
"chars": 557,
"preview": "# Traits\n\nAnnotation of lifetimes in trait methods basically are similar to functions.\nNote that `impl` may have annotat"
},
{
"path": "src/scope/lifetime.md",
"chars": 2179,
"preview": "# Lifetimes\n\nA *lifetime* is a construct the compiler (or more specifically, its *borrow\nchecker*) uses to ensure all bo"
},
{
"path": "src/scope/move/mut.md",
"chars": 545,
"preview": "# Mutability\n\nMutability of data can be changed when ownership is transferred.\n\n```rust,editable\nfn main() {\n let imm"
},
{
"path": "src/scope/move/partial_move.md",
"chars": 2070,
"preview": "# Partial moves\n\nWithin the [destructuring] of a single variable, both `by-move` and\n`by-reference` pattern bindings can"
},
{
"path": "src/scope/move.md",
"chars": 1926,
"preview": "# Ownership and moves\n\nBecause variables are in charge of freeing their own resources,\n**resources can only have one own"
},
{
"path": "src/scope/raii.md",
"chars": 2879,
"preview": "# RAII\n\nVariables in Rust do more than just hold data in the stack: they also *own*\nresources, e.g. `Box<T>` owns memory"
},
{
"path": "src/scope.md",
"chars": 224,
"preview": "# Scoping rules\n\nScopes play an important part in ownership, borrowing, and lifetimes.\nThat is, they indicate to the com"
},
{
"path": "src/std/arc.md",
"chars": 1113,
"preview": "# Arc\n\nWhen shared ownership between threads is needed, `Arc`(Atomically Reference\nCounted) can be used. This struct, vi"
},
{
"path": "src/std/box.md",
"chars": 2342,
"preview": "# Box, stack and heap\n\nAll values in Rust are stack allocated by default. Values can be *boxed*\n(allocated on the heap) "
},
{
"path": "src/std/hash/alt_key_types.md",
"chars": 2564,
"preview": "# Alternate/custom key types\n\nAny type that implements the `Eq` and `Hash` traits can be a key in `HashMap`.\nThis includ"
},
{
"path": "src/std/hash/hashset.md",
"chars": 2644,
"preview": "# HashSet\n\nConsider a `HashSet` as a `HashMap` where we just care about the keys (\n`HashSet<T>` is, in actuality, just a"
},
{
"path": "src/std/hash.md",
"chars": 2129,
"preview": "# HashMap\n\nWhere vectors store values by an integer index, `HashMap`s store values by key.\n`HashMap` keys can be boolean"
},
{
"path": "src/std/option.md",
"chars": 1569,
"preview": "# `Option`\n\nSometimes it's desirable to catch the failure of some parts of a program\ninstead of calling `panic!`; this c"
},
{
"path": "src/std/panic.md",
"chars": 1807,
"preview": "# `panic!`\n\nThe `panic!` macro can be used to generate a panic and start unwinding\nits stack. While unwinding, the runti"
},
{
"path": "src/std/rc.md",
"chars": 2068,
"preview": "# `Rc`\n\nWhen multiple ownership is needed, `Rc`(Reference Counting) can be used. `Rc`\nkeeps track of the number of the r"
},
{
"path": "src/std/result/question_mark.md",
"chars": 2073,
"preview": "# `?`\n\nChaining results using match can get pretty untidy; luckily, the `?` operator\ncan be used to make things pretty a"
},
{
"path": "src/std/result.md",
"chars": 2100,
"preview": "# `Result`\n\nWe've seen that the `Option` enum can be used as a return value from functions\nthat may fail, where `None` c"
},
{
"path": "src/std/str.md",
"chars": 5880,
"preview": "# Strings\n\nThe two most used string types in Rust are `String` and `&str`.\n\nA `String` is stored as a vector of bytes (`"
},
{
"path": "src/std/vec.md",
"chars": 2264,
"preview": "# Vectors\n\nVectors are re-sizable arrays. Like slices, their size is not known at compile\ntime, but they can grow or shr"
},
{
"path": "src/std.md",
"chars": 448,
"preview": "# Std library types\n\nThe `std` library provides many custom types which expands drastically on\nthe `primitives`. Some of"
},
{
"path": "src/std_misc/arg/matching.md",
"chars": 2443,
"preview": "# Argument parsing\n\nMatching can be used to parse simple arguments:\n\n```rust,ignore\nuse std::env;\n\nfn increase(number: i"
},
{
"path": "src/std_misc/arg.md",
"chars": 986,
"preview": "# Program arguments\n\n## Standard Library\n\nThe command line arguments can be accessed using `std::env::args`, which\nretur"
},
{
"path": "src/std_misc/channels.md",
"chars": 1762,
"preview": "# Channels\n\nRust provides asynchronous `channels` for communication between threads. Channels\nallow a unidirectional flo"
},
{
"path": "src/std_misc/ffi.md",
"chars": 1714,
"preview": "# Foreign Function Interface\n\nRust provides a Foreign Function Interface (FFI) to C libraries. Foreign\nfunctions must be"
},
{
"path": "src/std_misc/file/create.md",
"chars": 2142,
"preview": "# `create`\n\nThe `create` function opens a file in write-only mode. If the file\nalready existed, the old content is destr"
},
{
"path": "src/std_misc/file/open.md",
"chars": 1257,
"preview": "# `open`\n\nThe `open` function can be used to open a file in read-only mode.\n\nA `File` owns a resource, the file descript"
},
{
"path": "src/std_misc/file/read_lines.md",
"chars": 2648,
"preview": "# `read_lines`\n\n## A naive approach\n\nThis might be a reasonable first attempt for a beginner's first\nimplementation for "
},
{
"path": "src/std_misc/file.md",
"chars": 489,
"preview": "# File I/O\n\nThe `File` struct represents a file that has been opened (it wraps a file\ndescriptor), and gives read and/or"
},
{
"path": "src/std_misc/fs.md",
"chars": 3761,
"preview": "# Filesystem Operations\n\nThe `std::fs` module contains several functions that deal with the filesystem.\n\n```rust,ignore\n"
},
{
"path": "src/std_misc/path.md",
"chars": 2001,
"preview": "# Path\n\nThe `Path` type represents file paths in the underlying filesystem. Across all\nplatforms there is a single `std:"
},
{
"path": "src/std_misc/process/pipe.md",
"chars": 1800,
"preview": "# Pipes\n\nThe `std::process::Child` struct represents a child process, and exposes the\n`stdin`, `stdout` and `stderr` han"
},
{
"path": "src/std_misc/process/wait.md",
"chars": 479,
"preview": "# Wait\n\nIf you'd like to wait for a `process::Child` to finish, you must call\n`Child::wait`, which will return a `proces"
},
{
"path": "src/std_misc/process.md",
"chars": 766,
"preview": "# Child processes\n\nThe `process::Output` struct represents the output of a finished child process,\nand the `process::Com"
},
{
"path": "src/std_misc/threads/testcase_mapreduce.md",
"chars": 6348,
"preview": "# Testcase: map-reduce\n\nRust makes it very easy to parallelize data processing, without many of the headaches traditiona"
},
{
"path": "src/std_misc/threads.md",
"chars": 696,
"preview": "# Threads\n\nRust provides a mechanism for spawning native OS threads via the `spawn`\nfunction, the argument of this funct"
},
{
"path": "src/std_misc.md",
"chars": 296,
"preview": "# Std misc\n\nMany other types are provided by the std library to support\nthings such as:\n\n* Threads\n* Channels\n* File I/O"
},
{
"path": "src/testing/dev_dependencies.md",
"chars": 1025,
"preview": "# Development dependencies\n\nSometimes there is a need to have dependencies for tests (or examples,\nor benchmarks) only. "
},
{
"path": "src/testing/doc_testing.md",
"chars": 3516,
"preview": "# Documentation testing\n\nThe primary way of documenting a Rust project is through annotating the source\ncode. Documentat"
},
{
"path": "src/testing/integration_testing.md",
"chars": 1919,
"preview": "# Integration testing\n\n[Unit tests][unit] are testing one module in isolation at a time: they're small\nand can test priv"
},
{
"path": "src/testing/unit_testing.md",
"chars": 6493,
"preview": "# Unit testing\n\nTests are Rust functions that verify that the non-test code is functioning in\nthe expected manner. The b"
},
{
"path": "src/testing.md",
"chars": 801,
"preview": "# Testing\n\nRust is a programming language that cares a lot about correctness and it\nincludes support for writing softwar"
},
{
"path": "src/trait/clone.md",
"chars": 2714,
"preview": "# Clone and Copy\n\nWhen dealing with resources, the default behavior is to transfer them during\nassignments or function c"
},
{
"path": "src/trait/derive.md",
"chars": 2537,
"preview": "# Derive\n\nThe compiler is capable of providing basic implementations for some traits via\nthe `#[derive]` [attribute][att"
},
{
"path": "src/trait/disambiguating.md",
"chars": 1741,
"preview": "# Disambiguating overlapping traits\n\nA type can implement many different traits. What if two traits both require\nthe sam"
},
{
"path": "src/trait/drop.md",
"chars": 3062,
"preview": "# Drop\n\nThe [`Drop`][Drop] trait only has one method: `drop`, which is called automatically\nwhen an object goes out of s"
},
{
"path": "src/trait/dyn.md",
"chars": 1796,
"preview": "# Returning Traits with `dyn`\n\nThe Rust compiler needs to know how much space every function's return type requires. Thi"
},
{
"path": "src/trait/impl_trait.md",
"chars": 4442,
"preview": "# `impl Trait`\n\n`impl Trait` can be used in two locations:\n\n1. as an argument type\n2. as a return type\n\n## As an argumen"
},
{
"path": "src/trait/iter.md",
"chars": 2994,
"preview": "# Iterators\n\nThe [`Iterator`][iter] trait is used to implement iterators over collections\nsuch as arrays.\n\nThe trait req"
},
{
"path": "src/trait/ops.md",
"chars": 1780,
"preview": "# Operator Overloading\n\nIn Rust, many of the operators can be overloaded via traits. That is, some operators can\nbe used"
}
]
// ... and 17 more files (download for full content)
About this extraction
This page contains the full source code of the rust-lang/rust-by-example GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 217 files (2.5 MB), approximately 664.4k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.