pub struct Client { /* private fields */ }
Expand description

Clickatell One messaging gateway client

Implementations

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());
}

Query the delivery status of a message

let request = message_status::Request::new(message_id);
let status_response = client.message_status(request).await?;
println!("Status: {}", status_response.status())

Return the balance of your Clickatell account

let balance_response = client.balance().await?;
println!("Your balance is {} {}", balance_response.currency, balance_response.balance);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more