diff --git a/src/rlp/rlpstream.rs b/src/rlp/rlpstream.rs index 301a39053..43ae83a9a 100644 --- a/src/rlp/rlpstream.rs +++ b/src/rlp/rlpstream.rs @@ -101,6 +101,10 @@ impl Stream for RlpStream { self.unfinished_lists.len() == 0 } + fn raw(&self) -> &[u8] { + &self.encoder.bytes + } + fn out(self) -> Vec { match self.is_finished() { true => self.encoder.out().to_vec(), diff --git a/src/rlp/traits.rs b/src/rlp/traits.rs index 1127ca3db..4f9ad09e5 100644 --- a/src/rlp/traits.rs +++ b/src/rlp/traits.rs @@ -282,6 +282,8 @@ pub trait Stream: Sized { /// } fn is_finished(&self) -> bool; + fn raw(&self) -> &[u8]; + /// Streams out encoded bytes. /// /// panic! if stream is not finished.