Skip to content

Commit 3ac9b2d

Browse files
committed
Name refactoring
1 parent 23af5b3 commit 3ac9b2d

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

src/fl_url.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub struct FlUrl {
6262
pub not_used_connection_timeout: Duration,
6363
pub request_timeout: Duration,
6464
pub do_not_reuse_connection: bool,
65-
pub clients_cache: Option<Arc<FlUrlHttpConnectionsCache>>,
65+
pub connections_cache: Option<Arc<FlUrlHttpConnectionsCache>>,
6666
pub compress_body: bool,
6767
pub print_input_request: bool,
6868
mode: FlUrlMode,
@@ -122,11 +122,11 @@ impl FlUrl {
122122

123123
let result = Self {
124124
headers: FlUrlHeaders::new(),
125-
client_cert: None,
125+
client_cert: Default::default(),
126126
url_builder: url,
127127
accept_invalid_certificate: false,
128128
do_not_reuse_connection: false,
129-
clients_cache: None,
129+
connections_cache: Default::default(),
130130
not_used_connection_timeout: Duration::from_secs(30),
131131
max_retries: 0,
132132
request_timeout: Duration::from_secs(10),
@@ -162,8 +162,8 @@ impl FlUrl {
162162
self
163163
}
164164

165-
pub fn with_clients_cache(mut self, clients_cache: Arc<FlUrlHttpConnectionsCache>) -> Self {
166-
self.clients_cache = Some(clients_cache);
165+
pub fn set_connections_cache(mut self, clients_cache: Arc<FlUrlHttpConnectionsCache>) -> Self {
166+
self.connections_cache = Some(clients_cache);
167167
self
168168
}
169169

@@ -440,7 +440,7 @@ impl FlUrl {
440440
.await
441441
}
442442
pub(crate) fn get_clients_cache(&self) -> Arc<FlUrlHttpConnectionsCache> {
443-
match self.clients_cache.as_ref() {
443+
match self.connections_cache.as_ref() {
444444
Some(cache) => cache.clone(),
445445
None => crate::CLIENTS_CACHED.clone(),
446446
}
@@ -760,7 +760,7 @@ impl FlUrl {
760760

761761
loop {
762762
let http_client = http_client_resolver
763-
.get_http_client(
763+
.get_http_connection(
764764
self.mode,
765765
&self.url_builder,
766766
self.headers.get_host_header_value(),
@@ -778,7 +778,7 @@ impl FlUrl {
778778

779779
if response.drop_connection() {
780780
http_client_resolver
781-
.drop_http_client(
781+
.drop_http_connection(
782782
&response.url,
783783
#[cfg(feature = "with-ssh")]
784784
ssh_credentials.as_ref(),
@@ -789,7 +789,7 @@ impl FlUrl {
789789
}
790790
Err(err) => {
791791
http_client_resolver
792-
.drop_http_client(
792+
.drop_http_connection(
793793
&self.url_builder,
794794
#[cfg(feature = "with-ssh")]
795795
ssh_credentials.as_ref(),

src/http_clients_cache/http.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const HTTP_DEFAULT_PORT: u16 = 80;
1818

1919
#[async_trait::async_trait]
2020
impl HttpConnectionResolver<TcpStream, HttpConnector> for HttpConnectionCreator {
21-
async fn get_http_client(
21+
async fn get_http_connection(
2222
&self,
2323
mode: FlUrlMode,
2424
url_builder: &UrlBuilder,
@@ -36,7 +36,7 @@ impl HttpConnectionResolver<TcpStream, HttpConnector> for HttpConnectionCreator
3636
}
3737
}
3838

39-
async fn drop_http_client(
39+
async fn drop_http_connection(
4040
&self,
4141
_url_builder: &UrlBuilder,
4242
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,
@@ -46,7 +46,7 @@ impl HttpConnectionResolver<TcpStream, HttpConnector> for HttpConnectionCreator
4646

4747
#[async_trait::async_trait]
4848
impl HttpConnectionResolver<TcpStream, HttpConnector> for FlUrlHttpConnectionsCache {
49-
async fn get_http_client(
49+
async fn get_http_connection(
5050
&self,
5151
mode: FlUrlMode,
5252
url_builder: &UrlBuilder,
@@ -65,7 +65,7 @@ impl HttpConnectionResolver<TcpStream, HttpConnector> for FlUrlHttpConnectionsCa
6565
}
6666

6767
let new_one = HttpConnectionCreator
68-
.get_http_client(
68+
.get_http_connection(
6969
mode,
7070
url_builder,
7171
host_header,
@@ -82,7 +82,7 @@ impl HttpConnectionResolver<TcpStream, HttpConnector> for FlUrlHttpConnectionsCa
8282
new_one
8383
}
8484

85-
async fn drop_http_client(
85+
async fn drop_http_connection(
8686
&self,
8787
url_builder: &UrlBuilder,
8888
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,

src/http_clients_cache/http_connection_resolver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub trait HttpConnectionResolver<
1212
TConnector: MyHttpClientConnector<TStream> + Send + Sync + 'static,
1313
>
1414
{
15-
async fn get_http_client(
15+
async fn get_http_connection(
1616
&self,
1717
mode: FlUrlMode,
1818
url_builder: &UrlBuilder,
@@ -22,7 +22,7 @@ pub trait HttpConnectionResolver<
2222
#[cfg(feature = "with-ssh")] ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,
2323
) -> Arc<MyHttpClientWrapper<TStream, TConnector>>;
2424

25-
async fn drop_http_client(
25+
async fn drop_http_connection(
2626
&self,
2727
url_builder: &UrlBuilder,
2828
#[cfg(feature = "with-ssh")] ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,

src/http_clients_cache/https.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const HTTPS_DEFAULT_PORT: u16 = 443;
1818

1919
#[async_trait::async_trait]
2020
impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for HttpsClientCreator {
21-
async fn get_http_client(
21+
async fn get_http_connection(
2222
&self,
2323
mode: FlUrlMode,
2424
url_builder: &UrlBuilder,
@@ -51,7 +51,7 @@ impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for HttpsClien
5151
}
5252
}
5353

54-
async fn drop_http_client(
54+
async fn drop_http_connection(
5555
&self,
5656
_url_builder: &UrlBuilder,
5757
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,
@@ -61,7 +61,7 @@ impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for HttpsClien
6161

6262
#[async_trait::async_trait]
6363
impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for FlUrlHttpConnectionsCache {
64-
async fn get_http_client(
64+
async fn get_http_connection(
6565
&self,
6666
mode: FlUrlMode,
6767
url_builder: &UrlBuilder,
@@ -78,7 +78,7 @@ impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for FlUrlHttpC
7878
}
7979

8080
let new_one = HttpsClientCreator
81-
.get_http_client(
81+
.get_http_connection(
8282
mode,
8383
url_builder,
8484
host_header,
@@ -95,7 +95,7 @@ impl HttpConnectionResolver<TlsStream<TcpStream>, HttpsConnector> for FlUrlHttpC
9595
new_one
9696
}
9797

98-
async fn drop_http_client(
98+
async fn drop_http_connection(
9999
&self,
100100
url_builder: &UrlBuilder,
101101
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,

src/http_clients_cache/unix_socket.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct UnixSocketHttpClientCreator;
1818

1919
#[async_trait::async_trait]
2020
impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for UnixSocketHttpClientCreator {
21-
async fn get_http_client(
21+
async fn get_http_connection(
2222
&self,
2323
mode: FlUrlMode,
2424
url_builder: &UrlBuilder,
@@ -36,7 +36,7 @@ impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for UnixSocke
3636
}
3737
}
3838

39-
async fn drop_http_client(
39+
async fn drop_http_connection(
4040
&self,
4141
_url_builder: &UrlBuilder,
4242
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,
@@ -46,7 +46,7 @@ impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for UnixSocke
4646

4747
#[async_trait::async_trait]
4848
impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for FlUrlHttpConnectionsCache {
49-
async fn get_http_client(
49+
async fn get_http_connection(
5050
&self,
5151
mode: FlUrlMode,
5252
url_builder: &UrlBuilder,
@@ -65,7 +65,7 @@ impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for FlUrlHttp
6565
}
6666

6767
let new_one = UnixSocketHttpClientCreator
68-
.get_http_client(
68+
.get_http_connection(
6969
mode,
7070
url_builder,
7171
host_header,
@@ -82,7 +82,7 @@ impl HttpConnectionResolver<UnixSocketStream, UnixSocketConnector> for FlUrlHttp
8282
new_one
8383
}
8484

85-
async fn drop_http_client(
85+
async fn drop_http_connection(
8686
&self,
8787
url_builder: &UrlBuilder,
8888
#[cfg(feature = "with-ssh")] _ssh_credentials: Option<&Arc<my_ssh::SshCredentials>>,

0 commit comments

Comments
 (0)