pub enum GenericParamDefKind {
    Lifetime {
        outlives: Vec<String>,
    },
    Type {
        bounds: Vec<GenericBound>,
        default: Option<Type>,
        synthetic: bool,
    },
    Const {
        type_: Type,
        default: Option<String>,
    },
}

Variants

Lifetime

Fields

outlives: Vec<String>

Type

Fields

bounds: Vec<GenericBound>
default: Option<Type>
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

Fields

type_: Type
default: Option<String>

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.