Struct rlp::Rlp
[−]
[src]
pub struct Rlp<'a> { /* fields omitted */ }
Data-oriented view onto trusted rlp-slice.
Unlikely to UntrustedRlp
doesn't bother you with error
handling. It assumes that you know what you are doing.
Methods
impl<'a, 'view> Rlp<'a> where 'a: 'view
[src]
fn as_val<T>(&self) -> T where T: RlpDecodable
Decode into an object
fn val_at<T>(&self, index: usize) -> T where T: RlpDecodable
Decode list item at given index into an object
Trait Implementations
impl<'a> From<UntrustedRlp<'a>> for Rlp<'a>
[src]
fn from(rlp: UntrustedRlp<'a>) -> Rlp<'a>
Performs the conversion.
impl<'a> Debug for Rlp<'a>
[src]
impl<'a> Display for Rlp<'a>
[src]
impl<'a, 'view> View<'a, 'view> for Rlp<'a> where 'a: 'view
[src]
type Prototype = Prototype
RLP prototype type
type PayloadInfo = PayloadInfo
Payload info type
type Data = &'a [u8]
Data type
type Item = Rlp<'a>
Item type
type Iter = RlpIterator<'a, 'view>
Iterator type
fn new(bytes: &'a [u8]) -> Rlp<'a>
Create a new instance of Rlp
fn as_raw(&'view self) -> &'a [u8]
The raw data of the RLP as slice. Read more
fn prototype(&self) -> Self::Prototype
Get the prototype of the RLP.
fn payload_info(&self) -> Self::PayloadInfo
Get payload info.
fn data(&'view self) -> Self::Data
Get underlieing data.
fn item_count(&self) -> usize
Returns number of RLP items. Read more
fn size(&self) -> usize
Returns the number of bytes in the data, or zero if it isn't data. Read more
fn at(&'view self, index: usize) -> Self::Item
Get view onto RLP-slice at index. Read more
fn is_null(&self) -> bool
No value Read more
fn is_empty(&self) -> bool
Contains a zero-length string or zero-length list. Read more
fn is_list(&self) -> bool
List value Read more
fn is_data(&self) -> bool
String value Read more
fn is_int(&self) -> bool
Int value Read more
fn iter(&'view self) -> Self::Iter
Get iterator over rlp-slices Read more
fn as_val<T>(&self) -> Result<T, DecoderError> where T: RlpDecodable
Decode data into an object
fn val_at<T>(&self, index: usize) -> Result<T, DecoderError> where T: RlpDecodable
Decode data at given list index into an object