flare_core/client/events/
handler.rs1use crate::common::error::Result;
6use crate::common::protocol::Frame;
7use crate::common::protocol::flare::core::commands::notification_command::Type as NotifType;
8use crate::common::protocol::flare::core::commands::payload_command::Type as PayloadType;
9use crate::common::protocol::flare::core::commands::system_command::Type as SysType;
10use crate::transport::events::ConnectionEvent;
11
12#[async_trait::async_trait]
18pub trait ClientEventHandler: Send + Sync {
19 async fn handle_system_command(
30 &self,
31 command_type: SysType,
32 frame: &Frame,
33 ) -> Result<Option<Frame>> {
34 let _ = (command_type, frame);
35 Ok(None)
36 }
37
38 async fn handle_message_command(
40 &self,
41 command_type: PayloadType,
42 frame: &Frame,
43 ) -> Result<Option<Frame>> {
44 let _ = (command_type, frame);
45 Ok(None)
46 }
47
48 async fn handle_notification_command(
59 &self,
60 command_type: NotifType,
61 frame: &Frame,
62 ) -> Result<Option<Frame>> {
63 let _ = (command_type, frame);
64 Ok(None)
65 }
66
67 async fn handle_connection_event(&self, event: &ConnectionEvent) -> Result<()> {
76 let _ = event;
77 Ok(())
78 }
79}