TyKind in rustc_type_ir - Rust
Description: Defines the kinds of types used by the type system.

Skip to main content

## TyKind

# Enum TyKind

Source

    pub enum TyKind<I: Interner> {
    Show 29 variants    Bool,
        Char,
        Int(IntTy),
        Uint(UintTy),
        Float(FloatTy),
        Adt(I::AdtDef, I::GenericArgs),
        Foreign(I::ForeignId),
        Str,
        Array(I::Ty, I::Const),
        Pat(I::Ty, I::Pat),
        Slice(I::Ty),
        RawPtr(I::Ty, Mutability),
        Ref(I::Region, I::Ty, Mutability),
        FnDef(I::FunctionId, I::GenericArgs),
        FnPtr(Binder<I, FnSigTys<I>>, FnHeader<I>),
        UnsafeBinder(UnsafeBinderInner<I>),
        Dynamic(I::BoundExistentialPredicates, I::Region),
        Closure(I::ClosureId, I::GenericArgs),
        CoroutineClosure(I::CoroutineClosureId, I::GenericArgs),
        Coroutine(I::CoroutineId, I::GenericArgs),
        CoroutineWitness(I::CoroutineId, I::GenericArgs),
        Never,
        Tuple(I::Tys),
        Alias(AliasTy<I>),
        Param(I::ParamTy),
        Bound(BoundVarIndexKind, BoundTy<I>),
        Placeholder(PlaceholderType<I>),
        Infer(InferTy),
        Error(I::ErrorGuaranteed),
    }

Expand description

Defines the kinds of types used by the type system.

Types written by the user start out as `hir::TyKind` and get converted to this representation using `<dyn HirTyLowerer>::lower_ty`.

## Variants§

§

### Bool

The primitive boolean type. Written as `bool`.

§

### Char

The primitive character type; holds a Unicode scalar value (a non-surrogate code point). Written as `char`.

§

### Int(IntTy)

A primitive signed integer type. For example, `i32`.

§

### Uint(UintTy)

A primitive unsigned integer type. For example, `u32`.

§

### Float(FloatTy)

A primitive floating-point type. For example, `f64`.

§

### Adt(I::AdtDef, I::GenericArgs)

Algebraic data types (ADT). For example: structures, enumerations and unions.

For example, the type `List<i32>` would be represented using the `AdtDef` for `struct List<T>` and the args `[i32]`.

Note that generic parameters in fields only get lazily instantiated by using something like `adt_def.all_fields().map(|field| field.ty(interner, args))`.

§

### Foreign(I::ForeignId)

An unsized FFI type that is opaque to Rust. Written as `extern type T`.

§

### Str

The pointee of a string slice. Written as `str`.

§

### Array(I::Ty, I::Const)

An array with the given length. Written as `[T; N]`.

§

### Pat(I::Ty, I::Pat)

A pattern newtype.

Takes any type and restricts its valid values to its pattern. This will also change the layout to take advantage of this restriction. Only `Copy` and `Clone` will automatically get implemented for pattern types. Auto-traits treat this as if it were an aggregate with a single nested type. Only supports integer range patterns for now.

§

### Slice(I::Ty)

The pointee of an array slice. Written as `[T]`.

§

### RawPtr(I::Ty, Mutability)

A raw pointer. Written as `*mut T` or `*const T`

§

### Ref(I::Region, I::Ty, Mutability)

A reference; a pointer with an associated lifetime. Written as `&'a mut T` or `&'a T`.

§

### FnDef(I::FunctionId, I::GenericArgs)

The anonymous type of a function declaration/definition.

Each function has a unique type.

For the function `fn foo() -> i32 { 3 }` this type would be shown to the user as `fn() -> i32 {foo}`.

For example the type of `bar` here:

    fn foo() -> i32 { 1 }
    let bar = foo; // bar: fn() -> i32 {foo}

§

### FnPtr(Binder<I, FnSigTys<I>>, FnHeader<I>)

A pointer to a function.

Written as `fn() -> i32`.

Note that both functions and closures start out as either FnDef or Closure which can be then be coerced to this variant.

For example the type of `bar` here:

    fn foo() -> i32 { 1 }
    let bar: fn() -> i32 = foo;

