Skip to main content

PureItem

Enum PureItem 

Source
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.

Trait Implementations§

Source§

impl Clone for PureItem

Source§

fn clone(&self) -> PureItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PureItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PureItem

Source§

impl From<&PureItem> for ItemKind

Source§

fn from(item: &PureItem) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PureItem

Source§

fn eq(&self, other: &PureItem) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PureItem

Source§

impl ToSyn for PureItem

Source§

type Output = Item

syn output type produced from self.
Source§

fn to_syn(&self) -> Result<Item, ToSynError>

Convert self back into its syn representation.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.