pub enum GenericParamDefKind {
Lifetime {
outlives: Vec<String>,
},
Type {
bounds: Vec<GenericBound>,
default: Option<Type>,
synthetic: bool,
},
Const {
type_: Type,
default: Option<String>,
},
}
Variants§
Lifetime
Type
Fields
§
bounds: Vec<GenericBound>
§
synthetic: bool
This is normally false
, which means that this generic parameter is
declared in the Rust source text.
If it is true
, this generic parameter has been introduced by the
compiler behind the scenes.
Example
Consider
ⓘ
pub fn f(_: impl Trait) {}
The compiler will transform this behind the scenes to
ⓘ
pub fn f<impl Trait: Trait>(_: impl Trait) {}
In this example, the generic parameter named impl Trait
(and which
is bound by Trait
) is synthetic, because it was not originally in
the Rust source text.
Const
Trait Implementations§
source§impl Clone for GenericParamDefKind
impl Clone for GenericParamDefKind
source§fn clone(&self) -> GenericParamDefKind
fn clone(&self) -> GenericParamDefKind
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for GenericParamDefKind
impl Debug for GenericParamDefKind
source§impl<'de> Deserialize<'de> for GenericParamDefKind
impl<'de> Deserialize<'de> for GenericParamDefKind
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for GenericParamDefKind
impl Hash for GenericParamDefKind
source§impl PartialEq<GenericParamDefKind> for GenericParamDefKind
impl PartialEq<GenericParamDefKind> for GenericParamDefKind
source§fn eq(&self, other: &GenericParamDefKind) -> bool
fn eq(&self, other: &GenericParamDefKind) -> bool
source§impl Serialize for GenericParamDefKind
impl Serialize for GenericParamDefKind
impl Eq for GenericParamDefKind
impl StructuralEq for GenericParamDefKind
impl StructuralPartialEq for GenericParamDefKind
Auto Trait Implementations§
impl RefUnwindSafe for GenericParamDefKind
impl Send for GenericParamDefKind
impl Sync for GenericParamDefKind
impl Unpin for GenericParamDefKind
impl UnwindSafe for GenericParamDefKind
Blanket Implementations§
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 136 bytes
Size for each variant:
Lifetime
: 31 bytesType
: 135 bytesConst
: 135 bytes