diff --git a/progenitor-client/src/progenitor_client.rs b/progenitor-client/src/progenitor_client.rs index 1a1a6cb..373ad63 100644 --- a/progenitor-client/src/progenitor_client.rs +++ b/progenitor-client/src/progenitor_client.rs @@ -16,11 +16,20 @@ use serde::{de::DeserializeOwned, Serialize}; /// Represents an untyped byte stream for both success and error responses. pub struct ByteStream( - Pin> + Send>>, + Pin> + Send + Sync>>, ); +impl ByteStream { + pub fn into_inner( + self, + ) -> Pin> + Send + Sync>> { + self.0 + } +} + impl Deref for ByteStream { - type Target = Pin> + Send>>; + type Target = + Pin> + Send + Sync>>; fn deref(&self) -> &Self::Target { &self.0 @@ -140,6 +149,15 @@ impl ResponseValue { } } +impl ResponseValue { + /// Take ownership of the stream of bytes underpinning this response + pub fn into_inner_stream( + self, + ) -> Pin> + Send + Sync>> { + self.into_inner().into_inner() + } +} + impl Deref for ResponseValue { type Target = T;