added raw method to RlpStream. usefull for quicklookup
This commit is contained in:
parent
38f813a5e6
commit
6bc56ad004
@ -101,6 +101,10 @@ impl Stream for RlpStream {
|
||||
self.unfinished_lists.len() == 0
|
||||
}
|
||||
|
||||
fn raw(&self) -> &[u8] {
|
||||
&self.encoder.bytes
|
||||
}
|
||||
|
||||
fn out(self) -> Vec<u8> {
|
||||
match self.is_finished() {
|
||||
true => self.encoder.out().to_vec(),
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user