I want make application visible in global menu after build (or installation with cargo in my case)
Can I create .desktop file in valid system location using Glib API? Or this feature should be implemented manually on first application launch, by creating .desktop file in local/share. Just not sure about cache reset etc
Sounds like you’re looking for more system integration than what can reasonably be achieved with Cargo alone. While technically possible, it sounds extremely inconvenient and error-prone to manually intervene with desktop files directly in your application code
Here’s a template that provides all you need by “wrapping” Cargo inside a build performed with Meson. It also adds Flatpak support, should you ever want to distribute your app that way. Meson+Cargo+Flatpak is how practically all GNOME Rust apps are built and distributed.