Expand description
§SMS Core
Core traits and types for the smskit multi-provider SMS abstraction.
This crate provides the fundamental building blocks for SMS operations:
SmsClienttrait for sending SMS messagesInboundWebhooktrait for processing incoming webhooks- Common types for requests, responses, and errors
§Example
ⓘ
use sms_core::{SendRequest, SmsClient};
// Any SMS provider implements SmsClient
let response = client.send(SendRequest {
to: "+1234567890",
from: "+0987654321",
text: "Hello world!"
}).await?;Structs§
- Inbound
Message - Normalized inbound message (e.g., a reply).
- Inbound
Registry - Runtime registry so apps can register any combination of providers and treat them interchangeably.
- Send
Request - Send
Response - Webhook
Response - Generic webhook response that can be converted to any framework’s response type
- Webhook
Result - Result of webhook processing, containing both the message and response info
Enums§
- Http
Status - HTTP status code for web responses
- SmsError
- Errors that can occur during SMS operations
- Webhook
Error - Web-specific error types for webhook processing
Traits§
- Inbound
Webhook - Provider-agnostic inbound webhook interface.
- SmsClient
Functions§
- fallback_
id - Utility to create a pseudo id if a provider doesn’t return one.
Type Aliases§
- Headers
- Lightweight header representation to avoid tying the core to any HTTP framework.