summaryrefslogtreecommitdiffstats
path: root/src/docker.rs
diff options
context:
space:
mode:
authorwojciechkepka <wojtek.kepka@protonmail.com>2021-03-12 03:18:58 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-07-05 15:29:33 +0200
commit4514c2566b8f328b5a883e408cf09510a0a97efe (patch)
tree66900f591d00d96a1c5dec6b508551398a93efe9 /src/docker.rs
parent93bdeec423140fe4efc4a01b2dd31e39b817da1b (diff)
Use ImageBuildChunk in endpoints
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/docker.rs')
-rw-r--r--src/docker.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/docker.rs b/src/docker.rs
index edb97e4..1b7f603 100644
--- a/src/docker.rs
+++ b/src/docker.rs
@@ -7,8 +7,7 @@ use std::{collections::HashMap, env, io, path::Path};
use futures_util::{stream::Stream, TryStreamExt};
use hyper::{client::HttpConnector, Body, Client, Method};
use mime::Mime;
-use serde::{Deserialize, Serialize};
-use serde_json::Value;
+use serde::{de, Deserialize, Serialize};
use url::form_urlencoded;
use crate::{
@@ -355,14 +354,15 @@ impl Docker {
/// Send a streaming post request that returns a stream of JSON values
///
/// Assumes that each received chunk contains one or more JSON values
- pub(crate) fn stream_post_into_values<'a, H>(
+ pub(crate) fn stream_post_into<'a, H, T>(
&'a self,
endpoint: impl AsRef<str> + 'a,
body: Option<(Body, Mime)>,
headers: Option<H>,
- ) -> impl Stream<Item = Result<Value>> + 'a
+ ) -> impl Stream<Item = Result<T>> + 'a
where
H: IntoIterator<Item = (&'static str, String)> + 'a,
+ T: de::DeserializeOwned,
{
self.stream_post(endpoint, body, headers)
.and_then(|chunk| async move {