These two fields are equivalent to a `ty::Binder<I, FnSig<I>>`. But by splitting that into two pieces, we get a more compact data layout that reduces the size of `TyKind` by 8 bytes. It is a very hot type, so it’s worth the mild inconvenience.

§

### UnsafeBinder(UnsafeBinderInner<I>)

An unsafe binder type.

A higher-ranked type used to represent a type which has had some of its lifetimes erased. This can be used to represent types in positions where a lifetime is literally inexpressible, such as self-referential types.

§

### Dynamic(I::BoundExistentialPredicates, I::Region)

A trait object. Written as `dyn for<'b> Trait<'b, Assoc = u32> + Send + 'a`.

§

### Closure(I::ClosureId, I::GenericArgs)

The anonymous type of a closure. Used to represent the type of `|a| a`.

Closure args contain both the - potentially instantiated - generic parameters of its parent and some synthetic parameters. See the documentation for `ClosureArgs` for more details.

§

### CoroutineClosure(I::CoroutineClosureId, I::GenericArgs)

The anonymous type of a closure. Used to represent the type of `async |a| a`.

Coroutine-closure args contain both the - potentially instantiated - generic parameters of its parent and some synthetic parameters. See the documentation for `CoroutineClosureArgs` for more details.

§

### Coroutine(I::CoroutineId, I::GenericArgs)

The anonymous type of a coroutine. Used to represent the type of `|a| yield a`.

For more info about coroutine args, visit the documentation for `CoroutineArgs`.

§

### CoroutineWitness(I::CoroutineId, I::GenericArgs)

A type representing the types stored inside a coroutine.

This should only appear as part of the `CoroutineArgs`.

Unlike upvars, the witness can reference lifetimes from inside of the coroutine itself. To deal with them in the type of the coroutine, we convert them to higher ranked lifetimes bound by the witness itself.

This contains the `DefId` and the `GenericArgsRef` of the coroutine. The actual witness types are computed on MIR by the `mir_coroutine_witnesses` query.

Looking at the following example, the witness for this coroutine may end up as something like `for<'a> [Vec<i32>, &'a Vec<i32>]`:

    #![feature(coroutines)]
    #[coroutine] static |a| {
        let x = &vec![3];
        yield a;
        yield x[0];
    }

§

### Never

The never type `!`.

§

### Tuple(I::Tys)

A tuple type. For example, `(i32, bool)`.

§

### Alias(AliasTy<I>)

A projection, opaque type, free type alias, or inherent associated type.

All of these types are represented as pairs of def-id and args, and can be normalized, so they are grouped conceptually.

§

### Param(I::ParamTy)

A type parameter; for example, `T` in `fn f<T>(x: T) {}`.

§

### Bound(BoundVarIndexKind, BoundTy<I>)

Bound type variable, used to represent the `'a` in `for<'a> fn(&'a ())`.

For canonical queries, we replace inference variables with bound variables, so e.g. when checking whether `&'_ (): Trait<_>` holds, we canonicalize that to `for<'a, T> &'a (): Trait<T>` and then convert the introduced bound variables back to inference variables in a new inference context when inside of the query.

It is conventional to render anonymous bound types like `^N` or `^D_N`, where `N` is the bound variable’s anonymous index into the binder, and `D` is the debruijn index, or totally omitted if the debruijn index is zero.

See the `rustc-dev-guide` for more details about higher-ranked trait bounds and canonical queries.

§

### Placeholder(PlaceholderType<I>)

A placeholder type, used during higher ranked subtyping to instantiate bound variables.

It is conventional to render anonymous placeholder types like `!N` or `!U_N`, where `N` is the placeholder variable’s anonymous index (which corresponds to the bound variable’s index from the binder from which it was instantiated), and `U` is the universe index in which it is instantiated, or totally omitted if the universe index is zero.

§

### Infer(InferTy)

A type variable used during type checking.

Similar to placeholders, inference variables also live in a universe to correctly deal with higher ranked types. Though unlike placeholders, that universe is stored in the `InferCtxt` instead of directly inside of the type.

§

### Error(I::ErrorGuaranteed)

A placeholder for a type which could not be computed.

This is propagated to avoid useless error messages.

## Implementations§

Source§

### impl<I: Interner> TyKind<I>

Source

