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
Auf dieser Seite können Sie das Online-Video Use a crate from GitHub | Rust Language mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Learning Rust 01 Dezember 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 306 Mal angesehen und es wurde von 5 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!