summaryrefslogtreecommitdiffstats
path: root/src/transport.rs
diff options
context:
space:
mode:
authorEli W. Hunter <42009212+elihunter173@users.noreply.github.com>2021-02-20 19:36:31 -0500
committerGitHub <noreply@github.com>2021-02-20 19:36:31 -0500
commit9c72d3aacb675c5bcff238ce4996dbbe138e11c8 (patch)
tree692b95faa1a8226a6c29efe1f349ae999eddc735 /src/transport.rs
parent5af822c5691a772cad36bd9a69e94419b03d4511 (diff)
Fix lifetimes (#272)
* Some changes * Clarify lifetimes in transport.rs * Fix remaining easy lifetimes in lib.rs * Refactor Images::build for new lifetimes to work * Fix Exec::start() * Fix Container::exec() * Make header_bytes not a Vec * Make Docker::{images,...}() lifetimes explicit * Fix Containers::get() * Remove unnecessary locals from examples * Update changelog * Appease clippy
Diffstat (limited to 'src/transport.rs')
-rw-r--r--src/transport.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/transport.rs b/src/transport.rs
index 0fbbcc1..59b83b5 100644
--- a/src/transport.rs
+++ b/src/transport.rs
@@ -73,7 +73,7 @@ impl fmt::Debug for Transport {
impl Transport {
/// Make a request and return the whole response in a `String`
- pub async fn request<'a, B, H>(
+ pub async fn request<B, H>(
&self,
method: Method,
endpoint: impl AsRef<str>,
@@ -82,7 +82,7 @@ impl Transport {
) -> Result<String>
where
B: Into<Body>,
- H: IntoIterator<Item = (&'static str, String)> + 'a,
+ H: IntoIterator<Item = (&'static str, String)>,
{
let body = self.get_body(method, endpoint, body, headers).await?;
let bytes = hyper::body::to_bytes(body).await?;
@@ -149,16 +149,16 @@ impl Transport {
Ok(stream_body(body))
}
- pub fn stream_chunks<'a, H, B>(
- &'a self,
+ pub fn stream_chunks<'stream, H, B>(
+ &'stream self,
method: Method,
- endpoint: impl AsRef<str> + 'a,
+ endpoint: impl AsRef<str> + 'stream,
body: Option<(B, Mime)>,
headers: Option<H>,
- ) -> impl Stream<Item = Result<Bytes>> + 'a
+ ) -> impl Stream<Item = Result<Bytes>> + 'stream
where
- H: IntoIterator<Item = (&'static str, String)> + 'a,
- B: Into<Body> + 'a,
+ B: Into<Body> + 'stream,
+ H: IntoIterator<Item = (&'static str, String)> + 'stream,
{
self.get_chunk_stream(method, endpoint, body, headers)
.try_flatten_stream()