#### pub fn fn_sig(self, interner: I) -> Binder<I, FnSig<I>>

Source

#### pub fn is_known_rigid(self) -> bool

Returns `true` when the outermost type cannot be further normalized, resolved, or instantiated.

This includes all primitive types, but also things like ADTs and trait objects, since even if their arguments or nested types may be further simplified, the outermost `ty::TyKind` or type constructor remains the same.

## Trait Implementations§

Source§

### impl<I> Clone for TyKind<I>
where I: Interner,

Source§

#### fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from `source`. Read more
Source§

### impl<I: Interner> Debug for TyKind<I>

Source§

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

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

### impl<I: Interner, __D: Decoder> Decodable<__D> for TyKind<I>
where I::AdtDef: Decodable<__D>, I::GenericArgs: Decodable<__D>, I::ForeignId: Decodable<__D>, I::Ty: Decodable<__D>, I::Const: Decodable<__D>, I::Pat: Decodable<__D>, I::Region: Decodable<__D>, I::FunctionId: Decodable<__D>, Binder<I, FnSigTys<I>>: Decodable<__D>, FnHeader<I>: Decodable<__D>, UnsafeBinderInner<I>: Decodable<__D>, I::BoundExistentialPredicates: Decodable<__D>, I::ClosureId: Decodable<__D>, I::CoroutineClosureId: Decodable<__D>, I::CoroutineId: Decodable<__D>, I::Tys: Decodable<__D>, AliasTy<I>: Decodable<__D>, I::ParamTy: Decodable<__D>, BoundTy<I>: Decodable<__D>, PlaceholderType<I>: Decodable<__D>, I::ErrorGuaranteed: Decodable<__D>,

Source§

#### fn decode(__decoder: &mut __D) -> Self

Source§

### impl<I: Interner, __E: Encoder> Encodable<__E> for TyKind<I>
where I::AdtDef: Encodable<__E>, I::GenericArgs: Encodable<__E>, I::ForeignId: Encodable<__E>, I::Ty: Encodable<__E>, I::Const: Encodable<__E>, I::Pat: Encodable<__E>, I::Region: Encodable<__E>, I::FunctionId: Encodable<__E>, Binder<I, FnSigTys<I>>: Encodable<__E>, FnHeader<I>: Encodable<__E>, UnsafeBinderInner<I>: Encodable<__E>, I::BoundExistentialPredicates: Encodable<__E>, I::ClosureId: Encodable<__E>, I::CoroutineClosureId: Encodable<__E>, I::CoroutineId: Encodable<__E>, I::Tys: Encodable<__E>, AliasTy<I>: Encodable<__E>, I::ParamTy: Encodable<__E>, BoundTy<I>: Encodable<__E>, PlaceholderType<I>: Encodable<__E>, I::ErrorGuaranteed: Encodable<__E>,

Source§

#### fn encode(&self, __encoder: &mut __E)

Source§

### impl<I> Hash for TyKind<I>
where I: Interner,

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<I> PartialEq for TyKind<I>
where I: Interner,

Source§

#### fn eq(&self, __other: &Self) -> bool

Tests for `self` and `other` values to be equal, and is used by `==`.
1.0.0 (const: unstable) · Source§

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

Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

### impl<I: Interner> StableHash for TyKind<I>
where I::AdtDef: StableHash, I::GenericArgs: StableHash, I::ForeignId: StableHash, I::Ty: StableHash, I::Const: StableHash, I::Pat: StableHash, I::Region: StableHash, I::FunctionId: StableHash, Binder<I, FnSigTys<I>>: StableHash, FnHeader<I>: StableHash, UnsafeBinderInner<I>: StableHash, I::BoundExistentialPredicates: StableHash, I::ClosureId: StableHash, I::CoroutineClosureId: StableHash, I::CoroutineId: StableHash, I::Tys: StableHash, AliasTy<I>: StableHash, I::ParamTy: StableHash, BoundTy<I>: StableHash, PlaceholderType<I>: StableHash, I::ErrorGuaranteed: StableHash,

Source§

#### fn stable_hash<__Hcx: StableHashCtxt>( &self, __hcx: &mut __Hcx, __hasher: &mut StableHasher, )

Source§

### impl<I> Copy for TyKind<I>
where I: Interner,

Source§

