File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " web-push"
33description = " Web push notification client with support for http-ece encryption and VAPID authentication."
4- version = " 0.9.1 "
4+ version = " 0.9.2 "
55authors = [
" Julius de Bruijn <[email protected] >" ,
" Andrew Ealovega <[email protected] >" ]
66license = " Apache-2.0"
77homepage = " https://github.com/pimeys/rust-web-push"
@@ -10,7 +10,7 @@ documentation = "https://docs.rs/web-push/"
1010readme = " README.md"
1111keywords = [" web-push" , " http-ece" , " vapid" ]
1212categories = [" web-programming" , " asynchronous" ]
13- edition = " 2018 "
13+ edition = " 2021 "
1414
1515[features ]
1616default = [" isahc" , " futures-lite/futures-io" ] # futures are only used for read_to_end() in isach client.
Original file line number Diff line number Diff line change 11max_width = 120
2- edition = " 2018 "
2+ edition = " 2021 "
Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ use crate::message::WebPushMessage;
1010
1111/// An async client for sending the notification payload.
1212///
13+ /// This client is thread-safe. Clones of this client will share the same underlying resources,
14+ /// so cloning is a cheap and effective method to provide access to the client.
15+ ///
1316/// This client is [`hyper`](https://crates.io/crates/hyper) based, and will only work in Tokio contexts.
17+ #[ derive( Clone ) ]
1418pub struct WebPushClient {
1519 client : Client < HttpsConnector < HttpConnector > > ,
1620}
@@ -48,7 +52,7 @@ impl WebPushClient {
4852 . headers ( )
4953 . get ( RETRY_AFTER )
5054 . and_then ( |ra| ra. to_str ( ) . ok ( ) )
51- . and_then ( |ra| RetryAfter :: from_str ( ra ) ) ;
55+ . and_then ( RetryAfter :: from_str) ;
5256
5357 let response_status = response. status ( ) ;
5458 trace ! ( "Response status: {}" , response_status) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,11 @@ use crate::message::WebPushMessage;
99/// An async client for sending the notification payload. This client is expensive to create, and
1010/// should be reused.
1111///
12+ /// This client is thread-safe. Clones of this client will share the same underlying resources,
13+ /// so cloning is a cheap and effective method to provide access to the client.
14+ ///
1215/// This client is built on [`isahc`](https://crates.io/crates/isahc), and will therefore work on any async executor.
16+ #[ derive( Clone ) ]
1317pub struct WebPushClient {
1418 client : HttpClient ,
1519}
@@ -46,7 +50,7 @@ impl WebPushClient {
4650 . headers ( )
4751 . get ( RETRY_AFTER )
4852 . and_then ( |ra| ra. to_str ( ) . ok ( ) )
49- . and_then ( |ra| RetryAfter :: from_str ( ra ) ) ;
53+ . and_then ( RetryAfter :: from_str) ;
5054
5155 let response_status = response. status ( ) ;
5256 trace ! ( "Response status: {}" , response_status) ;
You can’t perform that action at this time.
0 commit comments