pub struct CompiledAnnotation {
pub name: String,
pub param_names: Vec<String>,
pub before_handler: Option<u16>,
pub after_handler: Option<u16>,
pub on_define_handler: Option<u16>,
pub metadata_handler: Option<u16>,
pub comptime_pre_handler: Option<AnnotationHandler>,
pub comptime_post_handler: Option<AnnotationHandler>,
pub allowed_targets: Vec<AnnotationTargetKind>,
}Expand description
A compiled annotation definition.
Stores the annotation’s parameter names and the function IDs for each lifecycle handler (before, after, on_define, metadata). The comptime handler is stored as AST (not compiled to bytecode) since it executes at compile time when the annotation is applied.
Fields§
§name: String§param_names: Vec<String>§before_handler: Option<u16>Function ID for before(args, ctx) handler (if defined)
after_handler: Option<u16>Function ID for after(args, result, ctx) handler (if defined)
on_define_handler: Option<u16>Function ID for on_define(target, ctx) handler (if defined)
metadata_handler: Option<u16>Function ID for metadata(target, ctx) handler (if defined)
comptime_pre_handler: Option<AnnotationHandler>AST for comptime pre(target, ctx) { ... } (executed before function inference/compilation)
comptime_post_handler: Option<AnnotationHandler>AST for comptime post(target, ctx) { ... } (executed after function inference/compilation)
allowed_targets: Vec<AnnotationTargetKind>Allowed target kinds for this annotation. Inferred from handler types: before/after → Function only; metadata/comptime only → any target. Empty means no restriction (any target allowed).
Trait Implementations§
Source§impl Clone for CompiledAnnotation
impl Clone for CompiledAnnotation
Source§fn clone(&self) -> CompiledAnnotation
fn clone(&self) -> CompiledAnnotation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompiledAnnotation
impl Debug for CompiledAnnotation
Source§impl<'de> Deserialize<'de> for CompiledAnnotation
impl<'de> Deserialize<'de> for CompiledAnnotation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CompiledAnnotation
impl RefUnwindSafe for CompiledAnnotation
impl Send for CompiledAnnotation
impl Sync for CompiledAnnotation
impl Unpin for CompiledAnnotation
impl UnsafeUnpin for CompiledAnnotation
impl UnwindSafe for CompiledAnnotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more