pub trait NotificationFormat: Send + Sync {
// Required methods
fn serialize(
&self,
task: &TaskNotification,
) -> Result<String, NotificationError>;
fn deserialize(
&self,
data: &str,
) -> Result<TaskNotification, NotificationError>;
fn name(&self) -> &str;
}Expand description
Notification format serializer trait
Allows customizing how task notifications are serialized for different communication protocols (XML for Claude Code compatibility, JSON for REST).
Required Methods§
Sourcefn serialize(
&self,
task: &TaskNotification,
) -> Result<String, NotificationError>
fn serialize( &self, task: &TaskNotification, ) -> Result<String, NotificationError>
Serialize a task notification
Sourcefn deserialize(&self, data: &str) -> Result<TaskNotification, NotificationError>
fn deserialize(&self, data: &str) -> Result<TaskNotification, NotificationError>
Deserialize a task notification