pub struct RelationWalker<'r, R: BorrowedReader + 'r> { /* private fields */ }Expand description
Walker for a revisioned struct. Generated by #[revisioned(...)].
Implementations§
Source§impl<'r, R: BorrowedReader + 'r> RelationWalker<'r, R>
impl<'r, R: BorrowedReader + 'r> RelationWalker<'r, R>
Sourcepub fn decode_from(&mut self) -> Result<Vec<TableName>, Error>
pub fn decode_from(&mut self) -> Result<Vec<TableName>, 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_from(&mut self) -> Result<(), Error>
pub fn skip_from(&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_from(
&mut self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'_, R>, Error>
pub fn walk_from( &mut self, ) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'_, R>, 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_from(
self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_walk_from( self, ) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into this field, consuming the parent walker. See
[Self::#walk_name] for shape details.
Sourcepub fn into_from_bytes(self) -> Result<Cow<'r, [u8]>, Error>
pub fn into_from_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.
Sourcepub fn decode_to(&mut self) -> Result<Vec<TableName>, Error>
pub fn decode_to(&mut self) -> Result<Vec<TableName>, 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_to(&mut self) -> Result<(), Error>
pub fn skip_to(&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_to(
&mut self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'_, R>, Error>
pub fn walk_to( &mut self, ) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'_, R>, 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_to(
self,
) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_walk_to( self, ) -> Result<<Vec<TableName> as WalkRevisioned>::Walker<'r, R>, Error>
Walk into this field, consuming the parent walker. See
[Self::#walk_name] for shape details.
Sourcepub fn into_to_bytes(self) -> Result<Cow<'r, [u8]>, Error>
pub fn into_to_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.
Sourcepub fn decode_enforced(&mut self) -> Result<bool, Error>
pub fn decode_enforced(&mut self) -> Result<bool, 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_enforced(&mut self) -> Result<(), Error>
pub fn skip_enforced(&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_enforced(
&mut self,
) -> Result<<bool as WalkRevisioned>::Walker<'_, R>, Error>
pub fn walk_enforced( &mut self, ) -> Result<<bool as WalkRevisioned>::Walker<'_, R>, 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_enforced(
self,
) -> Result<<bool as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_walk_enforced( self, ) -> Result<<bool as WalkRevisioned>::Walker<'r, R>, Error>
Walk into this field, consuming the parent walker. See
[Self::#walk_name] for shape details.
Sourcepub fn into_enforced_bytes(self) -> Result<Cow<'r, [u8]>, Error>
pub fn into_enforced_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.
Sourcepub fn decode_lightweight(&mut self) -> Result<bool, Error>
pub fn decode_lightweight(&mut self) -> Result<bool, 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_lightweight(&mut self) -> Result<(), Error>
pub fn skip_lightweight(&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_lightweight(
&mut self,
) -> Result<<bool as WalkRevisioned>::Walker<'_, R>, Error>
pub fn walk_lightweight( &mut self, ) -> Result<<bool as WalkRevisioned>::Walker<'_, R>, 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_lightweight(
self,
) -> Result<<bool as WalkRevisioned>::Walker<'r, R>, Error>
pub fn into_walk_lightweight( self, ) -> Result<<bool as WalkRevisioned>::Walker<'r, R>, Error>
Walk into this field, consuming the parent walker. See
[Self::#walk_name] for shape details.
Sourcepub fn into_lightweight_bytes(self) -> Result<Cow<'r, [u8]>, Error>
pub fn into_lightweight_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.