mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-31 23:00:01 +02:00
parent
b8a01241ad
commit
ef3124b394
319
po/es.po
319
po/es.po
@ -79,7 +79,7 @@ msgstr "Garantías en Tiempo de Compilación"
|
|||||||
|
|
||||||
#: src/SUMMARY.md:25 src/why-rust/runtime.md:1
|
#: src/SUMMARY.md:25 src/why-rust/runtime.md:1
|
||||||
msgid "Runtime Guarantees"
|
msgid "Runtime Guarantees"
|
||||||
msgstr "Garantías en _Runtime_"
|
msgstr "Garantías en Runtime (Tiempo de Ejecución)"
|
||||||
|
|
||||||
#: src/SUMMARY.md:26 src/why-rust/modern.md:1
|
#: src/SUMMARY.md:26 src/why-rust/modern.md:1
|
||||||
msgid "Modern Features"
|
msgid "Modern Features"
|
||||||
@ -927,7 +927,7 @@ msgstr "Future"
|
|||||||
|
|
||||||
#: src/SUMMARY.md:294 src/async/runtimes.md:1
|
#: src/SUMMARY.md:294 src/async/runtimes.md:1
|
||||||
msgid "Runtimes"
|
msgid "Runtimes"
|
||||||
msgstr "Tiempos de ejecución"
|
msgstr "Runtimes (Tiempos de Ejecución)"
|
||||||
|
|
||||||
#: src/SUMMARY.md:295 src/async/runtimes/tokio.md:1
|
#: src/SUMMARY.md:295 src/async/runtimes/tokio.md:1
|
||||||
msgid "Tokio"
|
msgid "Tokio"
|
||||||
@ -11466,18 +11466,22 @@ msgstr ""
|
|||||||
#: src/error-handling.md:3
|
#: src/error-handling.md:3
|
||||||
msgid "Error handling in Rust is done using explicit control flow:"
|
msgid "Error handling in Rust is done using explicit control flow:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La gestión de errores en Rust se realiza mediante un flujo de control "
|
||||||
|
"explícito:"
|
||||||
|
|
||||||
#: src/error-handling.md:5
|
#: src/error-handling.md:5
|
||||||
msgid "Functions that can have errors list this in their return type,"
|
msgid "Functions that can have errors list this in their return type,"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Las funciones que pueden tener errores lo indican en su tipo de resultado "
|
||||||
|
"devuelto."
|
||||||
|
|
||||||
#: src/error-handling.md:6
|
#: src/error-handling.md:6
|
||||||
msgid "There are no exceptions."
|
msgid "There are no exceptions."
|
||||||
msgstr ""
|
msgstr "No hay excepciones."
|
||||||
|
|
||||||
#: src/error-handling/panics.md:3
|
#: src/error-handling/panics.md:3
|
||||||
msgid "Rust will trigger a panic if a fatal error happens at runtime:"
|
msgid "Rust will trigger a panic if a fatal error happens at runtime:"
|
||||||
msgstr ""
|
msgstr "Rust activará un _panic_ si se produce un error grave en _runtime_:"
|
||||||
|
|
||||||
#: src/error-handling/panics.md:5
|
#: src/error-handling/panics.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11491,26 +11495,30 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/error-handling/panics.md:12
|
#: src/error-handling/panics.md:12
|
||||||
msgid "Panics are for unrecoverable and unexpected errors."
|
msgid "Panics are for unrecoverable and unexpected errors."
|
||||||
msgstr ""
|
msgstr "Los _panics_ se usan para errores irrecuperables e inesperados."
|
||||||
|
|
||||||
#: src/error-handling/panics.md:13
|
#: src/error-handling/panics.md:13
|
||||||
msgid "Panics are symptoms of bugs in the program."
|
msgid "Panics are symptoms of bugs in the program."
|
||||||
msgstr ""
|
msgstr "Los _panics_ son un síntoma de que hay fallos en el programa."
|
||||||
|
|
||||||
#: src/error-handling/panics.md:14
|
#: src/error-handling/panics.md:14
|
||||||
msgid ""
|
msgid ""
|
||||||
"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable."
|
"Use non-panicking APIs (such as `Vec::get`) if crashing is not acceptable."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Utiliza API que no activen _panics_ (como `Vec::get`) si no se admiten "
|
||||||
|
"fallos."
|
||||||
|
|
||||||
#: src/error-handling/panic-unwind.md:1
|
#: src/error-handling/panic-unwind.md:1
|
||||||
msgid "Catching the Stack Unwinding"
|
msgid "Catching the Stack Unwinding"
|
||||||
msgstr ""
|
msgstr "Capturar el Desenrrollado de la _Stack_"
|
||||||
|
|
||||||
#: src/error-handling/panic-unwind.md:3
|
#: src/error-handling/panic-unwind.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"By default, a panic will cause the stack to unwind. The unwinding can be "
|
"By default, a panic will cause the stack to unwind. The unwinding can be "
|
||||||
"caught:"
|
"caught:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De forma predeterminada, el _panic_ hará que la _stack_ se desenrolle. El "
|
||||||
|
"proceso de desenrrollado se puede detectar:"
|
||||||
|
|
||||||
#: src/error-handling/panic-unwind.md:5
|
#: src/error-handling/panic-unwind.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11536,20 +11544,24 @@ msgid ""
|
|||||||
"This can be useful in servers which should keep running even if a single "
|
"This can be useful in servers which should keep running even if a single "
|
||||||
"request crashes."
|
"request crashes."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Esto puede ser útil en los servidores que deben seguir ejecutándose aunque "
|
||||||
|
"una sola solicitud falle."
|
||||||
|
|
||||||
#: src/error-handling/panic-unwind.md:23
|
#: src/error-handling/panic-unwind.md:23
|
||||||
msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`."
|
msgid "This does not work if `panic = 'abort'` is set in your `Cargo.toml`."
|
||||||
msgstr ""
|
msgstr "No funciona si `panic = 'abort'` está definido en `Cargo.toml`."
|
||||||
|
|
||||||
#: src/error-handling/result.md:1
|
#: src/error-handling/result.md:1
|
||||||
msgid "Structured Error Handling with `Result`"
|
msgid "Structured Error Handling with `Result`"
|
||||||
msgstr ""
|
msgstr "Gestión Estructurada de Errores con `Result`"
|
||||||
|
|
||||||
#: src/error-handling/result.md:3
|
#: src/error-handling/result.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"We have already seen the `Result` enum. This is used pervasively when errors "
|
"We have already seen the `Result` enum. This is used pervasively when errors "
|
||||||
"are expected as part of normal operation:"
|
"are expected as part of normal operation:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Ya hemos visto la _enum_ `Result`. Se utiliza normalmente cuando se esperan "
|
||||||
|
"errores como parte del funcionamiento normal:"
|
||||||
|
|
||||||
#: src/error-handling/result.md:6
|
#: src/error-handling/result.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11580,6 +11592,11 @@ msgid ""
|
|||||||
"case where an error should never happen, `unwrap()` or `expect()` can be "
|
"case where an error should never happen, `unwrap()` or `expect()` can be "
|
||||||
"called, and this is a signal of the developer intent too."
|
"called, and this is a signal of the developer intent too."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Al igual que con `Option`, el valor correcto se encuentra dentro de "
|
||||||
|
"`Result`, lo que obliga al desarrollador a extraerlo de forma explícita. "
|
||||||
|
"Esto fomenta la comprobación de errores. En el caso de que nunca se produzca "
|
||||||
|
"un error, se puede llamar a `unwrap()` o a `expect()`, y esto también es una "
|
||||||
|
"señal de la intención del desarrollador."
|
||||||
|
|
||||||
#: src/error-handling/result.md:30
|
#: src/error-handling/result.md:30
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11587,16 +11604,21 @@ msgid ""
|
|||||||
"is worth mentioning. It contains a lot of convenience methods and functions "
|
"is worth mentioning. It contains a lot of convenience methods and functions "
|
||||||
"that help functional-style programming. "
|
"that help functional-style programming. "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La documentación sobre `Result` es una lectura recomendada. Aunque no se vea "
|
||||||
|
"durante este curso, merece la pena mencinarlo. Contiene muchos métodos y "
|
||||||
|
"funciones prácticos que ayudan a seguir una programación funcional. "
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:1
|
#: src/error-handling/try-operator.md:1
|
||||||
msgid "Propagating Errors with `?`"
|
msgid "Propagating Errors with `?`"
|
||||||
msgstr ""
|
msgstr "Propagar errores con `?`"
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:3
|
#: src/error-handling/try-operator.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"The try-operator `?` is used to return errors to the caller. It lets you "
|
"The try-operator `?` is used to return errors to the caller. It lets you "
|
||||||
"turn the common"
|
"turn the common"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El operador try `?` se utiliza para devolver errores al llamador. Te permite "
|
||||||
|
"convertir"
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:6
|
#: src/error-handling/try-operator.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11610,7 +11632,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/error-handling/try-operator.md:13
|
#: src/error-handling/try-operator.md:13
|
||||||
msgid "into the much simpler"
|
msgid "into the much simpler"
|
||||||
msgstr ""
|
msgstr "en algo mucho más sencillo:"
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:15
|
#: src/error-handling/try-operator.md:15
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11621,7 +11643,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/error-handling/try-operator.md:19
|
#: src/error-handling/try-operator.md:19
|
||||||
msgid "We can use this to simplify our error handling code:"
|
msgid "We can use this to simplify our error handling code:"
|
||||||
msgstr ""
|
msgstr "Podemos utilizarlo para simplificar el código de gestión de errores:"
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:21
|
#: src/error-handling/try-operator.md:21
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11654,7 +11676,7 @@ msgstr ""
|
|||||||
#: src/error-handling/try-operator.md:50
|
#: src/error-handling/try-operator.md:50
|
||||||
#: src/error-handling/converting-error-types-example.md:52
|
#: src/error-handling/converting-error-types-example.md:52
|
||||||
msgid "The `username` variable can be either `Ok(string)` or `Err(error)`."
|
msgid "The `username` variable can be either `Ok(string)` or `Err(error)`."
|
||||||
msgstr ""
|
msgstr "La variable `username` puede ser `Ok(string)` o `Err(error)`."
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:51
|
#: src/error-handling/try-operator.md:51
|
||||||
#: src/error-handling/converting-error-types-example.md:53
|
#: src/error-handling/converting-error-types-example.md:53
|
||||||
@ -11662,6 +11684,8 @@ msgid ""
|
|||||||
"Use the `fs::write` call to test out the different scenarios: no file, empty "
|
"Use the `fs::write` call to test out the different scenarios: no file, empty "
|
||||||
"file, file with username."
|
"file, file with username."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Utiliza la llamada a `fs::write` para probar las distintas situaciones: sin "
|
||||||
|
"archivo, archivo vacío o archivo con nombre de usuario."
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:52
|
#: src/error-handling/try-operator.md:52
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11673,6 +11697,14 @@ msgid ""
|
|||||||
"`From<Err>`. Reciprocally, a function returning an `Option<T>` can only "
|
"`From<Err>`. Reciprocally, a function returning an `Option<T>` can only "
|
||||||
"apply the `?` operator on a function returning an `Option<AnyT>`."
|
"apply the `?` operator on a function returning an `Option<AnyT>`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El tipo de resultado de la función tiene que ser compatible con las "
|
||||||
|
"funciones anidadas que llama. Por ejemplo, una función que devuelve un "
|
||||||
|
"`Result<T, Err>` solo puede aplicar el operador `?` a una función que "
|
||||||
|
"devuelve un `Result<AnyT, Err>`. No puede aplicar el operador `?` a una "
|
||||||
|
"función que devuelve un `Option<AnyT>` o `Result<T, OtherErr>` a menos que "
|
||||||
|
"`OtherErr` implemente `From<Err>`. Recíprocamente, una función que devuelve "
|
||||||
|
"un `Option<T>` solo puede aplicar el operador `?` a una función que devuelve "
|
||||||
|
"un `Option<AnyT>`."
|
||||||
|
|
||||||
#: src/error-handling/try-operator.md:57
|
#: src/error-handling/try-operator.md:57
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11680,12 +11712,16 @@ msgid ""
|
|||||||
"`Option` and `Result` methods such as `Option::ok_or`, `Result::ok`, "
|
"`Option` and `Result` methods such as `Option::ok_or`, `Result::ok`, "
|
||||||
"`Result::err`."
|
"`Result::err`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Puedes convertir tipos incompatibles entre sí con los distintos métodos de "
|
||||||
|
"`Option` y `Result` como `Option::ok_or`, `Result::ok`, `Result::err`."
|
||||||
|
|
||||||
#: src/error-handling/converting-error-types.md:3
|
#: src/error-handling/converting-error-types.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"The effective expansion of `?` is a little more complicated than previously "
|
"The effective expansion of `?` is a little more complicated than previously "
|
||||||
"indicated:"
|
"indicated:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La expansión efectiva de `?` es un poco más complicada de lo que se ha "
|
||||||
|
"indicado anteriormente:"
|
||||||
|
|
||||||
#: src/error-handling/converting-error-types.md:5
|
#: src/error-handling/converting-error-types.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11696,7 +11732,7 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/error-handling/converting-error-types.md:9
|
#: src/error-handling/converting-error-types.md:9
|
||||||
msgid "works the same as"
|
msgid "works the same as"
|
||||||
msgstr ""
|
msgstr "funciona igual que"
|
||||||
|
|
||||||
#: src/error-handling/converting-error-types.md:11
|
#: src/error-handling/converting-error-types.md:11
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11713,6 +11749,8 @@ msgid ""
|
|||||||
"The `From::from` call here means we attempt to convert the error type to the "
|
"The `From::from` call here means we attempt to convert the error type to the "
|
||||||
"type returned by the function:"
|
"type returned by the function:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Aquí la llamada a `From::from` significa que intentamos convertir el tipo de "
|
||||||
|
"error al tipo que devuelve la función:"
|
||||||
|
|
||||||
#: src/error-handling/converting-error-types-example.md:3
|
#: src/error-handling/converting-error-types-example.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11770,6 +11808,11 @@ msgid ""
|
|||||||
"`Error` crate for `core` is only available in [nightly](https://github.com/"
|
"`Error` crate for `core` is only available in [nightly](https://github.com/"
|
||||||
"rust-lang/rust/issues/103765), so not fully `no_std` compatible yet."
|
"rust-lang/rust/issues/103765), so not fully `no_std` compatible yet."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Se recomienda que todos los tipos de errores que no necesitan ser `no_std` "
|
||||||
|
"implementen `std::error::Error`, que requiere `Debug` y `Display`. El crate "
|
||||||
|
"`Error` para `core` solo está disponible en [nightly](https://github.com/"
|
||||||
|
"rust-lang/rust/issues/103765), por lo que aún no es totalmente compatible "
|
||||||
|
"con `no_std`."
|
||||||
|
|
||||||
#: src/error-handling/converting-error-types-example.md:57
|
#: src/error-handling/converting-error-types-example.md:57
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11777,12 +11820,19 @@ msgid ""
|
|||||||
"possible, to make life easier for tests and consumers of your library. In "
|
"possible, to make life easier for tests and consumers of your library. In "
|
||||||
"this case we can't easily do so, because `io::Error` doesn't implement them."
|
"this case we can't easily do so, because `io::Error` doesn't implement them."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Por lo general, es útil que también implementen `Clone` y `Eq`, siempre que "
|
||||||
|
"sea posible, para facilitar las cosas a las pruebas y a los consumidores de "
|
||||||
|
"tu biblioteca. En este caso, no podemos hacerlo de forma sencilla porque "
|
||||||
|
"`io::Error` no los implementa."
|
||||||
|
|
||||||
#: src/error-handling/deriving-error-enums.md:3
|
#: src/error-handling/deriving-error-enums.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"The [thiserror](https://docs.rs/thiserror/) crate is a popular way to create "
|
"The [thiserror](https://docs.rs/thiserror/) crate is a popular way to create "
|
||||||
"an error enum like we did on the previous page:"
|
"an error enum like we did on the previous page:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Uno de los métodos más populares para crear una _enum_ (enumeración) de "
|
||||||
|
"errores es el crate [thiserror](https://docs.rs/thiserror/), como hicimos en "
|
||||||
|
"la página anterior:"
|
||||||
|
|
||||||
#: src/error-handling/deriving-error-enums.md:6
|
#: src/error-handling/deriving-error-enums.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11824,10 +11874,15 @@ msgid ""
|
|||||||
"optionally `Display` (if the `#[error(...)]` attributes are provided) and "
|
"optionally `Display` (if the `#[error(...)]` attributes are provided) and "
|
||||||
"`From` (if the `#[from]` attribute is added). It also works for structs."
|
"`From` (if the `#[from]` attribute is added). It also works for structs."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La macro de derivación de `thiserror` implementa automáticamente `std::"
|
||||||
|
"error::Error` y, de forma opcional, `Display` (si se proporcionan los "
|
||||||
|
"atributos `#[error(...)]`) y `From` (si se añade el atributo `#[from]`). "
|
||||||
|
"También funciona con estructuras."
|
||||||
|
|
||||||
#: src/error-handling/deriving-error-enums.md:43
|
#: src/error-handling/deriving-error-enums.md:43
|
||||||
msgid "It doesn't affect your public API, which makes it good for libraries."
|
msgid "It doesn't affect your public API, which makes it good for libraries."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"No afecta a tu API pública, lo que la hace idónea para las bibliotecas."
|
||||||
|
|
||||||
#: src/error-handling/dynamic-errors.md:3
|
#: src/error-handling/dynamic-errors.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11835,6 +11890,9 @@ msgid ""
|
|||||||
"our own enum covering all the different possibilities. `std::error::Error` "
|
"our own enum covering all the different possibilities. `std::error::Error` "
|
||||||
"makes this easy."
|
"makes this easy."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"A veces, queremos permitir que se devuelva cualquier tipo de error sin "
|
||||||
|
"escribir nuestra propia _enum_ que cubra todas las posibilidades. `std::"
|
||||||
|
"error::Error` facilita este proceso."
|
||||||
|
|
||||||
#: src/error-handling/dynamic-errors.md:6
|
#: src/error-handling/dynamic-errors.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11875,6 +11933,11 @@ msgid ""
|
|||||||
"good option in a program where you just want to display the error message "
|
"good option in a program where you just want to display the error message "
|
||||||
"somewhere."
|
"somewhere."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Esto permite ahorrar código, pero no da la posibilidad de gestionar "
|
||||||
|
"eficazmente los distintos casos de error en el programa. Por lo general, no "
|
||||||
|
"es una buena idea utilizar `Box<dyn Error>` en la API pública de una "
|
||||||
|
"biblioteca, pero puede ser una buena opción en un programa en el que solo "
|
||||||
|
"quieras mostrar el mensaje de error en alguna parte."
|
||||||
|
|
||||||
#: src/error-handling/error-contexts.md:3
|
#: src/error-handling/error-contexts.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11882,6 +11945,9 @@ msgid ""
|
|||||||
"contextual information to your errors and allows you to have fewer custom "
|
"contextual information to your errors and allows you to have fewer custom "
|
||||||
"error types:"
|
"error types:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El crate [anyhow](https://docs.rs/anyhow/), que se utiliza con frecuencia, "
|
||||||
|
"puede ayudar a añadir información contextual a los errores y permite tener "
|
||||||
|
"menos tipos de errores personalizados:"
|
||||||
|
|
||||||
#: src/error-handling/error-contexts.md:7
|
#: src/error-handling/error-contexts.md:7
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11915,6 +11981,7 @@ msgstr ""
|
|||||||
#: src/error-handling/error-contexts.md:35
|
#: src/error-handling/error-contexts.md:35
|
||||||
msgid "`anyhow::Result<V>` is a type alias for `Result<V, anyhow::Error>`."
|
msgid "`anyhow::Result<V>` is a type alias for `Result<V, anyhow::Error>`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"`anyhow::Result<V>` es un alias de tipo para `Result<V, anyhow::Error>`."
|
||||||
|
|
||||||
#: src/error-handling/error-contexts.md:36
|
#: src/error-handling/error-contexts.md:36
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11922,11 +11989,16 @@ msgid ""
|
|||||||
"it's again generally not a good choice for the public API of a library, but "
|
"it's again generally not a good choice for the public API of a library, but "
|
||||||
"is widely used in applications."
|
"is widely used in applications."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"`anyhow::Error` es básicamente un envoltorio alrededor de `Box<dyn Error>`. "
|
||||||
|
"Como tal, no suele ser una buena elección para la API pública de una "
|
||||||
|
"biblioteca, pero se usa con frecuencia en aplicaciones."
|
||||||
|
|
||||||
#: src/error-handling/error-contexts.md:38
|
#: src/error-handling/error-contexts.md:38
|
||||||
msgid ""
|
msgid ""
|
||||||
"Actual error type inside of it can be extracted for examination if necessary."
|
"Actual error type inside of it can be extracted for examination if necessary."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El tipo de error real que contiene se puede extraer para analizarlo si es "
|
||||||
|
"necesario."
|
||||||
|
|
||||||
#: src/error-handling/error-contexts.md:39
|
#: src/error-handling/error-contexts.md:39
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11934,22 +12006,26 @@ msgid ""
|
|||||||
"developers, as it provides similar usage patterns and ergonomics to `(T, "
|
"developers, as it provides similar usage patterns and ergonomics to `(T, "
|
||||||
"error)` from Go."
|
"error)` from Go."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La funcionalidad proporcionada por `anyhow::Result<T>` puede resultar "
|
||||||
|
"familiar a los desarrolladores de Go, ya que ofrece patrones de uso y "
|
||||||
|
"ergonomía similares a `(T, error)` de Go."
|
||||||
|
|
||||||
#: src/testing.md:3
|
#: src/testing.md:3
|
||||||
msgid "Rust and Cargo come with a simple unit test framework:"
|
msgid "Rust and Cargo come with a simple unit test framework:"
|
||||||
msgstr ""
|
msgstr "Rust y Cargo incluyen un sencillo framework para pruebas unitarias:"
|
||||||
|
|
||||||
#: src/testing.md:5
|
#: src/testing.md:5
|
||||||
msgid "Unit tests are supported throughout your code."
|
msgid "Unit tests are supported throughout your code."
|
||||||
msgstr ""
|
msgstr "Las pruebas unitarias se admiten en todo el código."
|
||||||
|
|
||||||
#: src/testing.md:7
|
#: src/testing.md:7
|
||||||
msgid "Integration tests are supported via the `tests/` directory."
|
msgid "Integration tests are supported via the `tests/` directory."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Las pruebas de integración se admiten a través del directorio `tests/`."
|
||||||
|
|
||||||
#: src/testing/unit-tests.md:3
|
#: src/testing/unit-tests.md:3
|
||||||
msgid "Mark unit tests with `#[test]`:"
|
msgid "Mark unit tests with `#[test]`:"
|
||||||
msgstr ""
|
msgstr "Marca pruebas unitarias con `#[test]`:"
|
||||||
|
|
||||||
#: src/testing/unit-tests.md:5
|
#: src/testing/unit-tests.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -11980,13 +12056,15 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/testing/unit-tests.md:29
|
#: src/testing/unit-tests.md:29
|
||||||
msgid "Use `cargo test` to find and run the unit tests."
|
msgid "Use `cargo test` to find and run the unit tests."
|
||||||
msgstr ""
|
msgstr "Busca y ejecuta las pruebas unitarias con `cargo test`."
|
||||||
|
|
||||||
#: src/testing/test-modules.md:3
|
#: src/testing/test-modules.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"Unit tests are often put in a nested module (run tests on the [Playground]"
|
"Unit tests are often put in a nested module (run tests on the [Playground]"
|
||||||
"(https://play.rust-lang.org/)):"
|
"(https://play.rust-lang.org/)):"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Las pruebas unitarias se suelen incluir en un módulo anidado (ejecuta las "
|
||||||
|
"pruebas en el [_Playground_](https://play.rust-lang.org/)):"
|
||||||
|
|
||||||
#: src/testing/test-modules.md:6
|
#: src/testing/test-modules.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12013,15 +12091,16 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/testing/test-modules.md:26
|
#: src/testing/test-modules.md:26
|
||||||
msgid "This lets you unit test private helpers."
|
msgid "This lets you unit test private helpers."
|
||||||
msgstr ""
|
msgstr "Esto permite realizar pruebas unitarias de los ayudantes privados."
|
||||||
|
|
||||||
#: src/testing/test-modules.md:27
|
#: src/testing/test-modules.md:27
|
||||||
msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`."
|
msgid "The `#[cfg(test)]` attribute is only active when you run `cargo test`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El atributo `#[cfg(test)]` solo está activo cuando se ejecuta `cargo test`."
|
||||||
|
|
||||||
#: src/testing/doc-tests.md:3
|
#: src/testing/doc-tests.md:3
|
||||||
msgid "Rust has built-in support for documentation tests:"
|
msgid "Rust has built-in support for documentation tests:"
|
||||||
msgstr ""
|
msgstr "Rust cuenta con asistencia integrada para pruebas de documentación:"
|
||||||
|
|
||||||
#: src/testing/doc-tests.md:5
|
#: src/testing/doc-tests.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12042,24 +12121,30 @@ msgstr ""
|
|||||||
#: src/testing/doc-tests.md:18
|
#: src/testing/doc-tests.md:18
|
||||||
msgid "Code blocks in `///` comments are automatically seen as Rust code."
|
msgid "Code blocks in `///` comments are automatically seen as Rust code."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Los bloques de código en los comentarios `///` se ven automáticamente como "
|
||||||
|
"código de Rust."
|
||||||
|
|
||||||
#: src/testing/doc-tests.md:19
|
#: src/testing/doc-tests.md:19
|
||||||
msgid "The code will be compiled and executed as part of `cargo test`."
|
msgid "The code will be compiled and executed as part of `cargo test`."
|
||||||
msgstr ""
|
msgstr "El código se compilará y ejecutará como parte de `cargo test`."
|
||||||
|
|
||||||
#: src/testing/doc-tests.md:20
|
#: src/testing/doc-tests.md:20
|
||||||
msgid ""
|
msgid ""
|
||||||
"Test the above code on the [Rust Playground](https://play.rust-lang.org/?"
|
"Test the above code on the [Rust Playground](https://play.rust-lang.org/?"
|
||||||
"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)."
|
"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Prueba el código anterior en el [playground de Rust](https://play.rust-lang."
|
||||||
|
"org/?"
|
||||||
|
"version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0)."
|
||||||
|
|
||||||
#: src/testing/integration-tests.md:3
|
#: src/testing/integration-tests.md:3
|
||||||
msgid "If you want to test your library as a client, use an integration test."
|
msgid "If you want to test your library as a client, use an integration test."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Si quieres probar tu biblioteca como cliente, haz una prueba de integración."
|
||||||
|
|
||||||
#: src/testing/integration-tests.md:5
|
#: src/testing/integration-tests.md:5
|
||||||
msgid "Create a `.rs` file under `tests/`:"
|
msgid "Create a `.rs` file under `tests/`:"
|
||||||
msgstr ""
|
msgstr "Crea un archivo `.rs` en `tests/`:"
|
||||||
|
|
||||||
#: src/testing/integration-tests.md:7
|
#: src/testing/integration-tests.md:7
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12075,86 +12160,102 @@ msgstr ""
|
|||||||
|
|
||||||
#: src/testing/integration-tests.md:16
|
#: src/testing/integration-tests.md:16
|
||||||
msgid "These tests only have access to the public API of your crate."
|
msgid "These tests only have access to the public API of your crate."
|
||||||
msgstr ""
|
msgstr "Estas pruebas solo tienen acceso a la API pública de tu crate."
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:1
|
#: src/testing/useful-crates.md:1
|
||||||
msgid "Useful crates for writing tests"
|
msgid "Useful crates for writing tests"
|
||||||
msgstr ""
|
msgstr "Crates útiles para escribir pruebas"
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:3
|
#: src/testing/useful-crates.md:3
|
||||||
#, fuzzy
|
|
||||||
msgid "Rust comes with only basic support for writing tests."
|
msgid "Rust comes with only basic support for writing tests."
|
||||||
msgstr "\\*Rust es moderno con soporte completo para cosas como Unicode."
|
msgstr "Rust solo incluye asistencia básica para las pruebas de escritura."
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:5
|
#: src/testing/useful-crates.md:5
|
||||||
msgid "Here are some additional crates which we recommend for writing tests:"
|
msgid "Here are some additional crates which we recommend for writing tests:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"A continuación, se indican algunos crates adicionales que recomendamos para "
|
||||||
|
"escribir pruebas:"
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:7
|
#: src/testing/useful-crates.md:7
|
||||||
msgid ""
|
msgid ""
|
||||||
"[googletest](https://docs.rs/googletest): Comprehensive test assertion "
|
"[googletest](https://docs.rs/googletest): Comprehensive test assertion "
|
||||||
"library in the tradition of GoogleTest for C++."
|
"library in the tradition of GoogleTest for C++."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"[googletest](https://docs.rs/googletest): biblioteca completa de aserción de "
|
||||||
|
"pruebas en la tradición de GoogleTest para C++."
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:8
|
#: src/testing/useful-crates.md:8
|
||||||
msgid "[proptest](https://docs.rs/proptest): Property-based testing for Rust."
|
msgid "[proptest](https://docs.rs/proptest): Property-based testing for Rust."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"[proptest](https://docs.rs/proptest): pruebas basadas en propiedades para "
|
||||||
|
"Rust."
|
||||||
|
|
||||||
#: src/testing/useful-crates.md:9
|
#: src/testing/useful-crates.md:9
|
||||||
msgid ""
|
msgid ""
|
||||||
"[rstest](https://docs.rs/rstest): Support for fixtures and parameterised "
|
"[rstest](https://docs.rs/rstest): Support for fixtures and parameterised "
|
||||||
"tests."
|
"tests."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"[rstest](https://docs.rs/rstest): asistencia para _fixtures_ y pruebas "
|
||||||
|
"parametrizadas."
|
||||||
|
|
||||||
#: src/unsafe.md:3
|
#: src/unsafe.md:3
|
||||||
msgid "The Rust language has two parts:"
|
msgid "The Rust language has two parts:"
|
||||||
msgstr ""
|
msgstr "El lenguaje Rust tiene dos partes:"
|
||||||
|
|
||||||
#: src/unsafe.md:5
|
#: src/unsafe.md:5
|
||||||
msgid "**Safe Rust:** memory safe, no undefined behavior possible."
|
msgid "**Safe Rust:** memory safe, no undefined behavior possible."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"**_Safe_ Rust:** memoria segura, sin posibilidad de comportamiento "
|
||||||
|
"indefinido."
|
||||||
|
|
||||||
#: src/unsafe.md:6
|
#: src/unsafe.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
"**Unsafe Rust:** can trigger undefined behavior if preconditions are "
|
"**Unsafe Rust:** can trigger undefined behavior if preconditions are "
|
||||||
"violated."
|
"violated."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"**_Unsafe_ Rust:** puede activar un comportamiento no definido si se "
|
||||||
|
"infringen las condiciones previas."
|
||||||
|
|
||||||
#: src/unsafe.md:8
|
#: src/unsafe.md:8
|
||||||
msgid ""
|
msgid ""
|
||||||
"We will be seeing mostly safe Rust in this course, but it's important to "
|
"We will be seeing mostly safe Rust in this course, but it's important to "
|
||||||
"know what Unsafe Rust is."
|
"know what Unsafe Rust is."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"En este curso, casi todo lo que veremos es _Safe_ Rust, aunque es importante "
|
||||||
|
"saber qué es _Unsafe_ Rust."
|
||||||
|
|
||||||
#: src/unsafe.md:11
|
#: src/unsafe.md:11
|
||||||
msgid ""
|
msgid ""
|
||||||
"Unsafe code is usually small and isolated, and its correctness should be "
|
"Unsafe code is usually small and isolated, and its correctness should be "
|
||||||
"carefully documented. It is usually wrapped in a safe abstraction layer."
|
"carefully documented. It is usually wrapped in a safe abstraction layer."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Por lo general, el código inseguro es pequeño y está aislado, y su "
|
||||||
|
"corrección debe estar bien documentada. Suele estar envuelto en una capa de "
|
||||||
|
"abstracción segura."
|
||||||
|
|
||||||
#: src/unsafe.md:14
|
#: src/unsafe.md:14
|
||||||
msgid "Unsafe Rust gives you access to five new capabilities:"
|
msgid "Unsafe Rust gives you access to five new capabilities:"
|
||||||
msgstr ""
|
msgstr "Rust inseguro te permite acceder a cinco nuevas funciones:"
|
||||||
|
|
||||||
#: src/unsafe.md:16
|
#: src/unsafe.md:16
|
||||||
msgid "Dereference raw pointers."
|
msgid "Dereference raw pointers."
|
||||||
msgstr ""
|
msgstr "Desreferenciar punteros sin formato."
|
||||||
|
|
||||||
#: src/unsafe.md:17
|
#: src/unsafe.md:17
|
||||||
msgid "Access or modify mutable static variables."
|
msgid "Access or modify mutable static variables."
|
||||||
msgstr ""
|
msgstr "Acceder o modificar variables estáticas mutables."
|
||||||
|
|
||||||
#: src/unsafe.md:18
|
#: src/unsafe.md:18
|
||||||
msgid "Access `union` fields."
|
msgid "Access `union` fields."
|
||||||
msgstr ""
|
msgstr "Acceder a los campos `union`."
|
||||||
|
|
||||||
#: src/unsafe.md:19
|
#: src/unsafe.md:19
|
||||||
msgid "Call `unsafe` functions, including `extern` functions."
|
msgid "Call `unsafe` functions, including `extern` functions."
|
||||||
msgstr ""
|
msgstr "Llamar a funciones `unsafe`, incluidas las funciones `extern`."
|
||||||
|
|
||||||
#: src/unsafe.md:20
|
#: src/unsafe.md:20
|
||||||
msgid "Implement `unsafe` traits."
|
msgid "Implement `unsafe` traits."
|
||||||
msgstr ""
|
msgstr "Implementar traits `unsafe`."
|
||||||
|
|
||||||
#: src/unsafe.md:22
|
#: src/unsafe.md:22
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12162,6 +12263,10 @@ msgid ""
|
|||||||
"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-"
|
"[Chapter 19.1 in the Rust Book](https://doc.rust-lang.org/book/ch19-01-"
|
||||||
"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)."
|
"unsafe-rust.html) and the [Rustonomicon](https://doc.rust-lang.org/nomicon/)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"A continuación, hablaremos brevemente sobre las funciones que no son "
|
||||||
|
"seguras. Para obtener más información, consulta el [capítulo 19.1 del Libro "
|
||||||
|
"de Rust](https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html) y el "
|
||||||
|
"documento [Rustonomicon](https://doc.rust-lang.org/nomicon/)."
|
||||||
|
|
||||||
#: src/unsafe.md:28
|
#: src/unsafe.md:28
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12170,10 +12275,16 @@ msgid ""
|
|||||||
"by themselves. It means the compiler no longer enforces Rust's memory-safety "
|
"by themselves. It means the compiler no longer enforces Rust's memory-safety "
|
||||||
"rules."
|
"rules."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"_Unsafe_ Rust no significa que el código sea incorrecto. Significa que los "
|
||||||
|
"desarrolladores han desactivado las funciones de seguridad del compilador y "
|
||||||
|
"que tienen que escribir el código correcto por su cuenta. Significa que el "
|
||||||
|
"compilador ya no aplica las reglas de seguridad de memoria de Rust."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:3
|
#: src/unsafe/raw-pointers.md:3
|
||||||
msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:"
|
msgid "Creating pointers is safe, but dereferencing them requires `unsafe`:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La creación de punteros es un proceso seguro, pero para anular las "
|
||||||
|
"referencias, es necesario utilizar `unsafe`:"
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:5
|
#: src/unsafe/raw-pointers.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12205,44 +12316,58 @@ msgid ""
|
|||||||
"a comment for each `unsafe` block explaining how the code inside it "
|
"a comment for each `unsafe` block explaining how the code inside it "
|
||||||
"satisfies the safety requirements of the unsafe operations it is doing."
|
"satisfies the safety requirements of the unsafe operations it is doing."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Se recomienda (y es obligatorio en la guía de estilo Rust de Android) "
|
||||||
|
"escribir un comentario para cada bloque `unsafe` explicando cómo el código "
|
||||||
|
"que contiene cumple los requisitos de seguridad de las operaciones inseguras "
|
||||||
|
"que realiza."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:31
|
#: src/unsafe/raw-pointers.md:31
|
||||||
msgid ""
|
msgid ""
|
||||||
"In the case of pointer dereferences, this means that the pointers must be "
|
"In the case of pointer dereferences, this means that the pointers must be "
|
||||||
"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:"
|
"[_valid_](https://doc.rust-lang.org/std/ptr/index.html#safety), i.e.:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"En el caso de la desreferenciación de punteros, significa que los punteros "
|
||||||
|
"deben ser [_válidos_](https://doc.rust-lang.org/std/ptr/index.html#safety), "
|
||||||
|
"por ejemplo:"
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:34
|
#: src/unsafe/raw-pointers.md:34
|
||||||
msgid "The pointer must be non-null."
|
msgid "The pointer must be non-null."
|
||||||
msgstr ""
|
msgstr "El puntero no puede ser nulo."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:35
|
#: src/unsafe/raw-pointers.md:35
|
||||||
msgid ""
|
msgid ""
|
||||||
"The pointer must be _dereferenceable_ (within the bounds of a single "
|
"The pointer must be _dereferenceable_ (within the bounds of a single "
|
||||||
"allocated object)."
|
"allocated object)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El puntero debe ser _desreferenciable_ (dentro de los límites de un único "
|
||||||
|
"objeto asignado)."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:36
|
#: src/unsafe/raw-pointers.md:36
|
||||||
msgid "The object must not have been deallocated."
|
msgid "The object must not have been deallocated."
|
||||||
msgstr ""
|
msgstr "El objeto no debe haberse desasignado."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:37
|
#: src/unsafe/raw-pointers.md:37
|
||||||
msgid "There must not be concurrent accesses to the same location."
|
msgid "There must not be concurrent accesses to the same location."
|
||||||
msgstr ""
|
msgstr "No debe haber accesos simultáneos a la misma ubicación."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:38
|
#: src/unsafe/raw-pointers.md:38
|
||||||
msgid ""
|
msgid ""
|
||||||
"If the pointer was obtained by casting a reference, the underlying object "
|
"If the pointer was obtained by casting a reference, the underlying object "
|
||||||
"must be live and no reference may be used to access the memory."
|
"must be live and no reference may be used to access the memory."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Si el puntero se ha obtenido enviando una referencia, el objeto subyacente "
|
||||||
|
"debe estar activo y no puede utilizarse ninguna referencia para acceder a la "
|
||||||
|
"memoria."
|
||||||
|
|
||||||
#: src/unsafe/raw-pointers.md:41
|
#: src/unsafe/raw-pointers.md:41
|
||||||
msgid "In most cases the pointer must also be properly aligned."
|
msgid "In most cases the pointer must also be properly aligned."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"En la mayoría de los casos, el puntero también debe estar alineado "
|
||||||
|
"adecuadamente."
|
||||||
|
|
||||||
#: src/unsafe/mutable-static-variables.md:3
|
#: src/unsafe/mutable-static-variables.md:3
|
||||||
msgid "It is safe to read an immutable static variable:"
|
msgid "It is safe to read an immutable static variable:"
|
||||||
msgstr ""
|
msgstr "Es seguro leer una variable estática inmutable:"
|
||||||
|
|
||||||
#: src/unsafe/mutable-static-variables.md:5
|
#: src/unsafe/mutable-static-variables.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12260,6 +12385,8 @@ msgid ""
|
|||||||
"However, since data races can occur, it is unsafe to read and write mutable "
|
"However, since data races can occur, it is unsafe to read and write mutable "
|
||||||
"static variables:"
|
"static variables:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Sin embargo, dado que pueden producirse carreras de datos, no es seguro leer "
|
||||||
|
"y escribir variables estáticas mutables:"
|
||||||
|
|
||||||
#: src/unsafe/mutable-static-variables.md:16
|
#: src/unsafe/mutable-static-variables.md:16
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12284,10 +12411,15 @@ msgid ""
|
|||||||
"where it might make sense in low-level `no_std` code, such as implementing a "
|
"where it might make sense in low-level `no_std` code, such as implementing a "
|
||||||
"heap allocator or working with some C APIs."
|
"heap allocator or working with some C APIs."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"No suele ser buena idea usar una variable estática mutable, pero en algunos "
|
||||||
|
"casos puede encajar en código `no_std` de bajo nivel, como implementar una "
|
||||||
|
"asignación de _heap_ o trabajar con algunas APIs C."
|
||||||
|
|
||||||
#: src/unsafe/unions.md:3
|
#: src/unsafe/unions.md:3
|
||||||
msgid "Unions are like enums, but you need to track the active field yourself:"
|
msgid "Unions are like enums, but you need to track the active field yourself:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Las uniones son como _enums_ (enumeraciones), pero eres tú quien debe hacer "
|
||||||
|
"el seguimiento del campo activo:"
|
||||||
|
|
||||||
#: src/unsafe/unions.md:5
|
#: src/unsafe/unions.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12311,6 +12443,8 @@ msgid ""
|
|||||||
"Unions are very rarely needed in Rust as you can usually use an enum. They "
|
"Unions are very rarely needed in Rust as you can usually use an enum. They "
|
||||||
"are occasionally needed for interacting with C library APIs."
|
"are occasionally needed for interacting with C library APIs."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Las uniones raramente son necesarias en Rust, ya que se suele utilizar una "
|
||||||
|
"_enum_. A veces se necesitan para interactuar con APIs de biblioteca C."
|
||||||
|
|
||||||
#: src/unsafe/unions.md:24
|
#: src/unsafe/unions.md:24
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12319,12 +12453,19 @@ msgid ""
|
|||||||
"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/"
|
"transmute.html) or a safe wrapper such as the [`zerocopy`](https://crates.io/"
|
||||||
"crates/zerocopy) crate."
|
"crates/zerocopy) crate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Si solo quieres reinterpretar los bytes como otro tipo, probablemente te "
|
||||||
|
"interese [`std::mem::transmute`](https://doc.rust-lang.org/stable/std/mem/fn."
|
||||||
|
"transmute.html) o una envoltura segura, como el crate [`zerocopy`](https://"
|
||||||
|
"crates.io/crates/zerocopy)."
|
||||||
|
|
||||||
#: src/unsafe/calling-unsafe-functions.md:3
|
#: src/unsafe/calling-unsafe-functions.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"A function or method can be marked `unsafe` if it has extra preconditions "
|
"A function or method can be marked `unsafe` if it has extra preconditions "
|
||||||
"you must uphold to avoid undefined behaviour:"
|
"you must uphold to avoid undefined behaviour:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Una función o método se puede marcar como `unsafe` si tiene condiciones "
|
||||||
|
"previas adicionales que debes mantener para evitar un comportamiento "
|
||||||
|
"indefinido:"
|
||||||
|
|
||||||
#: src/unsafe/calling-unsafe-functions.md:6
|
#: src/unsafe/calling-unsafe-functions.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12361,6 +12502,8 @@ msgid ""
|
|||||||
"You can mark your own functions as `unsafe` if they require particular "
|
"You can mark your own functions as `unsafe` if they require particular "
|
||||||
"conditions to avoid undefined behaviour."
|
"conditions to avoid undefined behaviour."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Puedes marcar tus propias funciones como `unsafe` si requieren condiciones "
|
||||||
|
"concretas para evitar un comportamiento indefinido."
|
||||||
|
|
||||||
#: src/unsafe/writing-unsafe-functions.md:6
|
#: src/unsafe/writing-unsafe-functions.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12395,6 +12538,8 @@ msgid ""
|
|||||||
"We wouldn't actually use pointers for this because it can be done safely "
|
"We wouldn't actually use pointers for this because it can be done safely "
|
||||||
"with references."
|
"with references."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"En realidad, no usaríamos punteros para este caso porque se puede hacer de "
|
||||||
|
"forma segura con referencias."
|
||||||
|
|
||||||
#: src/unsafe/writing-unsafe-functions.md:35
|
#: src/unsafe/writing-unsafe-functions.md:35
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12402,16 +12547,21 @@ msgid ""
|
|||||||
"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. "
|
"`unsafe` block. We can prohibit this with `#[deny(unsafe_op_in_unsafe_fn)]`. "
|
||||||
"Try adding it and see what happens."
|
"Try adding it and see what happens."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Ten en cuenta que el código inseguro se admite en una función insegura sin "
|
||||||
|
"un bloque `unsafe`. Podemos prohibirlo con "
|
||||||
|
"`#[deny(unsafe_op_in_unsafe_fn)]`. Prueba a añadirlo para ver qué ocurre."
|
||||||
|
|
||||||
#: src/unsafe/extern-functions.md:1
|
#: src/unsafe/extern-functions.md:1
|
||||||
msgid "Calling External Code"
|
msgid "Calling External Code"
|
||||||
msgstr ""
|
msgstr "Llamar a código externo"
|
||||||
|
|
||||||
#: src/unsafe/extern-functions.md:3
|
#: src/unsafe/extern-functions.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"Functions from other languages might violate the guarantees of Rust. Calling "
|
"Functions from other languages might violate the guarantees of Rust. Calling "
|
||||||
"them is thus unsafe:"
|
"them is thus unsafe:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Es posible que las funciones de otros lenguajes infrinjan las garantías de "
|
||||||
|
"Rust. Por lo tanto, no es seguro llamarlas:"
|
||||||
|
|
||||||
#: src/unsafe/extern-functions.md:6
|
#: src/unsafe/extern-functions.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12435,24 +12585,35 @@ msgid ""
|
|||||||
"pointers which might violate Rust's memory model, but in general any C "
|
"pointers which might violate Rust's memory model, but in general any C "
|
||||||
"function might have undefined behaviour under any arbitrary circumstances."
|
"function might have undefined behaviour under any arbitrary circumstances."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Esto solo suele suponer un problema para las funciones externas que hacen "
|
||||||
|
"cosas con punteros que pueden infringir el modelo de memoria de Rust pero, "
|
||||||
|
"en general, cualquier función C puede tener un comportamiento indefinido "
|
||||||
|
"bajo cualquier circunstancia arbitraria."
|
||||||
|
|
||||||
#: src/unsafe/extern-functions.md:25
|
#: src/unsafe/extern-functions.md:25
|
||||||
msgid ""
|
msgid ""
|
||||||
"The `\"C\"` in this example is the ABI; [other ABIs are available too]"
|
"The `\"C\"` in this example is the ABI; [other ABIs are available too]"
|
||||||
"(https://doc.rust-lang.org/reference/items/external-blocks.html)."
|
"(https://doc.rust-lang.org/reference/items/external-blocks.html)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"En este ejemplo, `\"C\"` es la ABI.; [también hay otras ABI disponibles]"
|
||||||
|
"(https://doc.rust-lang.org/reference/items/external-blocks.html)."
|
||||||
|
|
||||||
#: src/unsafe/unsafe-traits.md:3
|
#: src/unsafe/unsafe-traits.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
"Like with functions, you can mark a trait as `unsafe` if the implementation "
|
"Like with functions, you can mark a trait as `unsafe` if the implementation "
|
||||||
"must guarantee particular conditions to avoid undefined behaviour."
|
"must guarantee particular conditions to avoid undefined behaviour."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Al igual que con las funciones, puedes marcar un trait como `unsafe` si la "
|
||||||
|
"implementación debe asegurar condiciones concretas para evitar un "
|
||||||
|
"comportamiento indefinido."
|
||||||
|
|
||||||
#: src/unsafe/unsafe-traits.md:6
|
#: src/unsafe/unsafe-traits.md:6
|
||||||
msgid ""
|
msgid ""
|
||||||
"For example, the `zerocopy` crate has an unsafe trait that looks [something "
|
"For example, the `zerocopy` crate has an unsafe trait that looks [something "
|
||||||
"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):"
|
"like this](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Por ejemplo, el crate `zerocopy` tiene un trait inseguro, [que se parece a "
|
||||||
|
"esto](https://docs.rs/zerocopy/latest/zerocopy/trait.AsBytes.html):"
|
||||||
|
|
||||||
#: src/unsafe/unsafe-traits.md:9
|
#: src/unsafe/unsafe-traits.md:9
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12482,42 +12643,54 @@ msgid ""
|
|||||||
"There should be a `# Safety` section on the Rustdoc for the trait explaining "
|
"There should be a `# Safety` section on the Rustdoc for the trait explaining "
|
||||||
"the requirements for the trait to be safely implemented."
|
"the requirements for the trait to be safely implemented."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Debería haber una sección `# Safety` en el Rustdoc para el trait explicando "
|
||||||
|
"los requisitos para que el trait pueda implementarse de forma segura."
|
||||||
|
|
||||||
#: src/unsafe/unsafe-traits.md:33
|
#: src/unsafe/unsafe-traits.md:33
|
||||||
msgid ""
|
msgid ""
|
||||||
"The actual safety section for `AsBytes` is rather longer and more "
|
"The actual safety section for `AsBytes` is rather longer and more "
|
||||||
"complicated."
|
"complicated."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La sección de seguridad actual de `AsBytes` es bastante más larga y "
|
||||||
|
"complicada."
|
||||||
|
|
||||||
#: src/unsafe/unsafe-traits.md:35
|
#: src/unsafe/unsafe-traits.md:35
|
||||||
msgid "The built-in `Send` and `Sync` traits are unsafe."
|
msgid "The built-in `Send` and `Sync` traits are unsafe."
|
||||||
msgstr ""
|
msgstr "Los traits integrados `Send` y `Sync` no son seguros."
|
||||||
|
|
||||||
#: src/exercises/day-3/afternoon.md:1
|
#: src/exercises/day-3/afternoon.md:1
|
||||||
msgid "Day 3: Afternoon Exercises"
|
msgid "Day 3: Afternoon Exercises"
|
||||||
msgstr ""
|
msgstr "Día 3: ejercicios de la tarde"
|
||||||
|
|
||||||
#: src/exercises/day-3/afternoon.md:3
|
#: src/exercises/day-3/afternoon.md:3
|
||||||
msgid "Let us build a safe wrapper for reading directory content!"
|
msgid "Let us build a safe wrapper for reading directory content!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Vamos a crear un envoltorio seguro para leer el contenido del directorio."
|
||||||
|
|
||||||
#: src/exercises/day-3/afternoon.md:5
|
#: src/exercises/day-3/afternoon.md:5
|
||||||
msgid ""
|
msgid ""
|
||||||
"For this exercise, we suggest using a local dev environment instead of the "
|
"For this exercise, we suggest using a local dev environment instead of the "
|
||||||
"Playground. This will allow you to run your binary on your own machine."
|
"Playground. This will allow you to run your binary on your own machine."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Para este ejercicio, recomendamos utilizar un entorno de desarrollo local, "
|
||||||
|
"en lugar del playground. De este modo, podrás ejecutar tu binario en tu "
|
||||||
|
"propia máquina."
|
||||||
|
|
||||||
#: src/exercises/day-3/afternoon.md:8
|
#: src/exercises/day-3/afternoon.md:8
|
||||||
msgid ""
|
msgid ""
|
||||||
"To get started, follow the [running locally](../../cargo/running-locally.md) "
|
"To get started, follow the [running locally](../../cargo/running-locally.md) "
|
||||||
"instructions."
|
"instructions."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Para empezar, sigue las instrucciones para [ejecutar a nivel local](../../"
|
||||||
|
"cargo/running-locally.md)."
|
||||||
|
|
||||||
#: src/exercises/day-3/afternoon.md:14
|
#: src/exercises/day-3/afternoon.md:14
|
||||||
msgid ""
|
msgid ""
|
||||||
"After looking at the exercise, you can look at the [solution](solutions-"
|
"After looking at the exercise, you can look at the [solution](solutions-"
|
||||||
"afternoon.md) provided."
|
"afternoon.md) provided."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Después de realizar el ejercicio, puedes consultar la [solución](solutions-"
|
||||||
|
"afternoon.md) proporcionada."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:3
|
#: src/exercises/day-3/safe-ffi-wrapper.md:3
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12525,22 +12698,26 @@ msgid ""
|
|||||||
"interface_ (FFI). We will use this to build a safe wrapper for the `libc` "
|
"interface_ (FFI). We will use this to build a safe wrapper for the `libc` "
|
||||||
"functions you would use from C to read the filenames of a directory."
|
"functions you would use from C to read the filenames of a directory."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Rust ofrece una gran asisencia para llamar a funciones a través de una "
|
||||||
|
"_interfaz de función externa_ (FFI). Usaremos esto para crear un envoltorio "
|
||||||
|
"seguro para las funciones `libc` que usarías desde C para leer los nombres "
|
||||||
|
"de archivo de un directorio."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:7
|
#: src/exercises/day-3/safe-ffi-wrapper.md:7
|
||||||
msgid "You will want to consult the manual pages:"
|
msgid "You will want to consult the manual pages:"
|
||||||
msgstr ""
|
msgstr "Consulta las páginas del manual:"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:9
|
#: src/exercises/day-3/safe-ffi-wrapper.md:9
|
||||||
msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)"
|
msgid "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)"
|
||||||
msgstr ""
|
msgstr "[`opendir(3)`](https://man7.org/linux/man-pages/man3/opendir.3.html)"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:10
|
#: src/exercises/day-3/safe-ffi-wrapper.md:10
|
||||||
msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)"
|
msgid "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)"
|
||||||
msgstr ""
|
msgstr "[`readdir(3)`](https://man7.org/linux/man-pages/man3/readdir.3.html)"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:11
|
#: src/exercises/day-3/safe-ffi-wrapper.md:11
|
||||||
msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)"
|
msgid "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)"
|
||||||
msgstr ""
|
msgstr "[`closedir(3)`](https://man7.org/linux/man-pages/man3/closedir.3.html)"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:13
|
#: src/exercises/day-3/safe-ffi-wrapper.md:13
|
||||||
msgid ""
|
msgid ""
|
||||||
@ -12548,119 +12725,129 @@ msgid ""
|
|||||||
"ffi/) module. There you find a number of string types which you need for the "
|
"ffi/) module. There you find a number of string types which you need for the "
|
||||||
"exercise:"
|
"exercise:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"También te recomendamos que consultes el módulo [`std::ffi`](https://doc."
|
||||||
|
"rust-lang.org/std/ffi/). Ahí encontrarás una serie de tipos de cadena que "
|
||||||
|
"necesitas para el ejercicio:"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
||||||
msgid "Encoding"
|
msgid "Encoding"
|
||||||
msgstr ""
|
msgstr "Codificación"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
#: src/exercises/day-3/safe-ffi-wrapper.md:16
|
||||||
msgid "Use"
|
msgid "Use"
|
||||||
msgstr ""
|
msgstr "Uso"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]"
|
"[`str`](https://doc.rust-lang.org/std/primitive.str.html) and [`String`]"
|
||||||
"(https://doc.rust-lang.org/std/string/struct.String.html)"
|
"(https://doc.rust-lang.org/std/string/struct.String.html)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator."
|
"[`str`](https://doc.rust-lang.org/std/primitive.str.html) y [`String`]"
|
||||||
"html#method.collect) se basa en `FromIterator` que lo implementa el "
|
"(https://doc.rust-lang.org/std/string/struct.String.html)"
|
||||||
"[`HashSet`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html)."
|
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||||
msgid "UTF-8"
|
msgid "UTF-8"
|
||||||
msgstr ""
|
msgstr "UTF-8"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
#: src/exercises/day-3/safe-ffi-wrapper.md:18
|
||||||
#, fuzzy
|
|
||||||
msgid "Text processing in Rust"
|
msgid "Text processing in Rust"
|
||||||
msgstr "Mover Strings en Rust"
|
msgstr "Procesar textos en Rust"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]"
|
"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) and [`CString`]"
|
||||||
"(https://doc.rust-lang.org/std/ffi/struct.CString.html)"
|
"(https://doc.rust-lang.org/std/ffi/struct.CString.html)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator."
|
"[`CStr`](https://doc.rust-lang.org/std/ffi/struct.CStr.html) y [`CString`]"
|
||||||
"html#method.collect) se basa en `FromIterator` que lo implementa el "
|
"(https://doc.rust-lang.org/std/ffi/struct.CString.html)"
|
||||||
"[`HashSet`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html)."
|
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||||
msgid "NUL-terminated"
|
msgid "NUL-terminated"
|
||||||
msgstr ""
|
msgstr "Terminado en NUL"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
#: src/exercises/day-3/safe-ffi-wrapper.md:19
|
||||||
msgid "Communicating with C functions"
|
msgid "Communicating with C functions"
|
||||||
msgstr ""
|
msgstr "Comunicarse con funciones C"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
msgid ""
|
||||||
"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and "
|
"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) and "
|
||||||
"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)"
|
"[`OsString`](https://doc.rust-lang.org/std/ffi/struct.OsString.html)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"[`collect`](https://doc.rust-lang.org/stable/std/iter/trait.Iterator."
|
"[`OsStr`](https://doc.rust-lang.org/std/ffi/struct.OsStr.html) y [`OsString`]"
|
||||||
"html#method.collect) se basa en `FromIterator` que lo implementa el "
|
"(https://doc.rust-lang.org/std/ffi/struct.OsString.html)"
|
||||||
"[`HashSet`](https://doc.rust-lang.org/std/iter/trait.FromIterator.html)."
|
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||||
msgid "OS-specific"
|
msgid "OS-specific"
|
||||||
msgstr ""
|
msgstr "Específico del SO"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
#: src/exercises/day-3/safe-ffi-wrapper.md:20
|
||||||
msgid "Communicating with the OS"
|
msgid "Communicating with the OS"
|
||||||
msgstr ""
|
msgstr "Comunicarse con el SO"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:22
|
#: src/exercises/day-3/safe-ffi-wrapper.md:22
|
||||||
msgid "You will convert between all these types:"
|
msgid "You will convert between all these types:"
|
||||||
msgstr ""
|
msgstr "Realizarás conversiones entre todos estos tipos:"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:24
|
#: src/exercises/day-3/safe-ffi-wrapper.md:24
|
||||||
msgid ""
|
msgid ""
|
||||||
"`&str` to `CString`: you need to allocate space for a trailing `\\0` "
|
"`&str` to `CString`: you need to allocate space for a trailing `\\0` "
|
||||||
"character,"
|
"character,"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `&str` a `CString`: debes asignar espacio para un carácter final `\\0`,"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:25
|
#: src/exercises/day-3/safe-ffi-wrapper.md:25
|
||||||
msgid "`CString` to `*const i8`: you need a pointer to call C functions,"
|
msgid "`CString` to `*const i8`: you need a pointer to call C functions,"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `CString` a `*const i8`: necesitas un puntero para llamar a funciones C,"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:26
|
#: src/exercises/day-3/safe-ffi-wrapper.md:26
|
||||||
msgid ""
|
msgid ""
|
||||||
"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` "
|
"`*const i8` to `&CStr`: you need something which can find the trailing `\\0` "
|
||||||
"character,"
|
"character,"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `*const i8` a `&CStr`: necesitas algo que pueda encontrar el carácter "
|
||||||
|
"final `\\0`,"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:27
|
#: src/exercises/day-3/safe-ffi-wrapper.md:27
|
||||||
msgid ""
|
msgid ""
|
||||||
"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some "
|
"`&CStr` to `&[u8]`: a slice of bytes is the universal interface for \"some "
|
||||||
"unknow data\","
|
"unknow data\","
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `&CStr` a `&[u8]`: un slice de bytes es la interfaz universal para "
|
||||||
|
"\"algunos datos desconocidos\"."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:28
|
#: src/exercises/day-3/safe-ffi-wrapper.md:28
|
||||||
msgid ""
|
msgid ""
|
||||||
"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]"
|
"`&[u8]` to `&OsStr`: `&OsStr` is a step towards `OsString`, use [`OsStrExt`]"
|
||||||
"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it,"
|
"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) to create it,"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `&[u8]` a `&OsStr`: `&OsStr` es un paso hacia `OsString`, usa [`OsStrExt`]"
|
||||||
|
"(https://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html) para crearlo."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:31
|
#: src/exercises/day-3/safe-ffi-wrapper.md:31
|
||||||
msgid ""
|
msgid ""
|
||||||
"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to "
|
"`&OsStr` to `OsString`: you need to clone the data in `&OsStr` to be able to "
|
||||||
"return it and call `readdir` again."
|
"return it and call `readdir` again."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"De `OsStr` a `OsString`: debes clonar los datos en `&OsStr` para poder "
|
||||||
|
"devolverlo y llamar a `readdir` de nuevo."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:34
|
#: src/exercises/day-3/safe-ffi-wrapper.md:34
|
||||||
msgid ""
|
msgid ""
|
||||||
"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very "
|
"The [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) also has a very "
|
||||||
"useful chapter about FFI."
|
"useful chapter about FFI."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"El [Nomicon](https://doc.rust-lang.org/nomicon/ffi.html) también tiene un "
|
||||||
|
"capítulo muy útil sobre FFI."
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:45
|
#: src/exercises/day-3/safe-ffi-wrapper.md:45
|
||||||
msgid ""
|
msgid ""
|
||||||
"Copy the code below to <https://play.rust-lang.org/> and fill in the missing "
|
"Copy the code below to <https://play.rust-lang.org/> and fill in the missing "
|
||||||
"functions and methods:"
|
"functions and methods:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Copia el fragmento de código que aparece más abajo en la página <https://"
|
||||||
|
"play.rust-lang.org/> y rellena los métodos y funciones que faltan:"
|
||||||
|
|
||||||
#: src/exercises/day-3/safe-ffi-wrapper.md:48
|
#: src/exercises/day-3/safe-ffi-wrapper.md:48
|
||||||
msgid ""
|
msgid ""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user