Struct common_types::views::ViewRlp [−][src]
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]
'a: 'view,
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]
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]
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]
T: Decodable,
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]
'a: 'view,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,