pub struct FunctionDescriptor {
pub hir_id: HirId,
pub name: String,
pub visibility: FnVisibility,
pub is_async: bool,
pub is_const: bool,
pub is_unsafe: bool,
pub generics: Option<String>,
pub where_clause: Option<String>,
pub parameters: Vec<FunctionParameter>,
pub return_type: Option<TypeExpr>,
pub signature: String,
pub fqn: String,
}Expand description
Rich metadata extracted for each Rust function encountered in the HIR.
Fields§
§hir_id: HirIdHIR identifier for the function node.
name: StringShort name as written in source (no qualification).
visibility: FnVisibilityModule/impl/trait context owning the function.
Visibility as declared (pub, pub(crate), etc.).
is_async: boolWhether the function is marked async.
is_const: boolWhether the function is marked const.
is_unsafe: boolWhether the function is marked unsafe.
generics: Option<String>Generic parameter clause (<T: Foo>), if present.
where_clause: Option<String>Optional where clause.
parameters: Vec<FunctionParameter>Ordered function parameters.
return_type: Option<TypeExpr>Parsed return type, if any.
signature: StringTextual signature up to (but not including) the body.
fqn: StringFully-qualified name derived from the owner chain.
Implementations§
Trait Implementations§
Source§impl Clone for FunctionDescriptor
impl Clone for FunctionDescriptor
Source§fn clone(&self) -> FunctionDescriptor
fn clone(&self) -> FunctionDescriptor
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for FunctionDescriptor
impl RefUnwindSafe for FunctionDescriptor
impl Send for FunctionDescriptor
impl Sync for FunctionDescriptor
impl Unpin for FunctionDescriptor
impl UnwindSafe for FunctionDescriptor
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> 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