Struct a2::client::Client [−][src]
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
impl Client
[src]
pub fn certificate<R>(
certificate: &mut R,
password: &str,
endpoint: Endpoint
) -> Result<Client, Error> where
R: Read,
[src]
certificate: &mut R,
password: &str,
endpoint: Endpoint
) -> Result<Client, Error> where
R: Read,
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]
pkcs8_pem: R,
key_id: S,
team_id: T,
endpoint: Endpoint
) -> Result<Client, Error> where
S: Into<String>,
T: Into<String>,
R: Read,
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(
&self,
payload: Payload<'_>
) -> impl Future<Output = Result<Response, Error>> + 'static
[src]
&self,
payload: Payload<'_>
) -> impl Future<Output = Result<Response, Error>> + 'static
Send a notification payload.
See ErrorReason for possible errors.
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,