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
//! # Ferro Broadcast
//!
//! WebSocket broadcasting and real-time channels for the Ferro framework.
//!
//! Provides a Laravel Echo-inspired broadcasting system with support for:
//! - Public channels (anyone can subscribe)
//! - Private channels (require authorization)
//! - Presence channels (track online users)
//!
//! ## Example
//!
//! ```rust,ignore
//! use ferro_broadcast::{Broadcast, Broadcaster};
//! use std::sync::Arc;
//!
//! // Create a broadcaster
//! let broadcaster = Arc::new(Broadcaster::new());
//!
//! // Broadcast to a channel
//! Broadcast::new(broadcaster.clone())
//! .channel("orders.1")
//! .event("OrderUpdated")
//! .data(&order)
//! .send()
//! .await?;
//! ```
//!
//! ## Channel Types
//!
//! Channels are determined by their name prefix:
//! - `orders` - Public channel
//! - `private-orders.1` - Private channel (requires auth)
//! - `presence-chat.1` - Presence channel (tracks members)
//!
//! ## Authorization
//!
//! For private and presence channels, implement the `ChannelAuthorizer` trait:
//!
//! ```rust,ignore
//! use ferro_broadcast::{AuthData, ChannelAuthorizer};
//!
//! struct MyAuthorizer;
//!
//! #[async_trait::async_trait]
//! impl ChannelAuthorizer for MyAuthorizer {
//! async fn authorize(&self, data: &AuthData) -> bool {
//! // Check if user can access this channel
//! verify_access(&data.channel, &data.auth_token)
//! }
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use BroadcastConfig;
pub use Error;
pub use ;
/// Re-export async_trait for convenience.
pub use async_trait;