former 2.45.0

A flexible implementation of the Builder pattern supporting nested builders and collection-specific subformers. Simplify the construction of complex objects.
Documentation
#![allow(clippy::used_underscore_binding, clippy::all, warnings, missing_docs)]
#![deny(missing_docs)]
#![allow(dead_code)]

use super::*;
#[ allow( unused_imports ) ]
use test_tools::a_id;

/// Parameter description.
#[ derive( Debug, Default, PartialEq, the_module::Former ) ]
pub struct Child {
  name: String,
  data: bool,
}

/// Parent required for the template.
#[ derive( Debug, Default, PartialEq, the_module::Former ) ]
pub struct Parent {
  #[ subform_entry( name = _child ) ]
  children: Vec<Child>,
}

impl<Definition> ParentFormer<Definition>
where
  Definition: former::FormerDefinition<Storage = <Parent as former::EntityToStorage>::Storage>,
  // Definition::Types : former::FormerDefinitionTypes< Storage = < Parent as former::EntityToStorage >::Storage >,
{
  #[ inline( always ) ]
  #[ allow( clippy::unused_self ) ]
  pub fn children(self) -> &'static str {
    r"
    Scalar setter `children` should not be generated by default if subform is used.
    It can only be generated if req
    "
  }

  #[ inline( always ) ]
  #[ allow( clippy::used_underscore_items ) ]
  pub fn child(self, name: &str) -> ChildAsSubformer<Self, impl ChildAsSubformerEnd<Self>> {
    self._children_subform_entry::<ChildFormer<_>, _>().name(name)
  }

  // #[ inline( always ) ]
  // pub fn _child( self ) ->
  // ChildAsSubformer< Self, impl ChildAsSubformerEnd< Self > >
  // {
  //   self._children_subform_entry
  //   ::< < Child as former::EntityToFormer< _ > >::Former, _, >()
  // }
}

// == begin of generated

// == end of generated

include!("./only_test/subform_entry_child.rs");