pub struct Function<'input> { /* private fields */ }
Expand description
A function.
Implementations§
Source§impl<'input> Function<'input>
impl<'input> Function<'input>
Sourcepub fn linkage_name(&self) -> Option<&str>
pub fn linkage_name(&self) -> Option<&str>
The linkage name of the variable.
Sourcepub fn symbol_name(&self) -> Option<&str>
pub fn symbol_name(&self) -> Option<&str>
The symbol name of the function.
This is determined from a symbol table entry with a matching address.
Sourcepub fn size(&self) -> Option<u64>
pub fn size(&self) -> Option<u64>
The size in bytes of the function.
This may exclude padding, and may be non-contiguous.
Sourcepub fn is_declaration(&self) -> bool
pub fn is_declaration(&self) -> bool
Return true if this is a declaration.
Sourcepub fn parameters(&self) -> &[ParameterType<'input>]
pub fn parameters(&self) -> &[ParameterType<'input>]
The function parameter types.
Sourcepub fn return_type<'a>(
&self,
hash: &'a FileHash<'input>,
) -> Option<Cow<'a, Type<'input>>>
pub fn return_type<'a>( &self, hash: &'a FileHash<'input>, ) -> Option<Cow<'a, Type<'input>>>
The return type.
Returns None
if the return type is invalid.
Sourcepub fn details(&self, hash: &FileHash<'input>) -> FunctionDetails<'input>
pub fn details(&self, hash: &FileHash<'input>) -> FunctionDetails<'input>
Extra function details.
Sourcepub fn cmp_id(
_hash_a: &FileHash<'_>,
a: &Function<'_>,
_hash_b: &FileHash<'_>,
b: &Function<'_>,
) -> Ordering
pub fn cmp_id( _hash_a: &FileHash<'_>, a: &Function<'_>, _hash_b: &FileHash<'_>, b: &Function<'_>, ) -> Ordering
Compare the identifying information of two functions.
Functions are equal if they have the same namespace and name.
This can be used to sort, and to determine if two functions refer to the same definition (even if there are differences in the definitions).
Trait Implementations§
Auto Trait Implementations§
impl<'input> !Freeze for Function<'input>
impl<'input> RefUnwindSafe for Function<'input>
impl<'input> Send for Function<'input>
impl<'input> Sync for Function<'input>
impl<'input> Unpin for Function<'input>
impl<'input> UnwindSafe for Function<'input>
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