pub struct BlockingClient { /* private fields */ }
Expand description
Clickatell One messaging gateway client
Implementations§
Source§impl BlockingClient
impl BlockingClient
pub fn new(api_key: &str) -> Result<Self>
pub fn builder() -> BlockingClientBuilder
Sourcepub fn send_messages(&self, send_messages_request: Request) -> Result<Response>
pub 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 BlockingClient
impl !RefUnwindSafe for BlockingClient
impl Send for BlockingClient
impl Sync for BlockingClient
impl Unpin for BlockingClient
impl !UnwindSafe for BlockingClient
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