Struct stable_mir::ty::FnDef
source · 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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