pub struct RlpList<'a> { /* private fields */ }Expand description
Borrowed RLP list payload.
Fields are private so downstream crates cannot construct unvalidated decoded values and feed them into trusted re-encoding paths.
Implementations§
Source§impl<'a> RlpList<'a>
impl<'a> RlpList<'a>
Sourcepub const fn encoded_len(self) -> usize
pub const fn encoded_len(self) -> usize
Returns the total encoded list length in bytes.
Sourcepub const fn header_len(self) -> usize
pub const fn header_len(self) -> usize
Returns the RLP header length in bytes.
Sourcepub const fn item_count(self) -> usize
pub const fn item_count(self) -> usize
Returns the number of immediate child items.
Sourcepub const fn form(self) -> RlpListForm
pub const fn form(self) -> RlpListForm
Returns the canonical list form that was decoded.
Sourcepub const fn items(self) -> RlpListItems<'a> ⓘ
pub const fn items(self) -> RlpListItems<'a> ⓘ
Returns an iterator over the immediate child items in this list.
Nested child list item counts are computed lazily when those child lists
are yielded. Recursive callers that walk every nested list can therefore
perform additional bounded traversal work proportional to the walked
nesting depth. Use Self::items_with_depth_limit when processing
externally reachable input with a caller-specific recursion budget.
Sourcepub const fn items_with_depth_limit(self, depth: usize) -> RlpListItems<'a> ⓘ
pub const fn items_with_depth_limit(self, depth: usize) -> RlpListItems<'a> ⓘ
Returns an iterator that rejects nested lists after depth child-list
transitions below this list.
A depth of 0 still permits scalar children but yields
DecodeError::NestingTooDeep for a child list. This gives recursive
callers an explicit iteration-phase budget independent from decode-time
validation.