Module macro_tools::phantom

source ·
Expand description

Responsible for generating marker PhantomData fields to avoid the rule requiring the usage of all generic parameters in a struct. This is often necessary to ensure that Rust’s type system correctly tracks the ownership and lifetimes of these parameters without needing them to be explicitly used in the struct’s fields.

Functions and structures to handle and manipulate PhantomData fields in structs using the syn crate. These utilities ensure that generic parameters are correctly accounted for in type checking, even if they are not directly used in the struct’s fields.

Re-exports§

  • pub use super::exposed::*;

Functions§

  • Adds a PhantomData field to a struct to manage generic parameter usage.
  • Constructs a PhantomData type tuple from the generic parameters of a struct.