Use a crate from GitHub | Rust Language

Опубликовано: 01 Декабрь 2023
на канале: Learning Rust
306
5

How to write your own library and import it from GitHub, via Cargo.toml
🟩 Rust, main.rs is typically used for the entry point of standalone executables, containing the main function. lib.rs is for library code, providing reusable functionality. When building a binary, main.rs is used; for libraries, lib.rs holds the central module.

Directory structure
------------------------------

.
├── Cargo.lock
├── Cargo.toml o--- `` Edit this one, not the one in mkgrid!! ``
├── mkgrid
│   ├── Cargo.toml
│   └── src
│   └── lib.rs
├── src
│   └── main.rs
└── target
├── CACHEDIR.TAG
└── debug
├── build
├── deps
├── examples
├── incremental
├── ldem
└── ldem.d


This is me learning new Rust tips and trying them out, I hope this shows the mistakes and errors in a useful way such that you get a feel for how to edit, break, and fix your Cargo.toml file and also how to rename directories and troubleshoot...

I also show a couple of macros that you may not have used. 'tm' creates you a full test template.

GitHub code
---------------------
🟩 https://github.com/RGGH/Rust_YT

Linux Hosting - VPS server - Webdock
----------------------------------------------------------------
🟩 Webdock Linux Hosting : https://webdock.io/en?maff=wdaff--170

#rustlang #librs #cargo


На этой странице сайта вы можете посмотреть видео онлайн Use a crate from GitHub | Rust Language длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Learning Rust 01 Декабрь 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 306 раз и оно понравилось 5 зрителям. Приятного просмотра!