chorus-core 0.1.0

Core traits and types for Chorus CPaaS
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::error::ChorusError;
use crate::types::{DeliveryStatus, SendResult, SmsMessage};
use async_trait::async_trait;

#[async_trait]
pub trait SmsSender: Send + Sync {
    fn provider_name(&self) -> &str;
    async fn send(&self, msg: &SmsMessage) -> Result<SendResult, ChorusError>;
    async fn check_status(&self, message_id: &str) -> Result<DeliveryStatus, ChorusError>;
}