Можно свободно скачивать книгу.
Rust: новый подход к снаряду...
Модератор: Olej
- Olej
- Писатель
- Сообщения: 21338
- Зарегистрирован: 24 сен 2011, 14:22
- Откуда: Харьков
- Контактная информация:
Rust: новый подход к снаряду...
То что я как-то не обратил сразу внимания по описаниям... из этой книги:
Согласно теперешним представлениям определение функции
выглядит так:Примерный эквивалент в форме лямбда-функции имеет следующий вид:Код: Выделить всё
fn add(a: i32, Ь: i32) -> i32 { а + Ь
Лямбда-функции обозначаются парой вертикальных линий ( | ... | ), за которымиКод: Выделить всё
let add = | а, b | { а + Ь } ;
следуют фигурные скобки ( { ... } ). Пара вертикальных линий позволяет определять
аргументы. Лямбда-функции в Rust могут читать значения переменных из своей
области видимости. Это замыкания.
- Olej
- Писатель
- Сообщения: 21338
- Зарегистрирован: 24 сен 2011, 14:22
- Откуда: Харьков
- Контактная информация:
Rust: новый подход к снаряду...
Ещё новый интерес к коду Rust в связи с разбирательством вот в этой теме: Rust: сетевое программирование
Для чего обновляю сюда онлайн (и не только) информационные ресурсы в тему ... нужные от ненужных, "агнцов от козлищ"
Первоочерёдно то что мне понадобится:
The Rust Programming Language
Язык программирования Rust
The Rust Standard Library
Command line apps in Rust - потому как меня интересуют только CLI
Для чего обновляю сюда онлайн (и не только) информационные ресурсы в тему ... нужные от ненужных, "агнцов от козлищ"
Первоочерёдно то что мне понадобится:
The Rust Programming Language
Язык программирования Rust
The Rust Standard Library
Command line apps in Rust - потому как меня интересуют только CLI
- Olej
- Писатель
- Сообщения: 21338
- Зарегистрирован: 24 сен 2011, 14:22
- Откуда: Харьков
- Контактная информация:
Rust: новый подход к снаряду...
При сборке приложения peers_updater (https://github.com/ygguser/peers_updater.git) для подготовки списка пиров: Yggdrasil: публичные пиры ... вылезла такая вот ошибка ... после 10 минут работы :
Код: Выделить всё
olej@R420:~/2024/Yggdrasil/peers_updater$ time cargo build --release
Updating crates.io index
Downloaded clap_lex v0.6.0
Downloaded pkg-config v0.3.28
Downloaded anstyle v1.0.4
Downloaded untrusted v0.9.0
Downloaded once_cell v1.19.0
Downloaded getrandom v0.2.12
Downloaded bitflags v2.4.1
Downloaded spin v0.9.8
Downloaded byteorder v1.5.0
Downloaded quote v1.0.35
Downloaded sct v0.7.1
Downloaded nu-json v0.84.0
Downloaded clap v4.4.14
Downloaded log v0.4.20
Downloaded minreq v2.11.0
Downloaded unicode-ident v1.0.12
Downloaded num-traits v0.2.17
Downloaded proc-macro2 v1.0.76
Downloaded miniz_oxide v0.7.1
Downloaded zip v0.6.6
Downloaded openssl-sys v0.9.98
Downloaded flate2 v1.0.28
Downloaded memchr v2.7.1
Downloaded cc v1.0.83
Downloaded serde v1.0.195
Downloaded clap_builder v4.4.14
Downloaded rustls-webpki v0.101.7
Downloaded aho-corasick v1.1.2
Downloaded vcpkg v0.2.15
Downloaded syn v2.0.48
Downloaded webpki-roots v0.25.3
Downloaded openssl v0.10.62
Downloaded regex v1.10.2
Downloaded rustls v0.21.10
Downloaded regex-syntax v0.8.2
Downloaded regex-automata v0.4.3
Downloaded libc v0.2.152
Downloaded ring v0.17.7
Downloaded 38 crates (9.0 MB) in 27.34s (largest was `ring` at 4.1 MB)
error: package `clap_builder v4.4.14` cannot be built because it requires rustc 1.70.0 or newer, while the currently active rustc version is 1.69.0
Either upgrade to rustc 1.70.0 or newer, or use
cargo update -p clap_builder@4.4.14 --precise ver
where `ver` is the latest version of `clap_builder` supporting rustc 1.69.0
real 10m26,687s
user 2m46,972s
sys 0m17,656s
Either upgrade to rustc 1.70.0 or newer
Код: Выделить всё
olej@R420:~/2024/Yggdrasil/peers_updater$ which cargo
/home/olej/.cargo/bin/cargo
Код: Выделить всё
olej@R420:~/2024/Yggdrasil$ cargo --version
cargo 1.69.0 (6e9a83356 2023-04-12)
- Olej
- Писатель
- Сообщения: 21338
- Зарегистрирован: 24 сен 2011, 14:22
- Откуда: Харьков
- Контактная информация:
Rust: новый подход к снаряду...
Но у меня уже делалось обновление, в этой же теме:
Поэтому пока пойду тем же путём...
Код: Выделить всё
olej@R420:~/2024/Yggdrasil/peers_updater$ rustup update stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2023-12-28, rust version 1.75.0 (82e1608df 2023-12-21)
info: downloading component 'cargo'
7.5 MiB / 7.5 MiB (100 %) 3.8 MiB/s in 2s ETA: 0s
info: downloading component 'clippy'
info: downloading component 'rust-docs'
14.3 MiB / 14.3 MiB (100 %) 3.5 MiB/s in 4s ETA: 0s
info: downloading component 'rust-std'
23.6 MiB / 23.6 MiB (100 %) 3.7 MiB/s in 6s ETA: 0s
info: downloading component 'rustc'
61.4 MiB / 61.4 MiB (100 %) 3.7 MiB/s in 16s ETA: 0s
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-docs'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
14.3 MiB / 14.3 MiB (100 %) 6.3 MiB/s in 2s ETA: 0s
info: installing component 'rust-std'
23.6 MiB / 23.6 MiB (100 %) 9.0 MiB/s in 2s ETA: 0s
info: installing component 'rustc'
61.4 MiB / 61.4 MiB (100 %) 10.8 MiB/s in 6s ETA: 0s
info: installing component 'rustfmt'
stable-x86_64-unknown-linux-gnu updated - rustc 1.75.0 (82e1608df 2023-12-21) (from rustc 1.69.0 (84c898d65 2023-04-16))
info: checking for self-update
Код: Выделить всё
olej@R420:~/2024/Yggdrasil$ cargo --version
cargo 1.75.0 (1d8b05cdd 2023-11-20)
- Olej
- Писатель
- Сообщения: 21338
- Зарегистрирован: 24 сен 2011, 14:22
- Откуда: Харьков
- Контактная информация:
Rust: новый подход к снаряду...
А про полную "чистую" установку с нуля - было рассказано здесь: Rust - 5 лет назад ... почему я с трудом даже нашёл эту тему...
Вспоминаем :
Olej писал(а): ↑13 фев 2018, 18:03Поэтому для установки Rust (последней актуальной версии) в вашей системе предлагается (платформа определится автоматически) скопировать и запустить соответствующий скрипт.Код: Выделить всё
[olej@dell own.BOOKs]$ curl https://sh.rustup.rs -sSf | sh info: downloading installer Welcome to Rust! This will download and install the official compiler for the Rust programming language, and its package manager, Cargo. It will add the cargo, rustc, rustup and other commands to Cargo's bin directory, located at: /home/olej/.cargo/bin This path will then be added to your PATH environment variable by modifying the profile files located at: /home/olej/.profile /home/olej/.bash_profile You can uninstall at any time with rustup self uninstall and these changes will be reverted. Current installation options: default host triple: x86_64-unknown-linux-gnu default toolchain: stable modify PATH variable: yes 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' info: latest update on 2018-01-04, rust version 1.23.0 (766bd11c8 2018-01-01) info: downloading component 'rustc' 45.0 MiB / 45.0 MiB (100 %) 3.1 MiB/s ETA: 0 s info: downloading component 'rust-std' 61.2 MiB / 61.2 MiB (100 %) 3.2 MiB/s ETA: 0 s info: downloading component 'cargo' 4.0 MiB / 4.0 MiB (100 %) 3.1 MiB/s ETA: 0 s info: downloading component 'rust-docs' 4.5 MiB / 4.5 MiB (100 %) 3.3 MiB/s ETA: 0 s info: installing component 'rustc' info: installing component 'rust-std' info: installing component 'cargo' info: installing component 'rust-docs' info: default toolchain set to 'stable' stable installed - rustc 1.23.0 (766bd11c8 2018-01-01) Rust is installed now. Great! To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH environment variable. Next time you log in this will be done automatically. To configure your current shell run source $HOME/.cargo/env
... а вот ссылки там поплыли, сейчас это Standalone-installers - здесь можно взять для любых платфформ установочные бинарники и исходный код:
Код: Выделить всё
platform stable (1.75.0) beta nightly
...
x86_64-unknown-linux-gnu tar.gz tar.gz tar.gz
tar.gz.asc tar.gz.asc tar.gz.asc
...
Кто сейчас на конференции
Сейчас этот форум просматривают: нет зарегистрированных пользователей и 7 гостей