use core::{any::TypeId, marker::PhantomData};
use crate::{
any::{AnyTrait, BorrowedStatic, BorrowedStaticHrt},
any_trait,
effect::{Adapters, Effect, ObjSafe},
hkt::Marker,
never::Never,
protocol::{
visitor::{
visit_recoverable, visit_request_hint, visit_sequence, visit_tag, visit_value,
RecoverableKnown, RecoverableProto, RecoverableScope, SequenceKnown, SequenceProto,
SequenceScope, TagConst, TagDyn, TagError, TagHint, TagKnown, TagProto, ValueKnown,
ValueProto, VisitResult,
},
walker::hint::{Hint, MetaKnown},
walker::hint::{HintMeta, HintProto, MetaHint},
DynVisitor, DynWalker,
},
Flow, Status, WalkerTypes, TAG_FIELD_NAMES, TAG_MAP, TAG_STRUCT, TAG_TYPE_ID, TAG_TYPE_NAME,
};
use super::{noop::NoopWalker, tag::StaticSliceWalker, value::ValueWalker};
pub enum StaticType {}
pub enum NamedType {}
pub enum LifetimeType {}
/// Walker for a borrow of a struct.
///
/// This walker implements the struct flow. The struct cannot contain lifetimes.
pub struct StructWalker<'ctx, I: StructTypeInfo<'ctx, M, S = S>, S, M, E> {
/// Struct value to walk.
value: &'ctx I::T,
/// Index of the current field to walk.
index: usize,
/// Error if there was one.
///
/// The visitor tracks it's own errors.
error: Option<StructWalkErrorKind<I::FieldError>>,
_generics: Marker<E>,
}
/// Type info about a struct needed by [`StructWalker`].
pub trait StructTypeInfo<'ctx, M>: 'static {
/// Name of the struct.
const NAME: &'static str;
/// The field names in definition order.
const FIELDS: &'static [&'static str];
/// The walking errors for the fields.
type FieldError: Send + Sync;
type S: 'static;
/// The struct being described.
type T: Send + Sync;
/// Walk the given field.
fn walk_field<'a, E: Effect>(
index: usize,
value: &'ctx Self::T,
visitor: DynVisitor<'a, 'ctx>,
) -> ObjSafe<'a, Result<Flow, Self::FieldError>, E>;
}
#[derive(Debug, PartialEq, Clone, Copy)]
#[allow(unused)]
enum StructWalkErrorKind<T> {
/// Error with visiting a tag for the struct.
///
/// This error shouldn't really happen if the visitor behaves.
Tag(TagError<Never>),
/// Error with visiting a tag for a struct's field.
///
/// This error shouldn't really happen if the visitor behaves.
FieldTag(TagError<TagError<Never>>),
/// Error with visiting a field.
Field(T),
}
/// Error from walking a struct.
#[derive(Debug, PartialEq, Copy, Clone)]
#[allow(unused)]
pub struct StructWalkError<T> {
kind: StructWalkErrorKind<T>,
}
impl<'ctx, I, S, M, E> StructWalker<'ctx, I, S, M, E>
where
I: StructTypeInfo<'ctx, M, S = S>,
{
/// Create walker from a borrow of a struct.
pub fn new(value: &'ctx I::T) -> Self {
Self {
value,
index: 0,
error: None,
_generics: Default::default(),
}
}
}
impl<'ctx, I, S, M, E> WalkerTypes for StructWalker<'ctx, I, S, M, E>
where
I: StructTypeInfo<'ctx, M, S = S>,
{
type Error = StructWalkError<I::FieldError>;
type Output = ();
}
impl<'ctx, I, S, E, M> crate::Walker<'ctx, E> for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
Self: AnyTrait<'ctx> + RecoverableScope<'ctx, E>,
{
#[inline(always)]
fn walk<'b: 'c, 'c>(
mut self,
mut visitor: DynVisitor<'b, 'ctx>,
) -> ObjSafe<'c, Result<Self::Output, Self::Error>, E>
where
Self: 'c,
{
E::ready((self, visitor))
.as_ctx_for(
#[inline(always)]
|(this, visitor), _| {
(
RecoverableScope::<'ctx, E>::new_walk::<'_, '_, '_>(this, visitor.cast()),
PhantomData,
)
},
)
.map(|((this, _), _)| match this.error {
Some(err) => Err(StructWalkError { kind: err }),
None => Ok(()),
})
.into()
// E::ready(self).as_ctx_for::<'ctx, '_>(|this, _| {
// (RecoverableScope::<'ctx, E>::new_walk::<'_, 'b, '_>(this, visitor), PhantomData)
// });
// E::wrap(async move {
// // Use the recoverable walk to not duplicate the code.
// let _ = RecoverableScope::<'ctx, E>::new_walk(&mut self, visitor.cast()).await;
//
// // Get the error if there was one.
// match self.error {
// Some(err) => Err(StructWalkError { kind: err }),
// None => Ok(()),
// }
// })
}
}
any_trait! {
impl['ctx, I, M, E] StructWalker<'ctx, I, StaticType, M, E> = [
HintProto<RecoverableProto<E>>,
HintProto<SequenceProto<E>>,
HintProto<ValueProto<BorrowedStaticHrt<I::T>, E>>,
HintProto<TagProto<TagDyn, E>>,
HintProto<TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>,
HintProto<TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>,
HintProto<TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>,
HintProto<TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>,
HintProto<TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>,
] where
E: Effect,
I: StructTypeInfo<'ctx, M, S = StaticType>,
I::T: 'static
}
impl<'ctx, I, S, M, E> Hint<'ctx, RecoverableProto<E>> for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
Self: AnyTrait<'ctx> + RecoverableScope<'ctx, E>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <RecoverableProto<E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_recoverable::<E>(visitor, self),
// |status| match status {
// VisitResult::Skipped(_) => Flow::Continue,
// VisitResult::Control(flow) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <RecoverableProto<E> as HintMeta>::Hint,
) -> ObjSafe<'a, Result<MetaKnown<'a, 'ctx, RecoverableProto<E>>, ()>, E> {
E::ready(Ok(RecoverableKnown)).into()
}
}
impl<'ctx, I, S, M, E> Hint<'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>
for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: MetaHint<'a, 'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_tag::<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E, _>(
// TagConst,
// visitor,
// StaticSliceWalker::<_, ValueWalker<&'static str>>::new(I::FIELDS),
// ),
// |status| match status {
// Err(err) => {
// self.error = Some(StructWalkErrorKind::FieldTag(err));
// Flow::Err
// }
// Ok(VisitResult::Skipped(_)) => Flow::Continue,
// Ok(VisitResult::Control(flow)) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a MetaHint<'a, 'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>,
) -> ObjSafe<
'a,
Result<MetaKnown<'a, 'ctx, TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>>, ()>,
E,
> {
E::ready(Ok(TagKnown {
kind_available: Some(true),
}))
.into()
}
}
impl<'ctx, I, S, M, E> Hint<'ctx, TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>
for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_tag::<TagConst<{ TAG_TYPE_NAME.to_int() }>, E, _>(
// TagConst,
// visitor,
// ValueWalker::new(I::NAME),
// ),
// |status| match status {
// Err(err) => {
// self.error = Some(StructWalkErrorKind::Tag(err));
// Flow::Err
// }
// Ok(VisitResult::Skipped(_)) => Flow::Continue,
// Ok(VisitResult::Control(flow)) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<
'a,
Result<MetaKnown<'a, 'ctx, TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>, ()>,
E,
> {
E::ready(Ok(TagKnown {
kind_available: Some(true),
}))
.into()
}
}
impl<'ctx, I, S, M, E> Hint<'ctx, TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>
for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <TagProto<TagConst<{ TAG_MAP.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_tag::<TagConst<{ TAG_MAP.to_int() }>, E, _>(TagConst, visitor, NoopWalker::new()),
// |status| match status {
// Err(err) => {
// self.error = Some(StructWalkErrorKind::Tag(err));
// Flow::Err
// }
// Ok(VisitResult::Skipped(_)) => Flow::Continue,
// Ok(VisitResult::Control(flow)) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <TagProto<TagConst<{ TAG_MAP.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Result<MetaKnown<'a, 'ctx, TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>, ()>, E>
{
E::ready(Ok(TagKnown {
kind_available: Some(true),
}))
.into()
}
}
impl<'ctx, I, S, M, E> Hint<'ctx, TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>
for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_tag::<TagConst<{ TAG_STRUCT.to_int() }>, E, _>(
// TagConst,
// visitor,
// NoopWalker::new(),
// ),
// |status| match status {
// Err(err) => {
// self.error = Some(StructWalkErrorKind::Tag(err));
// Flow::Err
// }
// Ok(VisitResult::Skipped(_)) => Flow::Continue,
// Ok(VisitResult::Control(flow)) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<
'a,
Result<MetaKnown<'a, 'ctx, TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>, ()>,
E,
> {
E::ready(Ok(TagKnown {
kind_available: Some(true),
}))
.into()
}
}
impl<'ctx, I, M, E> Hint<'ctx, TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>
for StructWalker<'ctx, I, StaticType, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = StaticType>,
I::T: 'static,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_tag::<TagConst<{ TAG_TYPE_ID.to_int() }>, E, _>(
// TagConst,
// visitor,
// ValueWalker::new(TypeId::of::<I::T>()),
// ),
// |status| match status {
// Err(err) => {
// self.error = Some(StructWalkErrorKind::Tag(err));
// Flow::Err
// }
// Ok(VisitResult::Skipped(_)) => Flow::Continue,
// Ok(VisitResult::Control(flow)) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E> as HintMeta>::Hint,
) -> ObjSafe<
'a,
Result<MetaKnown<'a, 'ctx, TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>, ()>,
E,
> {
E::ready(Ok(TagKnown {
kind_available: Some(true),
}))
.into()
}
}
impl<'ctx, I, M, E> Hint<'ctx, TagProto<TagDyn, E>> for StructWalker<'ctx, I, StaticType, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = StaticType>,
I::T: 'static,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
hint: <TagProto<TagDyn, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
match hint.kind.0 {
crate::TAG_TYPE_ID => {
Hint::<'ctx, TagProto<TagConst<{ TAG_TYPE_ID.to_int() }>, E>>::hint(
self,
visitor,
TagHint { kind: TagConst },
)
}
crate::TAG_STRUCT => {
Hint::<'ctx, TagProto<TagConst<{ TAG_STRUCT.to_int() }>, E>>::hint(
self,
visitor,
TagHint { kind: TagConst },
)
}
crate::TAG_MAP => Hint::<'ctx, TagProto<TagConst<{ TAG_MAP.to_int() }>, E>>::hint(
self,
visitor,
TagHint { kind: TagConst },
),
crate::TAG_TYPE_NAME => {
Hint::<'ctx, TagProto<TagConst<{ TAG_TYPE_NAME.to_int() }>, E>>::hint(
self,
visitor,
TagHint { kind: TagConst },
)
}
crate::TAG_FIELD_NAMES => Hint::<
'ctx,
TagProto<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E>,
>::hint(self, visitor, TagHint { kind: TagConst }),
_ => E::ready(Flow::Continue).into(),
}
}
#[inline(always)]
fn known<'a>(
&'a mut self,
hint: &'a <TagProto<TagDyn, E> as HintMeta>::Hint,
) -> ObjSafe<'a, Result<MetaKnown<'a, 'ctx, TagProto<TagDyn, E>>, ()>, E> {
E::ready(match hint.kind {
TagDyn(crate::TAG_TYPE_ID) | TagDyn(crate::TAG_STRUCT) => Ok(TagKnown {
kind_available: Some(true),
}),
_ => Ok(TagKnown {
kind_available: Some(false),
}),
})
.into()
}
}
impl<'ctx, I, M, E> Hint<'ctx, ValueProto<BorrowedStaticHrt<I::T>, E>>
for StructWalker<'ctx, I, StaticType, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = StaticType>,
I::T: 'static,
{
#[inline(always)]
fn hint<'a>(&'a mut self, visitor: DynVisitor<'a, 'ctx>, _hint: ()) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(
// visit_value::<_, E>(visitor, BorrowedStatic(self.value)),
// |status| match status {
// VisitResult::Skipped(_) => Flow::Continue,
// VisitResult::Control(flow) => flow,
// },
// )
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a (),
) -> ObjSafe<'a, Result<ValueKnown<'a, BorrowedStatic<'ctx, I::T>>, ()>, E> {
E::ready(Ok(ValueKnown { preview: None })).into()
}
}
impl<'ctx, I, S, M, E> Hint<'ctx, SequenceProto<E>> for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn hint<'a>(
&'a mut self,
visitor: DynVisitor<'a, 'ctx>,
_hint: <SequenceProto<E> as HintMeta>::Hint,
) -> ObjSafe<'a, Flow, E> {
todo!()
// E::map(visit_sequence::<E>(visitor, self), |status| match status {
// VisitResult::Skipped(_) => Flow::Continue,
// VisitResult::Control(flow) => flow,
// })
}
#[inline(always)]
fn known<'a>(
&'a mut self,
_hint: &'a <SequenceProto<E> as HintMeta>::Hint,
) -> ObjSafe<'a, Result<MetaKnown<'a, 'ctx, SequenceProto<E>>, ()>, E> {
let len = I::FIELDS.len();
E::ready(Ok(SequenceKnown {
len: (len, Some(len)),
}))
.into()
}
}
impl<'ctx, I, S, M, E> SequenceScope<'ctx, E> for StructWalker<'ctx, I, S, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = S>,
{
#[inline(always)]
fn size_hint(&mut self) -> ObjSafe<'_, (usize, Option<usize>), E> {
let len = I::FIELDS.len();
E::ready((len, Some(len))).into()
}
#[inline(always)]
fn next<'a>(&'a mut self, visitor: DynVisitor<'a, 'ctx>) -> ObjSafe<'a, Flow, E> {
if self.index >= I::FIELDS.len() {
return E::ready(Flow::Done).into();
}
let index = self.index;
self.index += 1;
I::walk_field::<E>(index, self.value, visitor)
.map(|result| match result {
Ok(flow) => flow,
Err(err) => {
// Record the error and signal a break.
self.error = Some(StructWalkErrorKind::Field(err));
Flow::Err
}
})
.into()
// E::map(
// I::walk_field::<E>(index, self.value, visitor),
// |result| match result {
// Ok(flow) => flow,
// Err(err) => {
// // Record the error and signal a break.
// self.error = Some(StructWalkErrorKind::Field(err));
// Flow::Err
// }
// },
// )
}
}
impl<'ctx, I, M, E> RecoverableScope<'ctx, E> for StructWalker<'ctx, I, StaticType, M, E>
where
E: Effect,
I: StructTypeInfo<'ctx, M, S = StaticType>,
I::T: 'static,
{
#[inline(always)]
fn new_walk<'a: 'c, 'b: 'c, 'c>(
&'a mut self,
mut visitor: DynVisitor<'b, 'ctx>,
) -> ObjSafe<'c, Status, E> {
// Reset the errors to default state.
self.error = None;
// Reset the field index to the default.
self.index = 0;
E::with(
(self, visitor),
#[inline(always)]
|(this, visitor), _| {
(
visit_sequence::<E>(visitor.cast(), *this)
.map(|result| {
match result {
VisitResult::Control(Flow::Continue) | VisitResult::Skipped(_) => {}
VisitResult::Control(Flow::Done) => return Ok(()),
VisitResult::Control(Flow::Err) => return Err(()),
}
Ok(())
})
.into(),
PhantomData,
)
},
)
.into()
// E::wrap(async move {
// // // We should check if the visitor wants something specific.
// // match visit_request_hint::<E>(visitor.cast(), DynWalker(self)).await {
// // VisitResult::Skipped(_) | VisitResult::Control(Flow::Continue) => {}
// // VisitResult::Control(Flow::Done) => return Ok(()),
// // VisitResult::Control(Flow::Err) => return Err(()),
// // }
// //
// // // Attempt to visit the value directly.
// // match visit_value::<_, E>(visitor.cast(), BorrowedStatic(self.value)).await {
// // VisitResult::Skipped(_) | VisitResult::Control(Flow::Continue) => {}
// // VisitResult::Control(Flow::Done) => return Ok(()),
// // VisitResult::Control(Flow::Err) => return Err(()),
// // }
// //
// // // Follow the standard set of protocols for a struct.
// // // - Tagged: type ID
// // // - Tagged: struct
// // // - Tagged: struct name
// // // - Tagged: struct field names
// // // - Sequence: the fields
// //
// // match visit_tag::<TagConst<{ TAG_TYPE_ID.to_int() }>, E, _>(
// // TagConst,
// // visitor.cast(),
// // ValueWalker::new(TypeId::of::<I::T>()),
// // )
// // .await
// // {
// // Err(err) => {
// // self.error = Some(StructWalkErrorKind::Tag(err));
// // return Err(());
// // }
// // Ok(VisitResult::Skipped(_)) | Ok(VisitResult::Control(Flow::Continue)) => {}
// // Ok(VisitResult::Control(Flow::Done)) => return Ok(()),
// // Ok(VisitResult::Control(Flow::Err)) => return Err(()),
// // }
// //
// // match visit_tag::<TagConst<{ TAG_STRUCT.to_int() }>, E, _>(
// // TagConst,
// // visitor.cast(),
// // NoopWalker::new(),
// // )
// // .await
// // {
// // Ok(VisitResult::Skipped(_)) => {
// // match visit_tag::<TagConst<{ TAG_MAP.to_int() }>, E, _>(
// // TagConst,
// // visitor.cast(),
// // NoopWalker::new(),
// // )
// // .await
// // {
// // Err(err) => {
// // self.error = Some(StructWalkErrorKind::Tag(err));
// // return Err(());
// // }
// // Ok(VisitResult::Skipped(_)) | Ok(VisitResult::Control(Flow::Continue)) => {}
// // Ok(VisitResult::Control(Flow::Done)) => return Ok(()),
// // Ok(VisitResult::Control(Flow::Err)) => return Err(()),
// // }
// // }
// // Err(err) => {
// // self.error = Some(StructWalkErrorKind::Tag(err));
// // return Err(());
// // }
// // Ok(VisitResult::Control(Flow::Continue)) => {}
// // Ok(VisitResult::Control(Flow::Done)) => return Ok(()),
// // Ok(VisitResult::Control(Flow::Err)) => return Err(()),
// // }
// //
// // match visit_tag::<TagConst<{ TAG_TYPE_NAME.to_int() }>, E, _>(
// // TagConst,
// // visitor.cast(),
// // ValueWalker::new(I::NAME),
// // )
// // .await
// // {
// // Err(err) => {
// // self.error = Some(StructWalkErrorKind::Tag(err));
// // return Err(());
// // }
// // Ok(VisitResult::Skipped(_)) | Ok(VisitResult::Control(Flow::Continue)) => {}
// // Ok(VisitResult::Control(Flow::Done)) => return Ok(()),
// // Ok(VisitResult::Control(Flow::Err)) => return Err(()),
// // }
// //
// // match visit_tag::<TagConst<{ TAG_FIELD_NAMES.to_int() }>, E, _>(
// // TagConst,
// // visitor.cast(),
// // StaticSliceWalker::<_, ValueWalker<&'static str>>::new(I::FIELDS),
// // )
// // .await
// // {
// // Err(err) => {
// // self.error = Some(StructWalkErrorKind::FieldTag(err));
// // return Err(());
// // }
// // Ok(VisitResult::Skipped(_)) | Ok(VisitResult::Control(Flow::Continue)) => {}
// // Ok(VisitResult::Control(Flow::Done)) => return Ok(()),
// // Ok(VisitResult::Control(Flow::Err)) => return Err(()),
// // }
//
// match visit_sequence::<E>(visitor, self).await {
// VisitResult::Control(Flow::Continue) | VisitResult::Skipped(_) => {}
// VisitResult::Control(Flow::Done) => return Ok(()),
// VisitResult::Control(Flow::Err) => return Err(()),
// }
//
// Ok(())
// })
}
}