Crate sms_core

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

  • SmsClient trait for sending SMS messages
  • InboundWebhook trait 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§

InboundMessage
Normalized inbound message (e.g., a reply).
InboundRegistry
Runtime registry so apps can register any combination of providers and treat them interchangeably.
SendRequest
SendResponse
WebhookResponse
Generic webhook response that can be converted to any framework’s response type
WebhookResult
Result of webhook processing, containing both the message and response info

Enums§

HttpStatus
HTTP status code for web responses
SmsError
Errors that can occur during SMS operations
WebhookError
Web-specific error types for webhook processing

Traits§

InboundWebhook
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.