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
|
self.unfinished_lists.len() == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn raw(&self) -> &[u8] {
|
||||||
|
&self.encoder.bytes
|
||||||
|
}
|
||||||
|
|
||||||
fn out(self) -> Vec<u8> {
|
fn out(self) -> Vec<u8> {
|
||||||
match self.is_finished() {
|
match self.is_finished() {
|
||||||
true => self.encoder.out().to_vec(),
|
true => self.encoder.out().to_vec(),
|
||||||
|
@ -282,6 +282,8 @@ pub trait Stream: Sized {
|
|||||||
/// }
|
/// }
|
||||||
fn is_finished(&self) -> bool;
|
fn is_finished(&self) -> bool;
|
||||||
|
|
||||||
|
fn raw(&self) -> &[u8];
|
||||||
|
|
||||||
/// Streams out encoded bytes.
|
/// Streams out encoded bytes.
|
||||||
///
|
///
|
||||||
/// panic! if stream is not finished.
|
/// panic! if stream is not finished.
|
||||||
|
Loading…
Reference in New Issue
Block a user