Skip to main content

NotificationFormat

Trait NotificationFormat 

Source
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§

Source

fn serialize( &self, task: &TaskNotification, ) -> Result<String, NotificationError>

Serialize a task notification

Source

fn deserialize(&self, data: &str) -> Result<TaskNotification, NotificationError>

Deserialize a task notification

Source

fn name(&self) -> &str

Format name (e.g., “xml”, “json”)

Implementors§