pub struct CrateItem(pub DefId);
Expand description
Holds information about an item in a crate.
Tuple Fields§
§0: DefId
Implementations§
Source§impl CrateItem
impl CrateItem
Sourcepub fn body(&self) -> Body
pub fn body(&self) -> Body
This will return the body of an item.
This will panic if no body is available.
pub fn span(&self) -> Span
pub fn kind(&self) -> ItemKind
pub fn requires_monomorphization(&self) -> bool
pub fn ty(&self) -> Ty
pub fn is_foreign_item(&self) -> bool
pub fn emit_mir<W: Write>(&self, w: &mut W) -> Result<()>
Trait Implementations§
Source§impl CrateDef for CrateItem
impl CrateDef for CrateItem
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 CrateItem
impl CrateDefType for CrateItem
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 TryFrom<CrateItem> for Instance
impl TryFrom<CrateItem> for Instance
Try to convert a crate item into an instance. The item cannot be generic in order to be converted into an instance.
Source§impl TryFrom<Instance> for CrateItem
impl TryFrom<Instance> for CrateItem
Try to convert an instance into a crate item. Only user defined instances can be converted.
impl Copy for CrateItem
impl Eq for CrateItem
impl StructuralPartialEq for CrateItem
Auto Trait Implementations§
impl Freeze for CrateItem
impl RefUnwindSafe for CrateItem
impl Send for CrateItem
impl Sync for CrateItem
impl Unpin for CrateItem
impl UnwindSafe for CrateItem
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