Struct scrypto::prelude::radix_engine_common::prelude::traversal::TypedTraverser
source · pub struct TypedTraverser<'de, 's, E>where
E: CustomExtension,{
traverser: VecTraverser<'de, <E as CustomExtension>::CustomTraversal>,
state: TypedTraverserState<'s, E>,
}
Expand description
The TypedTraverser
is for streamed decoding of a payload with type kinds.
It validates that the payload matches the given type kinds, and adds the relevant type index to the events which are output.
Fields§
§traverser: VecTraverser<'de, <E as CustomExtension>::CustomTraversal>
§state: TypedTraverserState<'s, E>
Implementations§
source§impl<'de, 's, E> TypedTraverser<'de, 's, E>where
E: CustomExtension,
impl<'de, 's, E> TypedTraverser<'de, 's, E>where
E: CustomExtension,
pub fn new( input: &'de [u8], schema: &'s SchemaV1<<E as CustomExtension>::CustomSchema>, type_id: LocalTypeId, max_depth: usize, expected_start: ExpectedStart<<E as CustomExtension>::CustomValueKind>, check_exact_end: bool ) -> TypedTraverser<'de, 's, E>
pub fn next_event(&mut self) -> TypedLocatedTraversalEvent<'_, 's, 'de, E>
pub fn next_event_with_schema( &mut self ) -> (TypedLocatedTraversalEvent<'_, 's, 'de, E>, &SchemaV1<<E as CustomExtension>::CustomSchema>)
pub fn consume_container_end_event(&mut self) -> Result<(), String>
pub fn consume_end_event(&mut self) -> Result<(), String>
sourcepub fn consume_value_tree(
&mut self
) -> Result<ValueTreeSummary<<E as CustomExtension>::CustomValueKind>, String>
pub fn consume_value_tree( &mut self ) -> Result<ValueTreeSummary<<E as CustomExtension>::CustomValueKind>, String>
And returns the start/end offset of the value body
Auto Trait Implementations§
impl<'de, 's, E> RefUnwindSafe for TypedTraverser<'de, 's, E>where
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>: RefUnwindSafe,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeValidation: RefUnwindSafe,
<E as CustomExtension>::CustomValueKind: RefUnwindSafe,
impl<'de, 's, E> Send for TypedTraverser<'de, 's, E>where
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>: Sync,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeValidation: Sync,
<E as CustomExtension>::CustomValueKind: Send,
impl<'de, 's, E> Sync for TypedTraverser<'de, 's, E>where
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>: Sync,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeValidation: Sync,
<E as CustomExtension>::CustomValueKind: Sync,
impl<'de, 's, E> Unpin for TypedTraverser<'de, 's, E>
impl<'de, 's, E> UnwindSafe for TypedTraverser<'de, 's, E>where
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeKind<LocalTypeId>: RefUnwindSafe,
<<E as CustomExtension>::CustomSchema as CustomSchema>::CustomTypeValidation: RefUnwindSafe,
<E as CustomExtension>::CustomValueKind: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more