pub struct FunctionNode<'a> {
pub name: &'a str,
pub fqn: &'a str,
pub path: &'a str,
pub language: &'a str,
pub framework: Option<&'a str>,
pub project_name: Option<&'a str>,
pub arity: Option<u32>,
pub return_type: Option<&'a str>,
pub param_count: Option<u32>,
pub param_types: Option<&'a [&'a str]>,
}Expand description
Structured view of the properties we expect on a Function node.
This is intentionally generic and works across languages:
- Erlang:
name,arity,fqn = "module:name/arity". - Java / C#:
name,arity = None,fqnincludes class + method.
Fields§
§name: &'a str§fqn: &'a str§path: &'a str§language: &'a str§framework: Option<&'a str>§project_name: Option<&'a str>§arity: Option<u32>For Erlang this should be Some(arity), for many other languages it
can remain None.
return_type: Option<&'a str>Explicit return type, if it can be extracted from the syntax tree or type annotations.
param_count: Option<u32>Number of parameters, if it can be extracted. For parameter-less
functions this is typically Some(0), but callers may also choose to
leave it as None if they do not compute it.
param_types: Option<&'a [&'a str]>Parameter type names in declaration order, when available. This allows richer queries like “which functions take an OrderDetail as input?”.
Trait Implementations§
Source§impl<'a> Clone for FunctionNode<'a>
impl<'a> Clone for FunctionNode<'a>
Source§fn clone(&self) -> FunctionNode<'a>
fn clone(&self) -> FunctionNode<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for FunctionNode<'a>
impl<'a> RefUnwindSafe for FunctionNode<'a>
impl<'a> Send for FunctionNode<'a>
impl<'a> Sync for FunctionNode<'a>
impl<'a> Unpin for FunctionNode<'a>
impl<'a> UnsafeUnpin for FunctionNode<'a>
impl<'a> UnwindSafe for FunctionNode<'a>
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
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>
Converts
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>
Converts
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