-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
116 additions
and
201 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
module/core/former/tests/inc/former_tests/subformer_container_implicit.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![ allow( dead_code ) ] | ||
|
||
use super::*; | ||
|
||
/// Parameter description. | ||
#[ derive( Debug, Default, PartialEq, the_module::Former ) ] | ||
pub struct Child | ||
{ | ||
name : String, | ||
is_mandatory : bool, | ||
} | ||
|
||
/// Parent required for the template. | ||
#[ derive( Debug, Default, PartialEq, the_module::Former ) ] | ||
// #[ derive( Debug, Default, PartialEq, the_module::Former ) ] #[ debug ] | ||
// #[ derive( Debug, Default, PartialEq ) ] | ||
pub struct Parent | ||
{ | ||
#[ container ] | ||
// #[ setter( false ) ] | ||
children : Vec< Child >, | ||
} | ||
|
||
// == begin of generated | ||
|
||
// == end of generated | ||
|
||
include!( "./only_test/subformer_container.rs" ); |
195 changes: 0 additions & 195 deletions
195
module/core/former/tests/inc/former_tests/subformer_implicit_container_manual.rs
This file was deleted.
Oops, something went wrong.
File renamed without changes.
80 changes: 80 additions & 0 deletions
80
module/core/former/tests/inc/former_tests/subformer_subform_named_manual.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#![ allow( dead_code ) ] | ||
|
||
use super::*; | ||
|
||
/// Parameter description. | ||
#[ derive( Debug, Default, PartialEq, the_module::Former ) ] | ||
pub struct Child | ||
{ | ||
name : String, | ||
is_mandatory : bool, | ||
} | ||
|
||
// impl< Context, Formed, End > former::EntityToDefinition< Context, Formed, End > | ||
// for Child | ||
// where | ||
// End : former::FormingEnd< ChildFormerDefinitionTypes< Context, Formed > >, | ||
// { | ||
// type Definition = ChildFormerDefinition< Context, Formed, End >; | ||
// } | ||
|
||
/// Parent required for the template. | ||
#[ derive( Debug, Default, PartialEq, the_module::Former ) ] | ||
// #[ derive( Debug, Default, PartialEq, the_module::Former ) ] #[ debug ] | ||
// #[ derive( Debug, Default, PartialEq ) ] | ||
pub struct Parent | ||
{ | ||
#[ subform ] | ||
// #[ setter( false ) ] | ||
children : Vec< Child >, | ||
} | ||
|
||
// == begin of custom | ||
|
||
impl< Definition > ParentFormer< Definition > | ||
where | ||
Definition : former::FormerDefinition, | ||
Definition::Types : former::FormerDefinitionTypes< Storage = < Parent as former::EntityToStorage >::Storage >, | ||
{ | ||
|
||
#[ inline( always ) ] | ||
pub fn child( self, name : &str ) -> | ||
ChildAsSubformer< Self, impl ChildAsSubformerEnd< Self > > | ||
{ | ||
self._children_add_subformer | ||
::< ChildFormer< _ >, _, >() | ||
.name( name ) | ||
} | ||
|
||
// #[ inline( always ) ] | ||
// pub fn _child( self ) -> | ||
// ChildAsSubformer< Self, impl ChildAsSubformerEnd< Self > > | ||
// { | ||
// self._children_add_subformer | ||
// ::< < Child as former::EntityToFormer< _ > >::Former, _, >() | ||
// } | ||
|
||
#[ inline( always ) ] | ||
pub fn _child( self ) -> | ||
< < Vec< Child > as former::ContainerAdd >::Element as former::EntityToFormer | ||
< | ||
// ChildFormerDefinition< Self, Self, ParentFormerAddChildrenEnd< Definition > >, | ||
< | ||
< Vec< Child > as former::ContainerAdd >::Element as former::EntityToDefinition< Self, Self, ParentFormerAddChildrenEnd< Definition > > | ||
>::Definition, | ||
> | ||
>::Former | ||
{ | ||
self._children_add_subformer | ||
::< < < Vec< Child > as former::ContainerAdd >::Element as former::EntityToFormer< _ > >::Former, _, >() | ||
} | ||
|
||
} | ||
|
||
// == end of custom | ||
|
||
// == begin of generated for Parent in context of attribute subform | ||
|
||
// == end of generated for Parent in context of attribute subform | ||
|
||
include!( "./only_test/subformer_subform.rs" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters