MCPcopy Create free account
hub / github.com/MegEngine/MegFlow / fields

Function fields

flow-derive/src/utils.rs:24–33  ·  view source on GitHub ↗
(data: &syn::Data)

Source from the content-addressed store, hash-verified

22}
23
24pub fn fields(data: &syn::Data) -> syn::punctuated::Iter<syn::Field> {
25 match data {
26 syn::Data::Struct(ref item) => match item.fields {
27 syn::Fields::Named(ref fields) => fields.named.iter(),
28 syn::Fields::Unnamed(ref fields) => fields.unnamed.iter(),
29 _ => unreachable!(),
30 },
31 _ => unreachable!(),
32 }
33}
34
35pub fn attr<'a>(attrs: &'a [syn::Attribute], name: &str) -> Option<&'a syn::Attribute> {
36 attrs.iter().find(|attr| {

Callers 2

extract_portsFunction · 0.85
parser_expandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected