Diffstat (limited to 'src/protocol/visitor/value.rs')
-rw-r--r--src/protocol/visitor/value.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/protocol/visitor/value.rs b/src/protocol/visitor/value.rs
index 08f06d4..419964b 100644
--- a/src/protocol/visitor/value.rs
+++ b/src/protocol/visitor/value.rs
@@ -3,7 +3,7 @@
//! In some sense, this is the most basic protocol.
use crate::{
- any::{MaybeSized, TypeName},
+ any::{TypeName, WithContextLt},
bijective_higher_ranked_type,
effect::{Effect, Future},
higher_ranked_type,
@@ -17,7 +17,7 @@ use super::{recoverable::Recoverable, Status};
/// Trait object for the [`Value`] protocol.
///
/// Types implementing the [`Value`] protocol will implement this trait.
-pub trait Value<'ctx, T: MaybeSized::Trait<'ctx>, E: Effect<'ctx>> {
+pub trait Value<'ctx, T: WithContextLt::MemberType<'ctx>, E: Effect<'ctx>> {
/// Visit a value of type `T`.
///
/// Use this to give a value to a visitor. Its expected that a walker
@@ -27,16 +27,16 @@ pub trait Value<'ctx, T: MaybeSized::Trait<'ctx>, E: Effect<'ctx>> {
/// If a [`ControlFlow::Break`] is returned then the walker
/// should stop walking as soon as possible as there has likely been
/// and error.
- fn visit<'a>(&'a mut self, value: MaybeSized::T<'a, 'ctx, T>) -> Future<'a, 'ctx, Flow, E>;
+ fn visit<'a>(&'a mut self, value: WithContextLt::T<'a, 'ctx, T>) -> Future<'a, 'ctx, Flow, E>;
}
bijective_higher_ranked_type! {
- pub type DynValue['ctx][T, E][]: MaybeSized['ctx][]
+ pub type DynValue['ctx][T, E][]: WithContextLt['ctx][]
for<'a>
(dyn Value<'ctx, T, E> + Send + 'a)
where {
E: Effect<'ctx>,
- T: ?Sized + MaybeSized::Trait<'ctx> + 'ctx
+ T: ?Sized + WithContextLt::MemberType<'ctx> + 'ctx
}
}
@@ -62,15 +62,15 @@ impl<'a, 'ctx: 'a, T, E: Effect<'ctx>> HintMeta<'ctx> for DynValue<'ctx, T, E> {
type Hint = ();
}
-pub fn visit_value<'a, 'ctx, T: MaybeSized::Member<'a, 'ctx> + 'ctx, E: Effect<'ctx>>(
+pub fn visit_value<'a, 'ctx, T: WithContextLt::LowerType<'a, 'ctx> + 'ctx, E: Effect<'ctx>>(
visitor: Visitor<'a, 'ctx>,
value: T,
) -> Future<'a, 'ctx, Status, E>
where
- MaybeSized::HigherRanked<'a, 'ctx, T>: TypeName::Member<'ctx> + Sized,
+ WithContextLt::HigherRanked<'a, 'ctx, T>: TypeName::LowerType<'ctx> + Sized,
{
if let Some(object) =
- visitor.upcast_mut::<DynValue<'ctx, MaybeSized::HigherRanked<'a, 'ctx, T>, E>>()
+ visitor.upcast_mut::<DynValue<'ctx, WithContextLt::HigherRanked<'a, 'ctx, T>, E>>()
{
// Allow the visitor to give a hint if it wants.
E::map(object.visit(value), |flow| match flow {