component_model 0.17.0

Revolutionary type-safe component assignment for Rust. Build complex objects with zero boilerplate using derive macros and type-driven field setting. Perfect for configuration builders, fluent APIs, and object composition patterns.
Documentation
use super :: *;

#[ derive( Debug, Default, PartialEq ) ]
struct TupleStruct(i32, String);

// Manual implementation for the first field (i32)
impl From< &TupleStruct > for i32 
{
  #[ inline( always ) ]
  fn from( src: &TupleStruct ) -> Self 
  {
  src.0 // Access field by index
 }
}

// Manual implementation for the second field (String)
impl From< &TupleStruct > for String 
{
  #[ inline( always ) ]
  fn from( src: &TupleStruct ) -> Self 
  {
  src.1.clone() // Access field by index
 }
}

//

// Reuse the same test logic
include!("./only_test/component_from_tuple.rs");