pub struct Function<'ctx> { /* private fields */ }Expand description
A Swift function symbol.
Implementations§
Source§impl<'ctx> Function<'ctx>
impl<'ctx> Function<'ctx>
Sourcepub fn new_static(raw: Node<'ctx>) -> Self
pub fn new_static(raw: Node<'ctx>) -> Self
Create a Function from a raw node, marking it as static.
Sourcepub fn context(&self) -> SymbolContext<'ctx>
pub fn context(&self) -> SymbolContext<'ctx>
Get the context (location) where this function is defined.
Sourcepub fn labels(&self) -> Vec<Option<&'ctx str>>
pub fn labels(&self) -> Vec<Option<&'ctx str>>
Get the argument labels for this function.
Returns a vector where each element is Some(label) for labeled parameters
and None for unlabeled parameters (using _).
Sourcepub fn return_type(&self) -> Option<TypeRef<'ctx>>
pub fn return_type(&self) -> Option<TypeRef<'ctx>>
Get the return type of this function.
Sourcepub fn containing_type(&self) -> Option<&'ctx str>
pub fn containing_type(&self) -> Option<&'ctx str>
Get the containing type name if this is a method.
Sourcepub fn containing_type_is_class(&self) -> bool
pub fn containing_type_is_class(&self) -> bool
Check if the containing type is a class (reference type).
Sourcepub fn containing_type_is_protocol(&self) -> bool
pub fn containing_type_is_protocol(&self) -> bool
Check if the containing type is a protocol.
Trait Implementations§
Source§impl<'ctx> HasExtensionContext<'ctx> for Function<'ctx>
impl<'ctx> HasExtensionContext<'ctx> for Function<'ctx>
Source§fn is_extension(&self) -> bool
fn is_extension(&self) -> bool
Check if this symbol is defined in an extension.
Source§fn extension_module(&self) -> Option<&'ctx str>
fn extension_module(&self) -> Option<&'ctx str>
Get the module where the extension is defined, if this is an extension member.
Source§fn extension_generic_signature(&self) -> Option<GenericSignature<'ctx>>
fn extension_generic_signature(&self) -> Option<GenericSignature<'ctx>>
Get the generic signature from the extension context, if any. Read more
Source§fn extension_generic_requirements(&self) -> Vec<GenericRequirement<'ctx>>
fn extension_generic_requirements(&self) -> Vec<GenericRequirement<'ctx>>
Get the generic requirements from the extension context, if any.
Source§impl<'ctx> HasFunctionSignature<'ctx> for Function<'ctx>
impl<'ctx> HasFunctionSignature<'ctx> for Function<'ctx>
Source§impl<'ctx> HasGenericSignature<'ctx> for Function<'ctx>
impl<'ctx> HasGenericSignature<'ctx> for Function<'ctx>
Source§fn generic_signature(&self) -> Option<GenericSignature<'ctx>>
fn generic_signature(&self) -> Option<GenericSignature<'ctx>>
Get the generic signature if this symbol has generic constraints.
Source§fn generic_requirements(&self) -> Vec<GenericRequirement<'ctx>>
fn generic_requirements(&self) -> Vec<GenericRequirement<'ctx>>
Get the generic requirements (constraints) for this symbol. Read more
Source§fn is_generic(&self) -> bool
fn is_generic(&self) -> bool
Check if this symbol is generic.
impl<'ctx> Copy for Function<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for Function<'ctx>
impl<'ctx> RefUnwindSafe for Function<'ctx>
impl<'ctx> !Send for Function<'ctx>
impl<'ctx> !Sync for Function<'ctx>
impl<'ctx> Unpin for Function<'ctx>
impl<'ctx> UnsafeUnpin for Function<'ctx>
impl<'ctx> UnwindSafe for Function<'ctx>
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