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
En esta página del sitio puede ver el video en línea Use a crate from GitHub | Rust Language de Duración hora minuto segunda en buena calidad , que subió el usuario Learning Rust 01 diciembre 2023, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 306 veces y le gustó 5 a los espectadores. Disfruta viendo!