Struct common_types::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

Implementations

impl<'a, 'view> ViewRlp<'a> where
    'a: 'view, 
[src]

pub fn at(&self, index: usize) -> ViewRlp<'a>[src]

Returns rlp at the given index, panics if no rlp at that index

pub fn iter(&'view self) -> ViewRlpIterator<'a, 'view>[src]

Returns an iterator over all rlp values

pub fn as_val<T>(&self) -> T where
    T: Decodable
[src]

Returns decoded value of this rlp, panics if rlp not valid

pub fn val_at<T>(&self, index: usize) -> T where
    T: Decodable
[src]

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]

Returns decoded list of values, panics if rlp is invalid

pub fn item_count(&self) -> usize[src]

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]

Returns raw rlp bytes

Trait Implementations

impl<'a, 'view> IntoIterator for &'view ViewRlp<'a> where
    'a: 'view, 
[src]

type Item = ViewRlp<'a>

The type of the elements being iterated over.

type IntoIter = ViewRlpIterator<'a, 'view>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<'a> !RefUnwindSafe for ViewRlp<'a>

impl<'a> Send for ViewRlp<'a>

impl<'a> !Sync for ViewRlp<'a>

impl<'a> Unpin for ViewRlp<'a>

impl<'a> UnwindSafe for ViewRlp<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,