Skip to main content

ChannelCodec

Trait ChannelCodec 

Source
pub trait ChannelCodec: Send + Sync {
    // Required methods
    fn channel(&self) -> ChannelId;
    fn decode(
        &self,
        payload: &str,
    ) -> Result<Option<InboundMessage>, ChannelError>;
    fn encode(
        &self,
        message: &OutboundMessage,
    ) -> Result<OutboundRequest, ChannelError>;

    // Provided method
    fn challenge(&self, _payload: &str) -> Option<String> { ... }
}
Expand description

Stateless codec for one platform’s webhook payload and send shape.

Required Methods§

Provided Methods§

Source

fn challenge(&self, _payload: &str) -> Option<String>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§