pub enum LangItem {
Show 130 variants Sized, Unsize, StructuralPeq, StructuralTeq, Copy, Clone, Sync, DiscriminantKind, Discriminant, PointeeTrait, Metadata, DynMetadata, Freeze, FnPtrTrait, FnPtrAddr, Drop, Destruct, CoerceUnsized, DispatchFromDyn, TransmuteOpts, TransmuteTrait, Add, Sub, Mul, Div, Rem, Neg, Not, BitXor, BitAnd, BitOr, Shl, Shr, AddAssign, SubAssign, MulAssign, DivAssign, RemAssign, BitXorAssign, BitAndAssign, BitOrAssign, ShlAssign, ShrAssign, Index, IndexMut, UnsafeCell, VaList, Deref, DerefMut, DerefTarget, Receiver, Fn, FnMut, FnOnce, FnOnceOutput, Future, CoroutineState, Coroutine, Unpin, Pin, PartialEq, PartialOrd, CVoid, Panic, PanicNounwind, PanicFmt, PanicDisplay, ConstPanicFmt, PanicBoundsCheck, PanicMisalignedPointerDereference, PanicInfo, PanicLocation, PanicImpl, PanicCannotUnwind, BeginPanic, FormatAlignment, FormatArgument, FormatArguments, FormatCount, FormatPlaceholder, FormatUnsafeArg, ExchangeMalloc, BoxFree, DropInPlace, AllocLayout, Start, EhPersonality, EhCatchTypeinfo, OwnedBox, PhantomData, ManuallyDrop, MaybeUninit, AlignOffset, Termination, Try, Tuple, SliceLen, TryTraitFromResidual, TryTraitFromOutput, TryTraitBranch, TryTraitFromYeet, PointerLike, ConstParamTy, Poll, PollReady, PollPending, ResumeTy, GetContext, Context, FuturePoll, Option, OptionSome, OptionNone, ResultOk, ResultErr, ControlFlowContinue, ControlFlowBreak, IntoFutureIntoFuture, IntoIterIntoIter, IteratorNext, PinNewUnchecked, RangeFrom, RangeFull, RangeInclusiveStruct, RangeInclusiveNew, Range, RangeToInclusive, RangeTo, String, CStr,
}
Expand description

A representation of all the valid language items in Rust.

Variants§

§

Sized

The sized lang item.

§

Unsize

The unsize lang item.

§

StructuralPeq

The structural_peq lang item. Trait injected by #[derive(PartialEq)], (i.e. “Partial EQ”).

§

StructuralTeq

The structural_teq lang item. Trait injected by #[derive(Eq)], (i.e. “Total EQ”; no, I will not apologize).

§

Copy

The copy lang item.

§

Clone

The clone lang item.

§

Sync

The sync lang item.

§

DiscriminantKind

The discriminant_kind lang item.

§

Discriminant

The discriminant_type lang item. The associated item of the [DiscriminantKind] trait.

§

PointeeTrait

The pointee_trait lang item.

§

Metadata

The metadata_type lang item.

§

DynMetadata

The dyn_metadata lang item.

§

Freeze

The freeze lang item.

§

FnPtrTrait

The fn_ptr_trait lang item.

§

FnPtrAddr

The fn_ptr_addr lang item.

§

Drop

The drop lang item.

§

Destruct

The destruct lang item.

§

CoerceUnsized

The coerce_unsized lang item.

§

DispatchFromDyn

The dispatch_from_dyn lang item.

§

TransmuteOpts

The transmute_opts lang item.

§

TransmuteTrait

The transmute_trait lang item.

§

Add

The add lang item.

§

Sub

The sub lang item.

§

Mul

The mul lang item.

§

Div

The div lang item.

§

Rem

The rem lang item.

§

Neg

The neg lang item.

§

Not

The not lang item.

§

BitXor

The bitxor lang item.

§

BitAnd

The bitand lang item.

§

BitOr

The bitor lang item.

§

Shl

The shl lang item.

§

Shr

The shr lang item.

§

AddAssign

The add_assign lang item.

§

SubAssign

The sub_assign lang item.

§

MulAssign

The mul_assign lang item.

§

DivAssign

The div_assign lang item.

§

RemAssign

The rem_assign lang item.

§

BitXorAssign

The bitxor_assign lang item.

§

BitAndAssign

The bitand_assign lang item.

§

BitOrAssign

The bitor_assign lang item.

§

ShlAssign

The shl_assign lang item.

§

ShrAssign

The shr_assign lang item.

§

Index

The index lang item.

§

IndexMut

The index_mut lang item.

§

UnsafeCell

The unsafe_cell lang item.

§

VaList

The va_list lang item.

§

Deref

The deref lang item.

§

DerefMut

The deref_mut lang item.

§

DerefTarget

The deref_target lang item.

§

Receiver

The receiver lang item.

§

Fn

The fn lang item.

§

FnMut

The fn_mut lang item.

§

FnOnce

The fn_once lang item.

§

FnOnceOutput

The fn_once_output lang item.

§

Future

The future_trait lang item.

§

CoroutineState

The coroutine_state lang item.

§

Coroutine

The coroutine lang item.

§

Unpin

The unpin lang item.

§

Pin

The pin lang item.

§

PartialEq

The eq lang item.

§

PartialOrd

The partial_ord lang item.

