pub enum PureItem {
Show 13 variants
Use(PureUse),
Fn(PureFn),
Struct(PureStruct),
Enum(PureEnum),
Impl(PureImpl),
Const(PureConst),
Static(PureStatic),
Type(PureTypeAlias),
Mod(PureMod),
Trait(PureTrait),
Macro(PureMacro),
Other(String),
Verbatim(String),
}Expand description
An item in a file or module.
§Future: PureAnyItem
If unified handling across PureItem, PureImplItem, and PureTraitItem
is needed, consider adding a PureAnyItem enum that wraps all item types.
This would be separate from PureItem to maintain context-specific type safety.
Variants§
Use(PureUse)
Use statement.
Fn(PureFn)
Function definition.
Struct(PureStruct)
Struct definition.
Enum(PureEnum)
Enum definition.
Impl(PureImpl)
Impl block.
Const(PureConst)
Const item.
Static(PureStatic)
Static item.
Type(PureTypeAlias)
Type alias.
Mod(PureMod)
Module.
Trait(PureTrait)
Trait definition.
Macro(PureMacro)
Macro invocation.
Other(String)
Other/unsupported item (stored as string, parsed and re-emitted via
syn::parse_str — trivia like // line comments and blank lines is
lost in the round-trip).
Verbatim(String)
Verbatim Rust source bytes that must survive round-trip exactly as
authored. Unlike Other, the contents are never parsed: a
sentinel stub is emitted into the syn::File so prettyplease can lay
out neighbouring items, and PureFile::to_source splices the raw
bytes back over the stub afterwards. This is the structural escape
hatch for the β path (RyoLang subset + ReplaceCode) and is the only
way to preserve DSL macro spacing, // comments, blank lines, and
other lexer-stripped trivia through ryo’s codegen pipeline.