use crate::{any::static_wrapper::OwnedStatic, protocol::visitor::Value};
use core::{mem::MaybeUninit, ops::ControlFlow};
use crate::{
any_trait,
effect::{Effect, SyncEffect, Yield},
protocol::{
visitor::{RequestHint, Sequence, SequenceScope, Status},
walker::{Hint, HintMeta},
Visitor,
},
};
impl<'ctx> crate::Walk<'ctx> for bool {
type Walker = Walker;
}
pub struct Walker(bool);
impl<'ctx> From<bool> for Walker {
fn from(value: bool) -> Self {
Self(value)
}
}
impl<'ctx> crate::Walker<'ctx> for Walker {
type Effect = SyncEffect;
type Error = ();
type Output = ();
#[inline]
fn walk<'a>(
self,
visitor: Visitor<'a, 'ctx, SyncEffect>,
) -> Yield<'a, 'ctx, Result<Self::Output, Self::Error>, Self::Effect>
where
'ctx: 'a,
{
{
if let Some(object) =
visitor.upcast_mut::<dyn Value<'_, '_, OwnedStatic<bool>, SyncEffect> + '_>()
{
object.visit(OwnedStatic(self.0));
}
Ok(())
}
}
}