pub trait InboundWebhook: Send + Sync {
// Required methods
fn provider(&self) -> &'static str;
fn parse_inbound(
&self,
headers: &Headers,
body: &[u8],
) -> Result<InboundMessage, SmsError>;
// Provided method
fn verify(&self, _headers: &Headers, _body: &[u8]) -> Result<(), SmsError> { ... }
}Expand description
Provider-agnostic interface for processing inbound SMS webhooks.
Each provider crate implements this trait on its client type, enabling the
unified InboundRegistry and WebhookProcessor to handle any provider
without compile-time knowledge of which ones are in use.
Required Methods§
Sourcefn provider(&self) -> &'static str
fn provider(&self) -> &'static str
A stable, lowercase identifier for this provider (e.g. "plivo",
"twilio", "aws-sns"). Used as the lookup key in
InboundRegistry.
Sourcefn parse_inbound(
&self,
headers: &Headers,
body: &[u8],
) -> Result<InboundMessage, SmsError>
fn parse_inbound( &self, headers: &Headers, body: &[u8], ) -> Result<InboundMessage, SmsError>
Parse the raw HTTP payload (headers + body) into a normalized
InboundMessage.