Skip to main content

WithData

Trait WithData 

Source
pub trait WithData<T>: Sized {
    type WithDataType;

    // Required method
    fn with_data(self, data: T) -> Self::WithDataType;

    // Provided method
    fn with_default_data(self) -> Self::WithDataType
       where T: Default { ... }
}
Expand description

Add user data to an AST node

Required Associated Types§

Source

type WithDataType

The type with user data attached

Required Methods§

Source

fn with_data(self, data: T) -> Self::WithDataType

Add user data to this AST node

Provided Methods§

Source

fn with_default_data(self) -> Self::WithDataType
where T: Default,

Add default user data to this AST node

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§