((port_func, ident, ty): IterArgs)
| 47 | let ident = input.ident; |
| 48 | type IterArgs<'a> = ExtractParams<'a>; |
| 49 | fn set_f((port_func, ident, ty): IterArgs) -> TokenStream { |
| 50 | if match_last_ty(ty, "Vec") { |
| 51 | quote_spanned! {ident.span()=> |
| 52 | if port_name == concat!('[', stringify!(#ident), ']') { |
| 53 | self.#ident.push(channel.#port_func()); |
| 54 | } else |
| 55 | } |
| 56 | } else if match_last_ty(ty, "HashMap") { |
| 57 | quote_spanned! {ident.span()=> |
| 58 | if port_name == concat!('{', stringify!(#ident), '}') { |
| 59 | self.#ident.insert(tag.expect("dict port need a tag"), channel.#port_func()); |
| 60 | } else |
| 61 | } |
| 62 | } else if match_last_ty(ty, "DynPorts") { |
| 63 | quote! {} |
| 64 | } else { |
| 65 | quote_spanned! {ident.span()=> |
| 66 | if port_name == stringify!(#ident) { |
| 67 | self.#ident = channel.#port_func(); |
| 68 | } else |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | fn set_dyn_f((_, ident, ty): IterArgs) -> TokenStream { |
| 73 | if match_last_ty(ty, "DynPorts") { |
| 74 | quote_spanned! {ident.span()=> |
nothing calls this directly
no test coverage detected