On this page
Trait std::marker::ConstParamTy
pub trait ConstParamTy: StructuralEq + StructuralPartialEq + Eq { }
🔬This is a nightly-only experimental API. (
adt_const_params
#95174)
A marker for types which can be used as types of const
generic parameters.
These types must have a proper equivalence relation (Eq
) and it must be automatically derived (StructuralPartialEq
). There’s a hard-coded check in the compiler ensuring that all fields are also ConstParamTy
, which implies that recursively, all fields are StructuralPartialEq
.
Object Safety
This trait is not object safe.
Implementors
impl ConstParamTy for bool
impl ConstParamTy for char
impl ConstParamTy for i8
impl ConstParamTy for i16
impl ConstParamTy for i32
impl ConstParamTy for i64
impl ConstParamTy for i128
impl ConstParamTy for isize
impl ConstParamTy for str
impl ConstParamTy for u8
impl ConstParamTy for u16
impl ConstParamTy for u32
impl ConstParamTy for u64
impl ConstParamTy for u128
impl ConstParamTy for ()
impl ConstParamTy for usize
impl ConstParamTy for Assume
impl<T> ConstParamTy for &T
where
T: ConstParamTy + ?Sized,
impl<T> ConstParamTy for [T]
where
T: ConstParamTy,
impl<T> ConstParamTy for (T₁, T₂, …, Tₙ)
where
T: ConstParamTy,
This trait is implemented for tuples up to twelve items long.
impl<T, const N: usize> ConstParamTy for [T; N]
where
T: ConstParamTy,
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/marker/trait.ConstParamTy.html