### impl<I: Interner> Eq for TyKind<I>

## Auto Trait Implementations§

§

### impl<I> DynSend for TyKind<I>
where <I as Interner>::AdtDef: DynSend, <I as Interner>::GenericArgs: DynSend, <I as Interner>::ForeignId: DynSend, <I as Interner>::Ty: DynSend, <I as Interner>::Const: DynSend, <I as Interner>::Pat: DynSend, <I as Interner>::Region: DynSend, <I as Interner>::FunctionId: DynSend, <I as Interner>::BoundExistentialPredicates: DynSend, <I as Interner>::ClosureId: DynSend, <I as Interner>::CoroutineClosureId: DynSend, <I as Interner>::CoroutineId: DynSend, <I as Interner>::Tys: DynSend, <I as Interner>::ParamTy: DynSend, <I as Interner>::ErrorGuaranteed: DynSend, <I as Interner>::BoundVarKinds: DynSend, <I as Interner>::TraitAssocTyId: DynSend, <I as Interner>::InherentAssocTyId: DynSend, <I as Interner>::OpaqueTyId: DynSend, <I as Interner>::FreeTyAliasId: DynSend, <I as Interner>::DefId: DynSend,

§

### impl<I> DynSync for TyKind<I>
where <I as Interner>::AdtDef: DynSync, <I as Interner>::GenericArgs: DynSync, <I as Interner>::ForeignId: DynSync, <I as Interner>::Ty: DynSync, <I as Interner>::Const: DynSync, <I as Interner>::Pat: DynSync, <I as Interner>::Region: DynSync, <I as Interner>::FunctionId: DynSync, <I as Interner>::BoundExistentialPredicates: DynSync, <I as Interner>::ClosureId: DynSync, <I as Interner>::CoroutineClosureId: DynSync, <I as Interner>::CoroutineId: DynSync, <I as Interner>::Tys: DynSync, <I as Interner>::ParamTy: DynSync, <I as Interner>::ErrorGuaranteed: DynSync, <I as Interner>::BoundVarKinds: DynSync, <I as Interner>::TraitAssocTyId: DynSync, <I as Interner>::InherentAssocTyId: DynSync, <I as Interner>::OpaqueTyId: DynSync, <I as Interner>::FreeTyAliasId: DynSync, <I as Interner>::DefId: DynSync,

§

### impl<I> Freeze for TyKind<I>
where <I as Interner>::AdtDef: Freeze, <I as Interner>::GenericArgs: Freeze, <I as Interner>::ForeignId: Freeze, <I as Interner>::Ty: Freeze, <I as Interner>::Const: Freeze, <I as Interner>::Pat: Freeze, <I as Interner>::Region: Freeze, <I as Interner>::FunctionId: Freeze, <I as Interner>::BoundExistentialPredicates: Freeze, <I as Interner>::ClosureId: Freeze, <I as Interner>::CoroutineClosureId: Freeze, <I as Interner>::CoroutineId: Freeze, <I as Interner>::Tys: Freeze, <I as Interner>::ParamTy: Freeze, <I as Interner>::ErrorGuaranteed: Freeze, <I as Interner>::BoundVarKinds: Freeze, <I as Interner>::TraitAssocTyId: Freeze, <I as Interner>::InherentAssocTyId: Freeze, <I as Interner>::OpaqueTyId: Freeze, <I as Interner>::FreeTyAliasId: Freeze, <I as Interner>::DefId: Freeze,

§

### impl<I> RefUnwindSafe for TyKind<I>
where <I as Interner>::AdtDef: RefUnwindSafe, <I as Interner>::GenericArgs: RefUnwindSafe, <I as Interner>::ForeignId: RefUnwindSafe, <I as Interner>::Ty: RefUnwindSafe, <I as Interner>::Const: RefUnwindSafe, <I as Interner>::Pat: RefUnwindSafe, <I as Interner>::Region: RefUnwindSafe, <I as Interner>::FunctionId: RefUnwindSafe, <I as Interner>::BoundExistentialPredicates: RefUnwindSafe, <I as Interner>::ClosureId: RefUnwindSafe, <I as Interner>::CoroutineClosureId: RefUnwindSafe, <I as Interner>::CoroutineId: RefUnwindSafe, <I as Interner>::Tys: RefUnwindSafe, <I as Interner>::ParamTy: RefUnwindSafe, <I as Interner>::ErrorGuaranteed: RefUnwindSafe, <I as Interner>::BoundVarKinds: RefUnwindSafe, <I as Interner>::TraitAssocTyId: RefUnwindSafe, <I as Interner>::InherentAssocTyId: RefUnwindSafe, <I as Interner>::OpaqueTyId: RefUnwindSafe, <I as Interner>::FreeTyAliasId: RefUnwindSafe, <I as Interner>::DefId: RefUnwindSafe,

