11//! Async pure-Rust ACME (RFC 8555) client.
22
3- #![ warn( unreachable_pub) ]
43#![ warn( missing_docs) ]
54#![ cfg_attr( instant_acme_docsrs, feature( doc_cfg) ) ]
65
@@ -43,15 +42,15 @@ pub use order::{
4342 RetryPolicy ,
4443} ;
4544mod types;
46- #[ cfg( feature = "time" ) ]
47- pub use types:: RenewalInfo ;
4845pub use types:: {
4946 AccountCredentials , Authorization , AuthorizationState , AuthorizationStatus ,
50- AuthorizedIdentifier , CertificateIdentifier , Challenge , ChallengeType , Error , Identifier ,
51- LetsEncrypt , NewAccount , NewOrder , OrderState , OrderStatus , Problem , ProfileMeta ,
52- RevocationReason , RevocationRequest , ZeroSsl ,
47+ AuthorizedIdentifier , CertificateIdentifier , Challenge , ChallengeStatus , ChallengeType ,
48+ DeviceAttestation , Error , Identifier , LetsEncrypt , NewAccount , NewOrder , OrderState ,
49+ OrderStatus , Problem , ProfileMeta , RevocationReason , RevocationRequest , Subproblem , ZeroSsl ,
5350} ;
5451use types:: { Directory , JoseJson , Signer } ;
52+ #[ cfg( feature = "time" ) ]
53+ pub use types:: { RenewalInfo , SuggestedWindow } ;
5554
5655struct Client {
5756 http : Box < dyn HttpClient > ,
@@ -68,7 +67,7 @@ impl Client {
6867 . expect ( "infallible error should not occur" ) ;
6968 let rsp = http. request ( request) . await ?;
7069 let body = rsp. body ( ) . await . map_err ( Error :: Other ) ?;
71- Ok ( Client {
70+ Ok ( Self {
7271 http,
7372 directory : serde_json:: from_slice ( & body) ?,
7473 directory_url : Some ( directory_url) ,
@@ -203,15 +202,15 @@ struct DefaultClient(HyperClient<hyper_rustls::HttpsConnector<HttpConnector>, Bo
203202impl DefaultClient {
204203 fn try_new ( ) -> Result < Self , Error > {
205204 Ok ( Self :: new (
206- hyper_rustls :: HttpsConnectorBuilder :: new ( )
205+ HttpsConnectorBuilder :: new ( )
207206 . try_with_platform_verifier ( )
208207 . map_err ( |e| Error :: Other ( Box :: new ( e) ) ) ?,
209208 ) )
210209 }
211210
212211 fn with_roots ( roots : rustls:: RootCertStore ) -> Result < Self , Error > {
213212 Ok ( Self :: new (
214- hyper_rustls :: HttpsConnectorBuilder :: new ( ) . with_tls_config (
213+ HttpsConnectorBuilder :: new ( ) . with_tls_config (
215214 rustls:: ClientConfig :: builder ( )
216215 . with_root_certificates ( roots)
217216 . with_no_client_auth ( ) ,
@@ -347,15 +346,15 @@ impl http_body::Body for BodyWrapper<Bytes> {
347346
348347impl From < Vec < u8 > > for BodyWrapper < Bytes > {
349348 fn from ( data : Vec < u8 > ) -> Self {
350- BodyWrapper {
349+ Self {
351350 inner : Some ( Bytes :: from ( data) ) ,
352351 }
353352 }
354353}
355354
356355#[ async_trait]
357356impl BytesBody for Bytes {
358- async fn into_bytes ( & mut self ) -> Result < Bytes , Box < dyn StdError + Send + Sync + ' static > > {
357+ async fn into_bytes ( & mut self ) -> Result < Self , Box < dyn StdError + Send + Sync + ' static > > {
359358 Ok ( self . to_owned ( ) )
360359 }
361360}
0 commit comments