Struct web_push::WebPushMessageBuilder [−][src]
pub struct WebPushMessageBuilder<'a> { /* fields omitted */ }
Expand description
The main class for creating a notification payload.
Implementations
pub fn new(
subscription_info: &'a SubscriptionInfo
) -> Result<WebPushMessageBuilder<'a>, WebPushError>
pub fn new(
subscription_info: &'a SubscriptionInfo
) -> Result<WebPushMessageBuilder<'a>, WebPushError>
Creates a builder for generating the web push payload.
All parameters are from the subscription info given by browser when subscribing to push notifications.
How long the server should keep the message if it cannot be delivered currently. If not set, the message is deleted immediately on failed delivery.
Add a VAPID signature to the request. To be generated with the VapidSignatureBuilder.
If set, the client will get content in the notification. Has a maximum size of 3800 characters.
Currently, Aes128Gcm is the recommended and only encoding standard implemented.
Builds and if set, encrypts the payload. Any errors due to bad encryption will be
WebPushError::Unspecified
, meaning
something was wrong in the given public key or authentication.
You can further debug these issues by checking the API responses visible with
log::trace
level.
Auto Trait Implementations
impl<'a> RefUnwindSafe for WebPushMessageBuilder<'a>
impl<'a> Send for WebPushMessageBuilder<'a>
impl<'a> Sync for WebPushMessageBuilder<'a>
impl<'a> Unpin for WebPushMessageBuilder<'a>
impl<'a> UnwindSafe for WebPushMessageBuilder<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more