Struct web_push_native::WebPushBuilder
source · pub struct WebPushBuilder<A = ()> { /* private fields */ }
Expand description
Reusable builder for HTTP push requests
Implementations§
source§impl WebPushBuilder
impl WebPushBuilder
sourcepub fn new(endpoint: Uri, ua_public: PublicKey, ua_auth: Auth) -> Self
pub fn new(endpoint: Uri, ua_public: PublicKey, ua_auth: Auth) -> Self
Creates a new WebPushBuilder
factory for HTTP push requests.
Requests generated using this factory will have a valid duration of 12 hours and no VAPID signature.
Most providers accepting HTTP push requests will require a valid VAPID
signature, so you will most likely want to add one using
WebPushBuilder::with_vapid
.
sourcepub fn with_valid_duration(self, valid_duration: Duration) -> Self
pub fn with_valid_duration(self, valid_duration: Duration) -> Self
Sets the valid duration for generated HTTP push requests.
sourcepub fn with_vapid<'a>(
self,
vapid_kp: &'a ES256KeyPair,
contact: &'a str
) -> WebPushBuilder<VapidAuthorization<'a>>
pub fn with_vapid<'a>(
self,
vapid_kp: &'a ES256KeyPair,
contact: &'a str
) -> WebPushBuilder<VapidAuthorization<'a>>
Sets the VAPID signature header for generated HTTP push requests.
Trait Implementations§
source§impl<A: Clone> Clone for WebPushBuilder<A>
impl<A: Clone> Clone for WebPushBuilder<A>
source§fn clone(&self) -> WebPushBuilder<A>
fn clone(&self) -> WebPushBuilder<A>
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 moresource§impl<A: Debug> Debug for WebPushBuilder<A>
impl<A: Debug> Debug for WebPushBuilder<A>
source§impl<'de> Deserialize<'de> for WebPushBuilder
impl<'de> Deserialize<'de> for WebPushBuilder
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more