#[entry]
Expand description
Defines an entrypoint for staged code, which will be available as a proc macro.
The entrypoint must be a function that returns impl Quoted<T>
for some type T
.
The first parameter must always be a context, which defines lifetime bounds for
the generated code. This can usually just be a parameter of type BorrowBounds<'_>
,
but can be another borrowed type for domain specific staging.
The rest of the parameters need to be passed in when invoking the macro. These
can be either a RuntimeData<T>
value for arbitrary values or a static value
(any type implementing ParseFromLiteral
) which will be parsed from the literal
argument.
If the staged entrypoint has generic type parameters which are used for a
RuntimeData<T>
parameter, a canonical example for that type parameter must
be provided to ensure that the staged code can be generated. For example,
if taking a type parameter T
which is used for a RuntimeData<T>
parameter,
this attribute can be invoked as #[stageleft::entry(String)]
. The example
types provided to the macro must satisfy any trait bounds on the parameter.