pub struct MethodDef {
pub name: String,
pub span: Span,
pub declaring_module_path: Option<String>,
pub doc_comment: Option<DocComment>,
pub annotations: Vec<Annotation>,
pub type_params: Option<Vec<TypeParam>>,
pub params: Vec<FunctionParameter>,
pub when_clause: Option<Box<Expr>>,
pub return_type: Option<TypeAnnotation>,
pub body: Vec<Statement>,
pub is_async: bool,
}Fields§
§name: StringMethod name
span: Span§declaring_module_path: Option<String>Declaring module path for compiler/runtime provenance checks.
This is injected by the module loader for loaded modules and is not part of user-authored source syntax.
doc_comment: Option<DocComment>§annotations: Vec<Annotation>Annotations applied to this method (e.g., @traced)
type_params: Option<Vec<TypeParam>>Type parameters for generic methods (e.g., method map<U>(...))
params: Vec<FunctionParameter>Method parameters
when_clause: Option<Box<Expr>>Optional when clause for conditional method definitions
return_type: Option<TypeAnnotation>Optional return type annotation
body: Vec<Statement>Method body
is_async: boolWhether this is an async method
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MethodDef
impl<'de> Deserialize<'de> for MethodDef
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MethodDef
impl RefUnwindSafe for MethodDef
impl Send for MethodDef
impl Sync for MethodDef
impl Unpin for MethodDef
impl UnsafeUnpin for MethodDef
impl UnwindSafe for MethodDef
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
Mutably borrows from an owned value. Read more