§

### impl<I> Send for TyKind<I>
where <I as Interner>::AdtDef: Send, <I as Interner>::GenericArgs: Send, <I as Interner>::ForeignId: Send, <I as Interner>::Ty: Send, <I as Interner>::Const: Send, <I as Interner>::Pat: Send, <I as Interner>::Region: Send, <I as Interner>::FunctionId: Send, <I as Interner>::BoundExistentialPredicates: Send, <I as Interner>::ClosureId: Send, <I as Interner>::CoroutineClosureId: Send, <I as Interner>::CoroutineId: Send, <I as Interner>::Tys: Send, <I as Interner>::ParamTy: Send, <I as Interner>::ErrorGuaranteed: Send, <I as Interner>::BoundVarKinds: Send, <I as Interner>::TraitAssocTyId: Send, <I as Interner>::InherentAssocTyId: Send, <I as Interner>::OpaqueTyId: Send, <I as Interner>::FreeTyAliasId: Send, <I as Interner>::DefId: Send,

§

### impl<I> Sync for TyKind<I>
where <I as Interner>::AdtDef: Sync, <I as Interner>::GenericArgs: Sync, <I as Interner>::ForeignId: Sync, <I as Interner>::Ty: Sync, <I as Interner>::Const: Sync, <I as Interner>::Pat: Sync, <I as Interner>::Region: Sync, <I as Interner>::FunctionId: Sync, <I as Interner>::BoundExistentialPredicates: Sync, <I as Interner>::ClosureId: Sync, <I as Interner>::CoroutineClosureId: Sync, <I as Interner>::CoroutineId: Sync, <I as Interner>::Tys: Sync, <I as Interner>::ParamTy: Sync, <I as Interner>::ErrorGuaranteed: Sync, <I as Interner>::BoundVarKinds: Sync, <I as Interner>::TraitAssocTyId: Sync, <I as Interner>::InherentAssocTyId: Sync, <I as Interner>::OpaqueTyId: Sync, <I as Interner>::FreeTyAliasId: Sync, <I as Interner>::DefId: Sync,

§

### impl<I> Unpin for TyKind<I>
where <I as Interner>::AdtDef: Unpin, <I as Interner>::GenericArgs: Unpin, <I as Interner>::ForeignId: Unpin, <I as Interner>::Ty: Unpin, <I as Interner>::Const: Unpin, <I as Interner>::Pat: Unpin, <I as Interner>::Region: Unpin, <I as Interner>::FunctionId: Unpin, <I as Interner>::BoundExistentialPredicates: Unpin, <I as Interner>::ClosureId: Unpin, <I as Interner>::CoroutineClosureId: Unpin, <I as Interner>::CoroutineId: Unpin, <I as Interner>::Tys: Unpin, <I as Interner>::ParamTy: Unpin, <I as Interner>::ErrorGuaranteed: Unpin, <I as Interner>::BoundVarKinds: Unpin, <I as Interner>::TraitAssocTyId: Unpin, <I as Interner>::InherentAssocTyId: Unpin, <I as Interner>::OpaqueTyId: Unpin, <I as Interner>::FreeTyAliasId: Unpin, <I as Interner>::DefId: Unpin,

§

