- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
How to read text from a file | Rust Language
Read all bytes from a reader into a new String with std::io::read_to_string
The match expression handles Ok and Error conditions.
Further reading :
More about "Ok" and "Err" - they are made from Result :
🔗 https://doc.rust-lang.org/nightly/std/result/enum.Result.html
🔗 https://www.becomebetterprogrammer.com/rust-generic-error-types/
Functions return Result whenever errors are expected and recoverable. In the std crate, Result is most prominently used for I/O.
(Result T, E is a common data type that allows propagating Rust errors without necessarily crashing the Rust program unless the program panics).
View the code here : 🔗 https://gist.github.com/RGGH/0de3e6e91d416de9d17c67d6ed6bf608
For more on match expressions check out the Rust docs:
🔗 https://doc.rust-lang.org/reference/expressions/match-expr.html
View the Rust playlist : 🔗 https://youtube.com/playlist?list=PL38rDfx7QwKbB24PRKjwAGYuyXMwKMvQl
It would be amazing if you want to support my channel via Patreon:
Patreon := 🔗 https://www.patreon.com/join/3552586
#rustlang #rusttutorial #howtoreadtextfile
Видео How to read text from a file | Rust Language канала Learning Rust
The match expression handles Ok and Error conditions.
Further reading :
More about "Ok" and "Err" - they are made from Result :
🔗 https://doc.rust-lang.org/nightly/std/result/enum.Result.html
🔗 https://www.becomebetterprogrammer.com/rust-generic-error-types/
Functions return Result whenever errors are expected and recoverable. In the std crate, Result is most prominently used for I/O.
(Result T, E is a common data type that allows propagating Rust errors without necessarily crashing the Rust program unless the program panics).
View the code here : 🔗 https://gist.github.com/RGGH/0de3e6e91d416de9d17c67d6ed6bf608
For more on match expressions check out the Rust docs:
🔗 https://doc.rust-lang.org/reference/expressions/match-expr.html
View the Rust playlist : 🔗 https://youtube.com/playlist?list=PL38rDfx7QwKbB24PRKjwAGYuyXMwKMvQl
It would be amazing if you want to support my channel via Patreon:
Patreon := 🔗 https://www.patreon.com/join/3552586
#rustlang #rusttutorial #howtoreadtextfile
Видео How to read text from a file | Rust Language канала Learning Rust
Комментарии отсутствуют
Информация о видео
1 декабря 2022 г. 18:17:11
00:04:11
Другие видео канала




















