Struct ethers::core::utils::rlp::Rlp [−]
pub struct Rlp<'a> { /* fields omitted */ }
Expand description
Data-oriented view onto rlp-slice.
This is an immutable structure. No operations change it.
Should be used in places where, error handling is required, eg. on input
Implementations
impl<'a> Rlp<'a>
impl<'a> Rlp<'a>
pub fn prototype(&self) -> Result<Prototype, DecoderError>
pub fn payload_info(&self) -> Result<PayloadInfo, DecoderError>
pub fn item_count(&self) -> Result<usize, DecoderError>
pub fn at<'view>(&'view self, index: usize) -> Result<Rlp<'a>, DecoderError> where
'a: 'view,
pub fn at<'view>(&'view self, index: usize) -> Result<Rlp<'a>, DecoderError> where
'a: 'view,
Returns an Rlp item in a list at the given index.
Returns an error if this Rlp is not a list or if the index is out of range.
pub fn at_with_offset<'view>(
&'view self,
index: usize
) -> Result<(Rlp<'a>, usize), DecoderError> where
'a: 'view,
pub fn at_with_offset<'view>(
&'view self,
index: usize
) -> Result<(Rlp<'a>, usize), DecoderError> where
'a: 'view,
Returns an Rlp item in a list at the given index along with the byte offset into the raw data slice.
Returns an error if this Rlp is not a list or if the index is out of range.
pub fn iter<'view>(&'view self) -> RlpIterator<'a, 'view>ⓘNotable traits for RlpIterator<'a, 'view>impl<'a, 'view> Iterator for RlpIterator<'a, 'view> type Item = Rlp<'a>;
where
'a: 'view,
impl<'a, 'view> Iterator for RlpIterator<'a, 'view> type Item = Rlp<'a>;
pub fn as_val<T>(&self) -> Result<T, DecoderError> where
T: Decodable,
pub fn val_at<T>(&self, index: usize) -> Result<T, DecoderError> where
T: Decodable,
pub fn decoder(&self) -> BasicDecoder<'_>
Trait Implementations
impl<'a, 'view> IntoIterator for &'view Rlp<'a> where
'a: 'view,
impl<'a, 'view> IntoIterator for &'view Rlp<'a> where
'a: 'view,
type IntoIter = RlpIterator<'a, 'view>
type IntoIter = RlpIterator<'a, 'view>
Which kind of iterator are we turning this into?
pub fn into_iter(self) -> <&'view Rlp<'a> as IntoIterator>::IntoIter
pub fn into_iter(self) -> <&'view Rlp<'a> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Rlp<'a>
impl<'a> UnwindSafe for Rlp<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more