/// Assign only the payload defined by the field in the enu,
Assign only the payload defined by the field in the enu.
Assign only the payload defined by the field in the enu .
pub fn unwrap_url_payload_matching_field(
    structs_tuple: (Option<&Field>, Option<&Field>, Option<&Field>),
) -> TokenStream {
    // Todo this code is ugly, need to find something better
    match structs_tuple {
        (id, query, children) if id.is_some() && query.is_some() && children.is_some() => {
            let sub_enum = &children.clone().expect("Should have extract url item").ty;
            quote! { id : id.expect("Should have extract url item"),query : query.expect("Should have extract url item"),children :  #sub_enum::parse_path(&children.expect("Should have unwrap children route")).expect("Should have parse children Route but failed")}
        }
        (id, query, _) if id.is_some() && query.is_some() => {
            quote! { id : id.expect("Should have extract url item"),query : query.expect("Should have extract url item")}
        }
        (id, query, children) if id.is_none() && query.is_some() && children.is_some() => {
            let sub_enum = &children.clone().expect("Should have extract url item").ty;
            quote! { query : query.expect("Should have extract url item"),children :  #sub_enum::parse_path(&children.expect("Should unwrap children route")).expect("Should have parse children Route")}
        }
        (id, query, children) if id.is_some() && children.is_some() && query.is_none() => {
            let sub_enum = &children.clone().expect("Should have extract url item").ty;
            quote! { id : id.expect("Should have extract url item"),children : #sub_enum::parse_path(&children.expect("Should unwrap children route")).expect("Should have parse children Route")}
        }
        (id, query, children) if id.is_some() && query.is_none() && children.is_none() => {
            quote! { id : id.expect("Should have extract url item")}
        }
        (id, query, children) if query.is_some() && id.is_none() && children.is_none() => {
            quote! { query : query.expect("Should have extract url item")}
        }
        (id, query, children) if query.is_none() && id.is_none() & children.is_some() => {
            let sub_enum = &children.clone().expect("Should have extract url item").ty;
            quote! { children :#sub_enum::parse_path(&children.expect("Should have extract url item").clone()).expect("Should have parse children Route")}
        }
        (_, _, _) => {
            quote! {}
        }
    }
}
pub fn unwrap_url_payload_matching_field ( structs_tuple : ( Option < & Field > , Option < & Field > , Option < & Field > ) , ) -> TokenStream { // Todo this code is ugly, need to find something better match structs_tuple { ( id , query , children ) if id . is_some ( ) && query . is_some ( ) && children . is_some ( ) => { let sub_enum = & children . clone ( ) . expect ( " " ) . ty ; quote ! { id id expect ( " " ) query query expect ( " " ) children sub_enum parse_path ( children expect ( " " ) ) expect ( " " ) } } ( id , query , _ ) if id . is_some ( ) && query . is_some ( ) => { quote ! { id id expect ( " " ) query query expect ( " " ) } } ( id , query , children ) if id . is_none ( ) && query . is_some ( ) && children . is_some ( ) => { let sub_enum = & children . clone ( ) . expect ( " " ) . ty ; quote ! { query query expect ( " " ) children sub_enum parse_path ( children expect ( " " ) ) expect ( " " ) } } ( id , query , children ) if id . is_some ( ) && children . is_some ( ) && query . is_none ( ) => { let sub_enum = & children . clone ( ) . expect ( " " ) . ty ; quote ! { id id expect ( " " ) children sub_enum parse_path ( children expect ( " " ) ) expect ( " " ) } } ( id , query , children ) if id . is_some ( ) && query . is_none ( ) && children . is_none ( ) => { quote ! { id id expect ( " " ) } } ( id , query , children ) if query . is_some ( ) && id . is_none ( ) && children . is_none ( ) => { quote ! { query query expect ( " " ) } } ( id , query , children ) if query . is_none ( ) && id . is_none ( ) & children . is_some ( ) => { let sub_enum = & children . clone ( ) . expect ( " " ) . ty ; quote ! { children sub_enum parse_path ( children expect ( " " ) clone ( ) ) expect ( " " ) } } ( _ , _ , _ ) => { quote ! { } } } }
Assign only the payload defined by the field in the enu,
Assign only the payload defined by the field in the enu
structs_tuple
(Option<&Field>, Option<&Field>, Option<&Field>)