Yes, I can run the binary by calling "cargo run" from the Terminal, and then the binary opens as well.
Sounds like it's working then.
So you are saying that when using Finder, it expects a real app.
Yes. A "real app" is just a bundle directory that wraps the executable and includes dynamic libraries and frameworks, helpers, resources, and various metadata files like an Info.plist.
Ok, so how do I convert my Rust binary into an Apple app?
No clue about anything Rust-related.
I can tell you that every "real app" includes a command-line executable. You can usually run that executable on the command-line like any other Unix command.
Sometimes this can be handy to easily see certain log messages or to force the app to run in a particular localized language.
The downside is that since you aren't running it from the Finder, there may be some unexpected behaviour. But sometimes you can even have apps that run normally in the Finder, but also have a special command-line only mode.
Now the mechanism of displaying a graphical user interface via a command-line app is deep, undocumented black magic. It works for most "real apps" built using normal Xcode templates. It also works for legacy architectures like XQuartz and maybe Tcl/tk stuff. If Rust is able to hook into standard Apple APIs and Frameworks, then it should be able to do that too.
A further question. Are all binaries that run on MacOS considered "apps"?
No. There are all kinds of exotic things that can be executed.
If so, that would imply that all binaries compiled with Xcode would be "apps".
It is true that Xcode was designed for app building and for building various other app-supporting artifacts. But Xcode is also just an IDE like any other. I build websites in Xcode using XML and XSLT. That being said, Xcode includes too much baggage for simple, educational command-line tools.
But since you are poking around with exotic command line things like Rust on a Mac, I should warn you. Modern, open-source projects can sometimes be based on extremely complicated build systems that make Xcode look simplistic by comparison. (Anything that anyone from Google or Meta has ever touched, for example). If you are trying to build any of that stuff on a Mac, you might find it easier to discard those build systems and port it all to Xcode. It sounds like a lot of work, but at the end of the month, you'll have something to show for it where you wouldn't trying to figure out something like Ninja etc.