Diffstat (limited to 'tests/builder_struct.rs')
-rw-r--r--tests/builder_struct.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/builder_struct.rs b/tests/builder_struct.rs
index 8aca415..c0cb843 100644
--- a/tests/builder_struct.rs
+++ b/tests/builder_struct.rs
@@ -1,7 +1,7 @@
use treaty::{
any::{OwnedStatic, TempBorrowedStatic},
builders::{self, core::r#struct::StructBuilder},
- effect::{Blocking, Effect, ObjSafe},
+ effect::{ErasedEffective, Effect, Effective},
protocol::{
visitor::{tags, visit_sequence, visit_tag, visit_value, TagConst, VisitResult},
DynVisitor,
@@ -45,7 +45,7 @@ impl<'ctx, M> walkers::core::r#struct::StructTypeInfo<'ctx, M> for Info {
index: usize,
value: &'ctx Self::T,
visitor: DynVisitor<'a, 'ctx>,
- ) -> ObjSafe<'a, Result<Flow, Self::FieldError>, E> {
+ ) -> ErasedEffective<'a, Result<Flow, Self::FieldError>, E> {
todo!()
// E::wrap(async move {
// match index {
@@ -108,7 +108,7 @@ impl<'ctx, M, E: Effect> builders::core::r#struct::StructTypeInfo<'ctx, M, E> fo
type Error = ();
#[inline(always)]
- fn from_builders<'a>(builders: Self::Builders) -> ObjSafe<'a, Result<Self::T, Self::Error>, E> {
+ fn from_builders<'a>(builders: Self::Builders) -> ErasedEffective<'a, Result<Self::T, Self::Error>, E> {
todo!()
// E::wrap(async {
// Ok(X {
@@ -132,7 +132,7 @@ impl<'ctx, M, E: Effect> builders::core::r#struct::StructTypeInfo<'ctx, M, E> fo
type Seed = ();
#[inline(always)]
- fn new_builders<'a>(_seed: Self::Seed) -> ObjSafe<'a, Self::Builders, E> {
+ fn new_builders<'a>(_seed: Self::Seed) -> ErasedEffective<'a, Self::Builders, E> {
todo!()
// E::wrap(async {
// Fields {
@@ -293,7 +293,7 @@ impl<'ctx, M, E: Effect> builders::core::r#struct::StructTypeInfo<'ctx, M, E> fo
pub mod demo {
use crate::Walk;
use macro_rules_attribute::derive;
- use treaty::{effect::Blocking, transform, Build, DefaultMode};
+ use treaty::{effect::{r#async::Async, blocking::{BlockOn, Blocking, Spin}, Effective as _}, transform, Build, DefaultMode};
#[derive(Walk!, Debug)]
pub struct X {
@@ -309,11 +309,12 @@ pub mod demo {
#[no_mangle]
pub fn ident(x: X) -> Y {
- let other = transform::<<Y as crate::Build<'_, DefaultMode, _>>::Builder, _, Blocking>(
+ let other = transform::<<Y as crate::Build<'_, DefaultMode, _>>::Builder, _, Blocking<Spin>>(
((), ()),
Walk::<DefaultMode, _>::into_walker(&x),
- )
- .0;
+ );
+
+ let other = Spin::block_on(other.into_future());
other.0.unwrap()
}