pub struct TransItemSource {
pub item: RustcItem,
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
§kind: TransItemSourceKind
Implementations§
Source§impl TransItemSource
impl TransItemSource
pub fn new(item: RustcItem, kind: TransItemSourceKind) -> Self
Sourcepub fn from_item(
item: &ItemRef,
kind: TransItemSourceKind,
monomorphize: bool,
) -> Self
pub fn from_item( item: &ItemRef, 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, kind: TransItemSourceKind) -> Self
pub fn monomorphic(item: &ItemRef, kind: TransItemSourceKind) -> Self
Refers to the monomorphic version of this item.
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. drop impl/methods are not the main item).
Trait Implementations§
Source§impl Clone for TransItemSource
impl Clone for TransItemSource
Source§fn clone(&self) -> TransItemSource
fn clone(&self) -> TransItemSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for TransItemSource
impl Debug for TransItemSource
Source§impl Hash for TransItemSource
impl Hash for TransItemSource
Source§impl Ord for TransItemSource
impl Ord for TransItemSource
Source§impl PartialEq for TransItemSource
impl PartialEq for TransItemSource
Source§impl PartialOrd for TransItemSource
Manual impls because DefId
is not orderable.
impl PartialOrd for TransItemSource
Manual impls because DefId
is not orderable.
impl Eq for TransItemSource
impl StructuralPartialEq for TransItemSource
Auto Trait Implementations§
impl Freeze for TransItemSource
impl RefUnwindSafe for TransItemSource
impl Send for TransItemSource
impl Sync for TransItemSource
impl Unpin for TransItemSource
impl UnwindSafe for TransItemSource
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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