pub struct FnDef(pub DefId);
Expand description
Hold information about a function definition in a crate.
Tuple Fields§
§0: DefId
Implementations§
Source§impl FnDef
impl FnDef
pub fn body(&self) -> Option<Body>
pub fn has_body(&self) -> bool
Sourcepub fn as_intrinsic(&self) -> Option<IntrinsicDef>
pub fn as_intrinsic(&self) -> Option<IntrinsicDef>
Get the information of the intrinsic if this function is a definition of one.
Sourcepub fn is_intrinsic(&self) -> bool
pub fn is_intrinsic(&self) -> bool
Check if the function is an intrinsic.
Trait Implementations§
Source§impl CrateDef for FnDef
impl CrateDef for FnDef
Source§fn trimmed_name(&self) -> Symbol
fn trimmed_name(&self) -> Symbol
Return a trimmed name of this definition. Read more
Source§fn krate(&self) -> Crate
fn krate(&self) -> Crate
Return information about the crate where this definition is declared. Read more
Source§impl CrateDefType for FnDef
impl CrateDefType for FnDef
Source§fn ty_with_args(&self, args: &GenericArgs) -> Ty
fn ty_with_args(&self, args: &GenericArgs) -> Ty
Retrieve the type of this definition by instantiating and normalizing it with
args
. Read moreSource§impl From<IntrinsicDef> for FnDef
impl From<IntrinsicDef> for FnDef
Source§fn from(def: IntrinsicDef) -> Self
fn from(def: IntrinsicDef) -> Self
Converts to this type from the input type.
impl Copy for FnDef
impl Eq for FnDef
impl StructuralPartialEq for FnDef
Auto Trait Implementations§
impl Freeze for FnDef
impl RefUnwindSafe for FnDef
impl Send for FnDef
impl Sync for FnDef
impl Unpin for FnDef
impl UnwindSafe for FnDef
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,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes