Struct a2::client::Client

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

Handles requests to and responses from Apple Push Notification service. Connects using a given connector. Handles the needed authentication and maps responses.

The send method returns a future, which is successful when APNs receives the notification and responds with a status OK. In any other case the future fails. If APNs gives a reason for the failure, the returned Err holds the response for handling.

Implementations§

Create a connection to APNs using the provider client certificate which you obtain from your Apple developer account.

Create a connection to APNs using system certificates, signing every request with a signature using a private key, key id and team id provisioned from your Apple developer account.

Send a notification payload. Returns a future that needs to be given to an executor.

Sends a notification with a timeout. Triggers Error::TimeoutError if the request takes too long.

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.

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.