§

CVoid

The c_void lang item.

§

Panic

The panic lang item.

§

PanicNounwind

The panic_nounwind lang item.

§

PanicFmt

The panic_fmt lang item.

§

PanicDisplay

The panic_display lang item.

§

ConstPanicFmt

The const_panic_fmt lang item.

§

PanicBoundsCheck

The panic_bounds_check lang item.

§

PanicMisalignedPointerDereference

The panic_misaligned_pointer_dereference lang item.

§

PanicInfo

The panic_info lang item.

§

PanicLocation

The panic_location lang item.

§

PanicImpl

The panic_impl lang item.

§

PanicCannotUnwind

The panic_cannot_unwind lang item.

§

BeginPanic

The begin_panic lang item. libstd panic entry point. Necessary for const eval to be able to catch it

§

FormatAlignment

The format_alignment lang item.

§

FormatArgument

The format_argument lang item.

§

FormatArguments

The format_arguments lang item.

§

FormatCount

The format_count lang item.

§

FormatPlaceholder

The format_placeholder lang item.

§

FormatUnsafeArg

The format_unsafe_arg lang item.

§

ExchangeMalloc

The exchange_malloc lang item.

§

BoxFree

The box_free lang item.

§

DropInPlace

The drop_in_place lang item.

§

AllocLayout

The alloc_layout lang item.

§

Start

The start lang item.

§

EhPersonality

The eh_personality lang item.

§

EhCatchTypeinfo

The eh_catch_typeinfo lang item.

§

OwnedBox

The owned_box lang item.

§

PhantomData

The phantom_data lang item.

§

ManuallyDrop

The manually_drop lang item.

§

MaybeUninit

The maybe_uninit lang item.

§

AlignOffset

The align_offset lang item. Align offset for stride != 1; must not panic.

§

Termination

The termination lang item.

§

Try

The Try lang item.

§

Tuple

The tuple_trait lang item.

§

SliceLen

The slice_len_fn lang item.

§

TryTraitFromResidual

The from_residual lang item.

§

TryTraitFromOutput

The from_output lang item.

§

TryTraitBranch

The branch lang item.

§

TryTraitFromYeet

The from_yeet lang item.

§

PointerLike

The pointer_like lang item.

§

ConstParamTy

The const_param_ty lang item.

§

Poll

The Poll lang item.

§

PollReady

The Ready lang item.

§

PollPending

The Pending lang item.

§

ResumeTy

The ResumeTy lang item.

§

GetContext

The get_context lang item.

§

Context

The Context lang item.

§

FuturePoll

The poll lang item.

§

Option

The Option lang item.

§

OptionSome

The Some lang item.

§

OptionNone

The None lang item.

§

ResultOk

The Ok lang item.

§

ResultErr

The Err lang item.

§

ControlFlowContinue

The Continue lang item.

§

ControlFlowBreak

The Break lang item.

§

IntoFutureIntoFuture

The into_future lang item.

§

IntoIterIntoIter

The into_iter lang item.

§

IteratorNext

The next lang item.

§

PinNewUnchecked

The new_unchecked lang item.

§

RangeFrom

The RangeFrom lang item.

§

RangeFull

The RangeFull lang item.

§

RangeInclusiveStruct

The RangeInclusive lang item.

§

RangeInclusiveNew

The range_inclusive_new lang item.

§

Range

The Range lang item.

§

RangeToInclusive

The RangeToInclusive lang item.

§

RangeTo

The RangeTo lang item.

§

String

The String lang item.

§

CStr

The CStr lang item.

Implementations§

source§

impl LangItem

source

pub fn from_name(name: &Name) -> Option<Self>

Opposite of LangItem::name

source

pub fn path(&self, db: &dyn DefDatabase, start_crate: CrateId) -> Option<Path>

source

pub fn ty_rel_path( &self, db: &dyn DefDatabase, start_crate: CrateId, seg: Name ) -> Option<Path>

source§

impl LangItem

source

pub fn name(self) -> SmolStr

source

pub fn from_str(name: &str) -> Option<Self>

Opposite of LangItem::name

Trait Implementations§

source§

impl Clone for LangItem

source§

fn clone(&self) -> LangItem

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LangItem

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Hash for LangItem

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for LangItem

source§

fn eq(&self, other: &LangItem) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for LangItem

source§

impl Eq for LangItem

source§

impl StructuralPartialEq for LangItem

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoBox<dyn Any> for T
where T: Any,

§

fn into_box(self) -> Box<dyn Any>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send> for T
where T: Any + Send,

§

fn into_box(self) -> Box<dyn Any + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn Any + Send + Sync> for T
where T: Any + Send + Sync,

§

fn into_box(self) -> Box<dyn Any + Send + Sync>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn CloneAny> for T
where T: CloneAny,

§

fn into_box(self) -> Box<dyn CloneAny>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn CloneAny + Send> for T
where T: CloneAny + Send,

§

fn into_box(self) -> Box<dyn CloneAny + Send>

Convert self into the appropriate boxed form.
§

impl<T> IntoBox<dyn CloneAny + Send + Sync> for T
where T: CloneAny + Send + Sync,

§

fn into_box(self) -> Box<dyn CloneAny + Send + Sync>

Convert self into the appropriate boxed form.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> CloneAny for T
where T: Any + Clone,