fn struct_body_meta(
    item: &Item,
    enum_item: Option<&Item>,
    storage: &Storage,
    source: &Source,
    st: ast::Braced<ast::Field, T![,]>,
) -> Result<CompileMetaKind, QueryError> {
    let type_hash = Hash::type_hash(item);

    let mut fields = HashSet::new();

    for (ast::Field { name, .. }, _) in st {
        let name = name.resolve(storage, &*source)?;
        fields.insert(name.into());
    }

    let object = CompileMetaStruct { fields };

    Ok(match enum_item {
        Some(enum_item) => CompileMetaKind::StructVariant {
            type_hash,
            enum_item: enum_item.clone(),
            object,
        },
        None => CompileMetaKind::Struct { type_hash, object },
    })
}
/// Construct metadata for a struct body.
Construct metadata for a struct body.
Construct metadata for a struct body .
fn struct_body_meta(
    item: &Item,
    enum_item: Option<&Item>,
    storage: &Storage,
    source: &Source,
    st: ast::Braced<ast::Field, T![,]>,
) -> Result<CompileMetaKind, QueryError> {
    let type_hash = Hash::type_hash(item);
    let mut fields = HashSet::new();
    for (ast::Field { name, .. }, _) in st {
        let name = name.resolve(storage, &*source)?;
        fields.insert(name.into());
    }
    let object = CompileMetaStruct { fields };
    Ok(match enum_item {
        Some(enum_item) => CompileMetaKind::StructVariant {
            type_hash,
            enum_item: enum_item.clone(),
            object,
        },
        None => CompileMetaKind::Struct { type_hash, object },
    })
}
fn struct_body_meta ( item : & Item , enum_item : Option < & Item > , storage : & Storage , source : & Source , st : ast :: Braced < ast :: Field , T ! [ ] > , ) -> Result < CompileMetaKind , QueryError > { let type_hash = Hash :: type_hash ( item ) ; let mut fields = HashSet :: new ( ) ; for ( ast :: Field { name , .. } , _ ) in st { let name = name . resolve ( storage , & * source ) ? ; fields . insert ( name . into ( ) ) ; } let object = CompileMetaStruct { fields } ; Ok ( match enum_item { Some ( enum_item ) => CompileMetaKind :: StructVariant { type_hash , enum_item : enum_item . clone ( ) , object , } , None => CompileMetaKind :: Struct { type_hash , object } , } ) }
Construct metadata for a struct body.
Construct metadata for a struct body .
item
&Item
enum_item
Option<&Item>
storage
&Storage
source
&Source
st
ast::Braced<ast::Field, T![,]>
item
&Item
enum_item
Option<&Item>
storage
&Storage
source
&Source
st
ast::Braced<ast::Field, T![,]>