1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! # Tauri Plugin Centrifugo
//!
//! A Tauri plugin for real-time communication with Centrifugo server, built on the official
//! [`centrifuge-client`](https://github.com/centrifugal/centrifuge-rust) SDK.
//!
//! ## Features
//!
//! - **Real-time Communication**: WebSocket with HTTP-streaming fallback, proxies, OS TLS store
//! - **JSON & Protobuf Support**: Choose between JSON and Protobuf protocols
//! - **Event-driven Architecture**: Comprehensive event system for connection state and messages
//! - **Channel Management**: Subscribe/unsubscribe to channels dynamically
//! - **Authentication**: JWT token support for secure connections
//! - **Cross-platform**: Works on desktop and mobile platforms
//!
//! ## Usage
//!
//! ```rust,no_run
//! use tauri_plugin_centrifugo::init;
//!
//! // fn main() {
//! // tauri::Builder::default()
//! // .plugin(init())
//! // .run(tauri::generate_context!())
//! // .expect("error while running tauri application");
//! // }
//! ```
//!
//! ## Architecture
//!
//! The plugin consists of several modules:
//! - `commands`: Tauri command handlers for frontend communication
//! - `core`: Core Centrifugo client logic and state management
//! - `models`: Data structures for requests, responses, and configuration
//! - `error`: Custom error types and error handling
//!
//! ## Dependencies
//!
//! - `centrifuge-client`: the official Centrifugo Rust SDK
//! - `serde`: Serialization/deserialization
//! - `thiserror`: Error handling utilities
//! - `futures-util`: Async stream utilities
//!
//! ## License
//!
//! MIT License
use ;
use ;
/// The official Centrifugo Rust SDK the plugin is built on.
pub use centrifuge;
pub use Result;
/// Initialize the Centrifugo plugin for Tauri
///
/// This function creates and configures the plugin with all necessary command handlers
/// and state management. It should be called during Tauri app initialization.
///
/// # Example
///
/// ```rust,no_run
/// use tauri_plugin_centrifugo::init;
///
/// // fn main() {
/// // tauri::Builder::default()
/// // .plugin(init())
/// // .run(tauri::generate_context!())
/// // .expect("error while running tauri application");
/// // }
/// ```
///
/// # Returns
///
/// A configured `TauriPlugin<R>` instance that can be added to your Tauri app.