Struct web_push_native::WebPushBuilder
source · [−]pub struct WebPushBuilder { /* private fields */ }
Expand description
Reusable builder for HTTP push requests
Implementations
sourceimpl WebPushBuilder
impl WebPushBuilder
sourcepub fn new<'a>(uri: Uri, ua_public: PublicKey, ua_auth: Auth) -> Self
pub fn new<'a>(uri: 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<T: ToString>(self, vapid_kp: ES256KeyPair, contact: T) -> Self
pub fn with_vapid<T: ToString>(self, vapid_kp: ES256KeyPair, contact: T) -> Self
Sets the VAPID signature header for generated HTTP push requests.
Auto Trait Implementations
impl RefUnwindSafe for WebPushBuilder
impl Send for WebPushBuilder
impl Sync for WebPushBuilder
impl Unpin for WebPushBuilder
impl UnwindSafe for WebPushBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more