pub struct Client { /* private fields */ }
Expand description
Clickatell One messaging gateway client
Implementations§
Source§impl Client
impl Client
pub fn new(api_key: &str) -> Result<Self>
pub fn builder() -> ClientBuilder
Sourcepub async fn send_messages(
&self,
send_messages_request: Request,
) -> Result<Response>
pub async fn send_messages( &self, send_messages_request: Request, ) -> Result<Response>
Send messages via the gateway
A return of Ok
does not mean the messages have been successfully delivered, only that
the messages have been accepted by the gateway. Message status can be queried with
message_status.
ⓘ
let mut request = send_messages::Request::new();
request.add_message(Channel::SMS, to, "This is an SMS message");
request.add_message(Channel::WhatsApp, to, "This is a WhatsApp message");
let response = client.send_messages(request).await?;
for message_response in response.messages() {
println!("{} {}", message_response.to, message_response.message_id());
}
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more