You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Everything is non_exhaustive and public// (not sure how to handle private fields...)/// Result of `typeinfo!`structType{name:&'static str,// result of `type_name`inner:TypeInner,layout:Layout,generics:&'static[Generic],lifetimes:&'static[Lifetime],}implType{/// Defer to `StructTy::field`, panic if not a structconstfnfield(name:&'static str) -> &'static StructField;/// Defer to `EnumTy::variant`, panic if not an enumconstfnvariant(name:&'static str) -> &'static EnumVariant;}enumTypeInner{Struct(StructTy),Enum(EnumTy), ...}structStructTy{fields:&'static[Field]}structEnumTy{variants:&'static[EnumVariant]}structEnumVariant{fields:&'static[Field],discriminant:Discriminant,value:Option<isize>// Value of C-style enums}structField{type:Type,// Field typename:Option<&'static str>,// Field name if a named structfield_index:usize,// Field count within the struct as definedoffset:usize,// offset in implementation}implField{// Helpers to get or set a field on the parent struct// Not sure what this would do for enumsconstfngetter(&self) -> (fn(&ParentTy) -> SelfTy);constfnsetter(&self) -> fn(&mutParentTy,SelfTy);}structGeneric{ty:Type,default:Option<Type>}implStructTy{// similar for EnumTy with Variant/// Get a field by name at compile time, compile_error if it doesn't existconstfnfield(name:&'static str) -> &'static Field;}// ...
Sep 9th - Can't have const fn in trait, maybe use associated constants in traits
per fee1-dead