pub struct ArrayWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned struct. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> ArrayWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> ArrayWalker<'r, R>
Sourcepub fn decode_field_0(&mut self) -> Result<Vec<Value>, Error>
pub fn decode_field_0(&mut self) -> Result<Vec<Value>, Error>
Decode this field, advancing the walker.
For IndexedBorrowed walkers (optimised + indexed_struct),
the offset table is consulted to jump directly to this field’s
bytes in O(1) — reading any field is independent of how many
fields precede it on the wire.
Sourcepub fn skip_field_0(&mut self) -> Result<(), Error>
pub fn skip_field_0(&mut self) -> Result<(), Error>
Skip this field, advancing the walker.
Free under IndexedBorrowed mode (the offset table already
lets decode_<field> jump directly to any field; “skip”
just bumps the position counter).
Sourcepub fn walk_field_0(
&mut self,
) -> Result<IndexedSeqView<'r, <Vec<Value> as IndexedSeqEncoded>::Item>, Error>
pub fn walk_field_0( &mut self, ) -> Result<IndexedSeqView<'r, <Vec<Value> as IndexedSeqEncoded>::Item>, Error>
Walk into this field. For fields tagged
#[revision(indexed_map)] / #[revision(indexed_seq)],
returns an IndexedMapView / IndexedSeqView
the caller can borrow an IndexedMapWalker /
IndexedSeqWalker from. For all other fields, returns the
inner type’s WalkRevisioned::Walker as usual (borrowing
the parent walker for the duration of the sub-walk).
ConvertedOwned walkers (older-rev convert_fn types) return
revision::Error::Conversion for the legacy path; the
indexed branches re-serialise from the owned value.
Sourcepub fn into_walk_field_0(
self,
) -> Result<IndexedSeqView<'r, <Vec<Value> as IndexedSeqEncoded>::Item>, Error>
pub fn into_walk_field_0( self, ) -> Result<IndexedSeqView<'r, <Vec<Value> as IndexedSeqEncoded>::Item>, Error>
Walk into this field, consuming the parent walker. See
[Self::#walk_name] for shape details.
Sourcepub fn into_field_0_bytes(self) -> Result<Cow<'r, [u8]>, Error>
pub fn into_field_0_bytes(self) -> Result<Cow<'r, [u8]>, Error>
Consume this walker and return the field’s raw wire bytes
as Cow<'r, [u8]>, without decoding the inner type. Lets
the caller construct a child walker themselves via
T::walk_revisioned(&mut bytes). Borrowed from the source
buffer for IndexedBorrowed / Wire walkers; allocated on
the rare ConvertedOwned (cross-rev convert_fn) path.