pub struct MethodDef {Show 19 fields
pub name: Arc<str>,
pub fqcn: Arc<str>,
pub params: Arc<[FnParam]>,
pub return_type: Option<Arc<Type>>,
pub inferred_return_type: Option<Arc<Type>>,
pub visibility: Visibility,
pub is_static: bool,
pub is_abstract: bool,
pub is_final: bool,
pub is_constructor: bool,
pub template_params: Vec<TemplateParam>,
pub assertions: Vec<Assertion>,
pub throws: Vec<Arc<str>>,
pub deprecated: Option<Arc<str>>,
pub is_internal: bool,
pub is_pure: bool,
pub location: Option<Location>,
pub docstring: Option<Arc<str>>,
pub is_virtual: bool,
}Fields§
§name: Arc<str>§fqcn: Arc<str>§params: Arc<[FnParam]>§return_type: Option<Arc<Type>>Type from annotation (@return / native type hint). None means unannotated.
Stored as Option<Arc<Type>> to enable deduplication of common return types
(e.g., void, string, mixed, bool) across thousands of methods.
inferred_return_type: Option<Arc<Type>>Type inferred from body analysis. Stored as Option<Arc<Type>> (8 B) rather
than inline Option<Type> (176 B, no niche) — inference is now demand-driven
via salsa (inferred_*_return_type_demand), so this field is a rarely/never
populated fallback; shrinking it saves ~168 B on every MethodDef.
visibility: Visibility§is_static: bool§is_abstract: bool§is_final: bool§is_constructor: bool§template_params: Vec<TemplateParam>§assertions: Vec<Assertion>§throws: Vec<Arc<str>>§deprecated: Option<Arc<str>>§is_internal: bool§is_pure: bool§location: Option<Location>§docstring: Option<Arc<str>>Plain-text description from the docblock (text before @tag lines).
Used for hover info.
is_virtual: boolTrue for methods added via @method docblock annotations. Virtual
methods must not be required as concrete interface implementations.
Implementations§
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
impl StructuralPartialEq for MethodDef
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