/// A struct declaration in an FFI module that is not opaque. #[derive(Clone, PartialEq, Eq, Hash, Serialize, Debug)] #[non_exhaustive] pubstructStruct { pub name: Ident, pub docs: Docs, pub lifetimes: LifetimeEnv, pub fields: Vec<(Ident, TypeName, Docs, Attrs)>, pub methods: Vec<Method>, pub output_only: bool, pub attrs: Attrs,
}
implStruct { /// Extract a [`Struct`] metadata value from an AST node. pubfn new(strct: &syn::ItemStruct, output_only: bool, parent_attrs: &Attrs) -> Self { let self_path_type = PathType::extract_self_type(strct); let fields: Vec<_> = strct
.fields
.iter()
.map(|field| { use quote::ToTokens; // Non-opaque tuple structs will never be allowed let name = field.ident.as_ref().map(Into::into).unwrap_or_else(|| {
panic!( "non-opaque tuples structs are disallowed ({:?})",
field.ty.to_token_stream().to_string()
)
}); let type_name = TypeName::from_syn(&field.ty, Some(self_path_type.clone())); let docs = Docs::from_attrs(&field.attrs);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.