pub struct MethodInfo {
pub struct_type: Type,
pub has_self: bool,
pub receiver: ReceiverMode,
pub params: ParamRange,
pub return_type: Type,
pub body: InstRef,
pub span: Span,
pub is_unchecked: bool,
pub is_generic: bool,
pub return_type_sym: Spur,
pub is_pub: bool,
pub file_id: FileId,
}Expand description
Information about a method in an impl block.
Note: Captured comptime values for anonymous struct methods are stored at the
struct level in Sema::anon_struct_captured_values, not per-method. This ensures
that different instantiations with different captured values create different types.
Fields§
§struct_type: TypeThe struct type this method belongs to
has_self: boolWhether this is a method (has self) or associated function (no self)
receiver: ReceiverModeReceiver mode (self, inout self, borrow self). Meaningful only
when has_self is true; ByValue is used as a placeholder for
associated functions (ADR-0060).
params: ParamRangeParameter data (names, types, modes, comptime flags) stored in arena.
Access via arena.names(params), arena.types(params), etc.
Note: This excludes self if present - only explicit parameters.
return_type: TypeReturn type
body: InstRefThe RIR instruction ref for the method body
span: SpanSpan of the method declaration
is_unchecked: boolWhether this method is marked unchecked (can only be called from checked blocks)
is_generic: boolTrue if this method has its own comptime type parameters (e.g.,
fn apply(self, comptime F: type, f: F) -> T). Such methods are
generic at the method level (independent of the enclosing function’s
comptime params) and their bodies are only analyzed at specialization.
return_type_sym: SpurReturn-type symbol as written in source. Preserved (as well as the
resolved return_type above) so that generic-method specialization
can substitute method-level comptime type params in the return type.
is_pub: boolADR-0073: whether this method is pub. Cross-module callers need
is_pub to be true; intra-module callers always succeed.
file_id: FileIdADR-0073: file the method was declared in (for visibility checks).
Trait Implementations§
Source§impl Clone for MethodInfo
impl Clone for MethodInfo
Source§fn clone(&self) -> MethodInfo
fn clone(&self) -> MethodInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MethodInfo
impl Debug for MethodInfo
impl Copy for MethodInfo
Auto Trait Implementations§
impl Freeze for MethodInfo
impl RefUnwindSafe for MethodInfo
impl Send for MethodInfo
impl Sync for MethodInfo
impl Unpin for MethodInfo
impl UnsafeUnpin for MethodInfo
impl UnwindSafe for MethodInfo
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].