pub struct TransItemSource<'tcx> {
pub item: RustcItem<'tcx>,
pub kind: TransItemSourceKind,
}Expand description
The id of an untranslated item. Note that a given DefId may show up as multiple different
item sources, e.g. a constant will have both a Global version (for the constant itself) and a
FunDecl one (for its initializer function).
Fields§
§item: RustcItem<'tcx>§kind: TransItemSourceKindImplementations§
Source§impl<'tcx> TransItemSource<'tcx>
impl<'tcx> TransItemSource<'tcx>
pub fn new(item: RustcItem<'tcx>, kind: TransItemSourceKind) -> Self
Sourcepub fn from_item(
item: &ItemRef<'tcx>,
kind: TransItemSourceKind,
monomorphize: bool,
) -> Self
pub fn from_item( item: &ItemRef<'tcx>, kind: TransItemSourceKind, monomorphize: bool, ) -> Self
Refers to the given item. Depending on monomorphize, this chooses between the monomorphic
and polymorphic versions of the item.
Sourcepub fn polymorphic(def_id: &DefId, kind: TransItemSourceKind) -> Self
pub fn polymorphic(def_id: &DefId, kind: TransItemSourceKind) -> Self
Refers to the polymorphic version of this item.
Sourcepub fn monomorphic(item: &ItemRef<'tcx>, kind: TransItemSourceKind) -> Self
pub fn monomorphic(item: &ItemRef<'tcx>, kind: TransItemSourceKind) -> Self
Refers to the monomorphic version of this item.
Sourcepub fn monomorphic_trait(def_id: &DefId, kind: TransItemSourceKind) -> Self
pub fn monomorphic_trait(def_id: &DefId, kind: TransItemSourceKind) -> Self
Refers to the monomorphic trait (or vtable).
See the docs of RustcItem::MonoTrait for details.
pub fn def_id(&self) -> &DefId
Sourcepub(crate) fn with_kind(&self, kind: TransItemSourceKind) -> Self
pub(crate) fn with_kind(&self, kind: TransItemSourceKind) -> Self
Keep the same def_id but change the kind.
Sourcepub(crate) fn parent(&self) -> Option<Self>
pub(crate) fn parent(&self) -> Option<Self>
For virtual items that have a parent (typically a method impl), return this parent. Does not attempt to generally compute the parent of an item. Used to compute names.
Sourcepub(crate) fn is_derived_item(&self) -> bool
pub(crate) fn is_derived_item(&self) -> bool
Whether this item is the “main” item for this def_id or not (e.g. Destruct impl/methods are not the main item).
Trait Implementations§
Source§impl<'tcx> Clone for TransItemSource<'tcx>
impl<'tcx> Clone for TransItemSource<'tcx>
Source§fn clone(&self) -> TransItemSource<'tcx>
fn clone(&self) -> TransItemSource<'tcx>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'tcx> Debug for TransItemSource<'tcx>
impl<'tcx> Debug for TransItemSource<'tcx>
impl<'tcx> Eq for TransItemSource<'tcx>
Source§impl<'tcx> Hash for TransItemSource<'tcx>
impl<'tcx> Hash for TransItemSource<'tcx>
Source§impl<'tcx> PartialEq for TransItemSource<'tcx>
impl<'tcx> PartialEq for TransItemSource<'tcx>
impl<'tcx> StructuralPartialEq for TransItemSource<'tcx>
Auto Trait Implementations§
impl<'tcx> DynSend for TransItemSource<'tcx>
impl<'tcx> DynSync for TransItemSource<'tcx>
impl<'tcx> Freeze for TransItemSource<'tcx>
impl<'tcx> RefUnwindSafe for TransItemSource<'tcx>
impl<'tcx> Send for TransItemSource<'tcx>
impl<'tcx> Sync for TransItemSource<'tcx>
impl<'tcx> Unpin for TransItemSource<'tcx>
impl<'tcx> UnsafeUnpin for TransItemSource<'tcx>
impl<'tcx> UnwindSafe for TransItemSource<'tcx>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Dedup for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> HashConsable for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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