{"record":{"id":"d045a5452c446be1","repo":"DioxusLabs/dioxus","slug":"only-structs-and-enums-are-supported","errorCode":null,"errorMessage":"Only structs and enums are supported","messagePattern":"Only structs and enums are supported","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"packages/const-serialize-macro/src/lib.rs","lineNumber":230,"sourceCode":"                        const MEMORY_LAYOUT: #krate::Layout = #krate::Layout::Enum(#krate::EnumLayout::new(\n                            ::std::mem::size_of::<Self>(),\n                            #krate::PrimitiveLayout::new(\n                                #discriminant_size as usize,\n                            ),\n                            {\n                                const DATA: &'static [#krate::EnumVariant] = &[\n                                    #(\n                                        #variants,\n                                    )*\n                                ];\n                                DATA\n                            },\n                        ));\n                    }\n                }.into()\n            }\n        },\n        _ => syn::Error::new(input.ident.span(), \"Only structs and enums are supported\")\n            .to_compile_error()\n            .into(),\n    }\n}\n","sourceCodeStart":212,"sourceCodeEnd":235,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/const-serialize-macro/src/lib.rs#L212-L235","documentation":"Catch-all rejection in derive_parse for the SerializeConst derive: the annotated item is neither a struct nor an enum (i.e. a union). The derive input at fault is the union declaration; only structs and enums get a SerializeConst impl.","triggerScenarios":"Thrown at packages/const-serialize-macro/src/lib.rs:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Derive the const-serialize trait only on structs and enums, not on this item kind."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}