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
sourceimpl Clone for GenericParamDefKind
impl Clone for GenericParamDefKind
sourcefn clone(&self) -> GenericParamDefKind
fn clone(&self) -> GenericParamDefKind
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for GenericParamDefKind
impl Debug for GenericParamDefKind
sourceimpl<'de> Deserialize<'de> for GenericParamDefKind
impl<'de> Deserialize<'de> for GenericParamDefKind
sourcefn 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
sourceimpl Hash for GenericParamDefKind
impl Hash for GenericParamDefKind
sourceimpl PartialEq<GenericParamDefKind> for GenericParamDefKind
impl PartialEq<GenericParamDefKind> for GenericParamDefKind
sourcefn eq(&self, other: &GenericParamDefKind) -> bool
fn eq(&self, other: &GenericParamDefKind) -> bool
sourceimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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