Mountain/Binary/Service/VineStart.rs
1//! # Vine Start Module
2//!
3//! Initializes and starts the Vine gRPC server.
4
5/// Starts the Vine gRPC server at the specified addresses.
6///
7/// # Arguments
8///
9/// * `ApplicationHandle` - The Tauri application handle
10/// * `PrimaryAddress` - The primary server address (e.g., "\\[::1\\]:50051")
11/// * `SecondaryAddress` - The secondary server address (e.g.,
12/// "\\[::1\\]:50052")
13///
14/// # Returns
15///
16/// A `Result` indicating success or failure.
17///
18/// # Vine Server Functionality
19///
20/// The Vine gRPC server provides:
21/// - Inter-service communication infrastructure
22/// - gRPC method handling for various services
23/// - Multi-port support for different service types
24///
25/// # Addresses
26///
27/// - Primary: `[::1]:50051` - Main service communication
28/// - Secondary: `[::1]:50052` - Auxiliary service communication
29///
30/// # Errors
31///
32/// Returns an error if Vine server initialization fails.
33pub async fn VineStart(
34 ApplicationHandle:tauri::AppHandle,
35 PrimaryAddress:String,
36 SecondaryAddress:String,
37) -> Result<(), String> {
38 match crate::Vine::Server::Initialize::Initialize(ApplicationHandle, PrimaryAddress, SecondaryAddress) {
39 Ok(()) => {
40 dev_log!("grpc", "[Vine] [Start] Vine gRPC server started successfully.");
41 Ok(())
42 },
43 Err(e) => {
44 dev_log!("grpc", "error: [Vine] [Start] Failed to start: {}", e);
45 Err(format!("Failed to start Vine gRPC server: {}", e))
46 },
47 }
48}
49use crate::dev_log;