Struct web_push::WebPushClient
source · pub struct WebPushClient { /* private fields */ }
Expand description
An async client for sending the notification payload. This client is expensive to create, and should be reused.
This client is thread-safe. Clones of this client will share the same underlying resources, so cloning is a cheap and effective method to provide access to the client.
This client is built on isahc
, and will therefore work on any async executor.
Implementations§
source§impl WebPushClient
impl WebPushClient
sourcepub fn new() -> Result<WebPushClient, WebPushError>
pub fn new() -> Result<WebPushClient, WebPushError>
Creates a new client. Can fail under resource depletion.
sourcepub async fn send(&self, message: WebPushMessage) -> Result<(), WebPushError>
pub async fn send(&self, message: WebPushMessage) -> Result<(), WebPushError>
Sends a notification. Never times out.
Trait Implementations§
source§impl Clone for WebPushClient
impl Clone for WebPushClient
source§fn clone(&self) -> WebPushClient
fn clone(&self) -> WebPushClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more