### impl<I> UnsafeUnpin for TyKind<I>
where <I as Interner>::AdtDef: UnsafeUnpin, <I as Interner>::GenericArgs: UnsafeUnpin, <I as Interner>::ForeignId: UnsafeUnpin, <I as Interner>::Ty: UnsafeUnpin, <I as Interner>::Const: UnsafeUnpin, <I as Interner>::Pat: UnsafeUnpin, <I as Interner>::Region: UnsafeUnpin, <I as Interner>::FunctionId: UnsafeUnpin, <I as Interner>::BoundExistentialPredicates: UnsafeUnpin, <I as Interner>::ClosureId: UnsafeUnpin, <I as Interner>::CoroutineClosureId: UnsafeUnpin, <I as Interner>::CoroutineId: UnsafeUnpin, <I as Interner>::Tys: UnsafeUnpin, <I as Interner>::ParamTy: UnsafeUnpin, <I as Interner>::ErrorGuaranteed: UnsafeUnpin, <I as Interner>::BoundVarKinds: UnsafeUnpin, <I as Interner>::TraitAssocTyId: UnsafeUnpin, <I as Interner>::InherentAssocTyId: UnsafeUnpin, <I as Interner>::OpaqueTyId: UnsafeUnpin, <I as Interner>::FreeTyAliasId: UnsafeUnpin, <I as Interner>::DefId: UnsafeUnpin,

§

### impl<I> UnwindSafe for TyKind<I>
where <I as Interner>::AdtDef: UnwindSafe, <I as Interner>::GenericArgs: UnwindSafe, <I as Interner>::ForeignId: UnwindSafe, <I as Interner>::Ty: UnwindSafe, <I as Interner>::Const: UnwindSafe, <I as Interner>::Pat: UnwindSafe, <I as Interner>::Region: UnwindSafe, <I as Interner>::FunctionId: UnwindSafe, <I as Interner>::BoundExistentialPredicates: UnwindSafe, <I as Interner>::ClosureId: UnwindSafe, <I as Interner>::CoroutineClosureId: UnwindSafe, <I as Interner>::CoroutineId: UnwindSafe, <I as Interner>::Tys: UnwindSafe, <I as Interner>::ParamTy: UnwindSafe, <I as Interner>::ErrorGuaranteed: UnwindSafe, <I as Interner>::BoundVarKinds: UnwindSafe, <I as Interner>::TraitAssocTyId: UnwindSafe, <I as Interner>::InherentAssocTyId: UnwindSafe, <I as Interner>::OpaqueTyId: UnwindSafe, <I as Interner>::FreeTyAliasId: UnwindSafe, <I as Interner>::DefId: UnwindSafe,

## Blanket Implementations§

§

### impl<T> Aligned for T

§

#### const ALIGN: Alignment

Alignment of `Self`.
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> AnyEq for T
where T: Any + PartialEq,

Source§

#### fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

#### fn as_any(&self) -> &(dyn Any + 'static)

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
Source§

### impl<T> CloneToUninit for T
where T: Clone,

Source§

#### unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (`clone_to_uninit`)
Performs copy-assignment from `self` to `dest`. Read more
Source§

### impl<T, R> CollectAndApply<T, R> for T

Source§

#### fn collect_and_apply<I, F>(iter: I, f: F) -> R
where I: Iterator<Item = T>, F: FnOnce(&[T]) -> R,

Equivalent to `f(&iter.collect::<Vec<_>>())`.

Source§

#### type Output = R

Source§

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

Source§

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

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

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

Source§

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

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

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

Source§

#### 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.

Source§

### impl<T> Instrument for T

Source§

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

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

#### 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.

Source§

### impl<T> IntoEither for T

Source§

#### fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts `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 more
Source§

#### fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts `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
Source§

### impl<T> Pointable for T

Source§

#### const ALIGN: usize

The alignment of pointer.
Source§

#### type Init = T

The type for initializers.
Source§

#### unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

#### unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

#### unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

#### unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

### impl<T> Same for T

Source§

#### type Output = T

Should always be `Self`
Source§

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

Source§

#### 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>,

Source§

#### 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>,

Source§

#### 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.
Source§

### impl<I, T, U> Upcast<I, U> for T
where U: UpcastFrom<I, T>,

Source§

#### fn upcast(self, interner: I) -> U

Source§

### impl<I, T> UpcastFrom<I, T> for T

Source§

#### fn upcast_from(from: T, _tcx: I) -> T

Source§

### impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

#### fn vzip(self) -> V

Source§

### impl<T> WithSubscriber for T

Source§

#### 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
Source§

#### fn with_current_subscriber(self) -> WithDispatch<Self>

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

### impl<T> ErasedDestructor for T
where T: 'static,

## Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.