Skip to content

Commit

Permalink
former : experimenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Wandalen committed Apr 30, 2024
1 parent 79626ca commit 64d672b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion module/core/former/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ where
Definition : FormerDefinition,
{
type Former;
fn f1( _ : &Definition ) {}
fn __f( _ : &Definition ) {}
}

// zzz : improve documentation
Expand Down
15 changes: 9 additions & 6 deletions module/core/former/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ for Vec< E >

#[ derive( Debug, Default ) ]
pub struct VectorDefinition< E, Context = (), Formed = Vec< E >, End = ReturnStorage >
// where
// End : FormingEnd< VectorDefinition< E, Context, Formed, NoEnd > >,
where
End : FormingEnd< VectorDefinition< E, Context, Formed, NoEnd > >,
{
_phantom : core::marker::PhantomData< ( E, Context, Formed, End ) >,
}
Expand Down Expand Up @@ -104,12 +104,15 @@ where

// = Entity To

// xxx : implement for hashset / hashmap
// xxx : cover by tests
// zzz : qqq : implement for hashset / hashmap
// zzz : qqq : cover by tests
// zzz : qqq : rid off bound `Fn( Vec< E >, Option< Definition::Context > ) -> Definition::Formed``
impl< E, Definition > EntityToFormer< Definition > for Vec< E >
where
Definition : FormerDefinition< Storage = Vec< E >, Formed = () >,
< Definition as definition::FormerDefinition>::End : Fn( Vec< E >, Option< Definition::Context > ),
Definition : FormerDefinition< Storage = Vec< E > >,
Definition::Types : FormerDefinitionTypes< Storage = Vec< E >, Formed = Definition::Formed, Context = Definition::Context >,
Definition::End : crate::FormingEnd< Definition::Types >,
Definition::End : Fn( Vec< E >, Option< Definition::Context > ) -> Definition::Formed,
{
type Former = VectorSubformer< E, Definition::Context, Definition::Formed, Definition::End >;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ fn replace()
fn entity_to()
{

// let got = < Vec< i32 > as former::EntityToFormer< former::VectorDefinition< (), Vec< i32 >, former::ReturnPreformed > > >::Former::new_precise( former::ReturnPreformed )
// qqq : uncomment and make it working
// let got = < Vec< i32 > as former::EntityToFormer< former::VectorDefinition< i32, (), Vec< i32 >, former::ReturnPreformed > > >
// ::Former::new_precise( former::ReturnPreformed )
// .add( 13 )
// .form();
// let exp = vec![ 13 ];
// a_id!( got, exp );

// qqq : uncomment and make it working
// let got = < Vec< i32 > as former::EntityToStorage >::Storage::default();
// let exp =
// <
Expand Down

0 comments on commit 64d672b

Please sign in to comment.