Struct ethcore::views::ViewRlp
[−]
[src]
pub struct ViewRlp<'a> { pub rlp: Rlp<'a>, // some fields omitted }
Wrapper for trusted rlp, which is expected to be valid, for use in views When created with view!, records the file and line where it was created for debugging
Fields
rlp: Rlp<'a>
Wrapped Rlp, expected to be valid
Methods
impl<'a, 'view> ViewRlp<'a> where
'a: 'view,
[src]
impl<'a, 'view> ViewRlp<'a> where
'a: 'view,
pub fn at(&self, index: usize) -> ViewRlp<'a>
[src]
pub fn at(&self, index: usize) -> ViewRlp<'a>
Returns rlp at the given index, panics if no rlp at that index
pub fn iter(&'view self) -> ViewRlpIterator<'a, 'view>
[src]
pub fn iter(&'view self) -> ViewRlpIterator<'a, 'view>
Returns an iterator over all rlp values
pub fn as_val<T>(&self) -> T where
T: Decodable,
[src]
pub fn as_val<T>(&self) -> T where
T: Decodable,
Returns decoded value of this rlp, panics if rlp not valid
pub fn val_at<T>(&self, index: usize) -> T where
T: Decodable,
[src]
pub fn val_at<T>(&self, index: usize) -> T where
T: Decodable,
Returns decoded value at the given index, panics not present or valid at that index
pub fn list_at<T>(&self, index: usize) -> Vec<T> where
T: Decodable,
[src]
pub fn list_at<T>(&self, index: usize) -> Vec<T> where
T: Decodable,
Returns decoded list of values, panics if rlp is invalid
pub fn item_count(&self) -> usize
[src]
pub fn item_count(&self) -> usize
Returns the number of items in the rlp, panics if it is not a list of rlp values
pub fn as_raw(&'view self) -> &'a [u8]
[src]
pub fn as_raw(&'view self) -> &'a [u8]
Returns raw rlp bytes
Trait Implementations
impl<'a, 'view> IntoIterator for &'view ViewRlp<'a> where
'a: 'view,
[src]
impl<'a, 'view> IntoIterator for &'view ViewRlp<'a> where
'a: 'view,