[][src]Struct a2::client::Client

pub struct Client { /* fields omitted */ }

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.

Methods

impl Client[src]

pub fn certificate<R>(
    certificate: &mut R,
    password: &str,
    endpoint: Endpoint
) -> Result<Client, Error> where
    R: Read
[src]

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

pub fn token<S, T, R>(
    pkcs8_pem: R,
    key_id: S,
    team_id: T,
    endpoint: Endpoint
) -> Result<Client, Error> where
    S: Into<String>,
    T: Into<String>,
    R: Read
[src]

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.

pub fn send<'a>(&self, payload: Payload<'a>) -> FutureResponse[src]

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

pub fn send_with_timeout<'a>(
    &self,
    message: Payload<'a>,
    timeout: Duration
) -> Timeout<FutureResponse>
[src]

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

Auto Trait Implementations

impl Send for Client

impl Sync for Client

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T