i'm new here and Rust is for me total new. I want to understand an programming with Rust.
Yeah and my first border is the project structure self.
That works for so far.
This tutorial gives wrong advice. You should never have mod lib in a Cargo project. It duplicates code and reuses lib.rs in a way that is not expected by Cargo.
When you have both src/main.rs and src/lib.rs, Cargo will use lib.rs to build a Rust library, and then statically link that library into the binary built from src/main.rs. The binary will not depend on a DLL. Even if you build DLL at the same time, it will not be used by the binary from the same crate.
Are you sure you want to use a DLL here? It takes much more effort, as you can't use Rust functions on the DLL boundary. You will need to build a stable C API for it. It's a lot of work, and Cargo doesn't support automatically linking with such DLL. That will need making three crates (cdylib crate, sys crate, and the binary crate), a manual build step, and a build script.
Thank for your response and the helpful link about sys crate.
Dont bully me when i say i have Windows as Operationsystem and want to programming with Rust.
For me is a testing thing to understand how Rust is working now. I know C# and i have spent lot of time in this language.
You have in C# the possibility to create many Projects in one solution and when the project is a library then they will compile as DLL and all other Projects as executable file.
The only one what i need to understand, how can i work with libraries and what is the best practices.