FERS 1.0.0
The Flexible Extensible Radar Simulator
Loading...
Searching...
No Matches
main.rs
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (c) 2025-present FERS Contributors (see AUTHORS.md).
3
4//! # Tauri Desktop Application Entry Point
5//!
6//! This is the minimal `main.rs` entry point for the FERS Tauri desktop application.
7//! Its sole responsibility is to delegate to the library's `run()` function, which
8//! handles all application initialization and event loop management.
9//!
10//! ## Architecture Rationale
11//!
12//! By keeping `main.rs` minimal and placing all application logic in `lib.rs`, we:
13//! * Enable the application code to be unit-tested (the `main` function itself cannot be tested).
14//! * Allow the same code to be used in different contexts (e.g., integration tests, benchmarks).
15//! * Follow Rust best practices for library-centric project structure.
16//!
17//! ## Platform-Specific Configuration
18//!
19//! The `#![cfg_attr]` attribute suppresses the console window on Windows release builds,
20//! ensuring a native desktop application experience without a terminal appearing behind
21//! the UI.
22
23// Prevents additional console window on Windows in release, DO NOT REMOVE!!
24#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
25
26/// Launches the FERS Tauri desktop application.
27///
28/// This function immediately delegates to `fers_ui_lib::run()`, which:
29/// 1. Initializes the FFI connection to `libfers` (the C++ simulation engine).
30/// 2. Sets up Tauri plugins for file dialogs, filesystem access, and shell operations.
31/// 3. Registers all Tauri commands that the frontend can invoke.
32/// 4. Starts the Tauri event loop, which handles UI rendering and IPC.
33///
34/// # Panics
35///
36/// This function will panic if:
37/// * The `libfers` C++ library cannot be linked or initialized.
38/// * The Tauri application fails to start due to configuration errors.
39///
40/// These panics are intentional, as the application cannot function without
41/// a valid simulation context or UI framework.
42///
43/// # Example
44///
45/// This is the standard entry point and should not typically be modified:
46///
47/// ```no_run
48/// fers_ui_lib::run();
49/// ```
50fn main() {
51 fers_ui_lib::run()
52}