pub struct PartialVapidSignatureBuilder { /* private fields */ }
Expand description

A VapidSignatureBuilder without VAPID subscription info.

Example

use web_push::{VapidSignatureBuilder, SubscriptionInfo};

let builder = VapidSignatureBuilder::from_pem_no_sub("Some PEM".as_bytes()).unwrap();

//Clone builder for each use of the same private key
{
    //Pretend this changes for each connection
    let subscription_info = SubscriptionInfo::new(
    "https://updates.push.services.mozilla.com/wpush/v1/...",
    "BLMbF9ffKBiWQLCKvTHb6LO8Nb6dcUh6TItC455vu2kElga6PQvUmaFyCdykxY2nOSSL3yKgfbmFLRTUaGv4yV8",
    "xS03Fi5ErfTNH_l9WHE9Ig"
    );

    let builder = builder.clone();
    let sig = builder.add_sub_info(&subscription_info).build();
    //Sign message ect.
}

Implementations

Adds the VAPID subscription info for a particular client.

Gets the uncompressed public key bytes derived from the private key used for this VAPID signature.

Base64 encode these bytes to get the key to send to the client.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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