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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! Production-oriented long-connection primitives for realtime Rust systems.
//!
//! `flare-core` provides the transport foundation used by Flare IM and other
//! realtime applications. It focuses on connection-oriented infrastructure:
//! WebSocket, QUIC, optional TCP, negotiation, heartbeat policy, reconnection,
//! message parsing, compression, encryption, and extensible middleware.
//!
//! The crate intentionally stays transport-centric and business-neutral.
//! Product semantics such as message sequence allocation, inbox sync, push
//! delivery, moderation, and tenant-specific policy should live in higher-level
//! services or extension crates.
//!
//! # Main Modules
//!
//! - [`common`] contains protocol frames, parsers, codecs, compression,
//! encryption, errors, feature discovery, and shared configuration types.
//! - [`transport`] contains transport events, framing helpers, and concrete
//! transport implementations.
//! - [`client`] contains client builders, connection orchestration, heartbeat
//! handling, reconnect support, and native or wasm WebSocket clients.
//! - `server` contains native server builders, connection management,
//! negotiation, event handling, and transport listeners.
//!
//! # Feature Flags
//!
//! - `client`: client builders and transport clients.
//! - `server`: native server builders and connection management.
//! - `websocket`: WebSocket transport.
//! - `quic`: native QUIC transport.
//! - `tcp`: optional length-prefixed TCP transport.
//! - `wasm`: wasm32 WebSocket client support.
//! - `compression-gzip`: Gzip compression support.
//! - `encryption-aes-gcm`: AES-256-GCM encryption support.
//! - `full`: default feature set plus TCP.
//!
//! # Runtime Model
//!
//! A typical connection goes through transport establishment, CONNECT
//! negotiation, parser alignment, NEGOTIATION_READY, heartbeat startup, message
//! exchange, and disconnect or reconnect cleanup. The public builders hide most
//! of this lifecycle while keeping failure semantics explicit through typed
//! errors and connection events.
//!
//! # Choosing An Entry Point
//!
//! - Start with `client::FlareClientBuilder` or `server::FlareServerBuilder`
//! for production integrations that need traits, middleware, and connection
//! lifecycle hooks.
//! - Use `client::ClientBuilder` or `server::ServerBuilder` for compact
//! examples and closure-based prototypes.
//! - Use [`transport`] directly only when building a custom runtime adapter or
//! transport-level integration.
//!
//! # Minimal Server Sketch
//!
//! ```no_run
//! use async_trait::async_trait;
//! use flare_core::common::error::Result;
//! use flare_core::common::protocol::{Frame, PayloadCommand};
//! use flare_core::server::events::handler::ServerEventHandler;
//! use flare_core::server::FlareServerBuilder;
//! use std::sync::Arc;
//!
//! struct Handler;
//!
//! #[async_trait]
//! impl ServerEventHandler for Handler {
//! async fn handle_message(
//! &self,
//! _command: &PayloadCommand,
//! _connection_id: &str,
//! ) -> Result<Option<Frame>> {
//! Ok(None)
//! }
//! }
//!
//! # #[cfg(all(feature = "server", not(target_arch = "wasm32")))]
//! # async fn run() -> Result<()> {
//! let server = FlareServerBuilder::new("0.0.0.0:8080", Arc::new(Handler)).build()?;
//! server.start().await?;
//! # Ok(())
//! # }
//! ```
//!
//! # Documentation
//!
//! See the repository README for installation, examples, performance baselines,
//! and release verification guidance:
//! <https://github.com/flare-im/flare-core>.
pub use HybridClient;
pub use HybridServer;
pub use ;
pub use ;
pub use ;
pub use *;