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 moreAuto Trait Implementations§
impl Freeze for WebPushClient
impl !RefUnwindSafe for WebPushClient
impl Send for WebPushClient
impl Sync for WebPushClient
impl Unpin for WebPushClient
impl !UnwindSafe for WebPushClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more