pub enum GenericParam<T = TypeParam, L = LifetimeDef, C = ConstParam> {
    Type(T),
    Lifetime(L),
    Const(C),
}
Expand description

A mirror of syn::GenericParam which is generic over all its contents.

Variants§

§

Type(T)

§

Lifetime(L)

§

Const(C)

Trait Implementations§

source§

impl<T, L, C> Clone for GenericParam<T, L, C>where T: Clone, L: Clone, C: Clone,

source§

fn clone(&self) -> GenericParam<T, L, C>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T, L, C> Debug for GenericParam<T, L, C>where T: Debug, L: Debug, C: Debug,

source§

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

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

impl<T> FromGenericParam for GenericParam<T>where T: FromTypeParam,

source§

impl<T> FromTypeParam for GenericParam<T>where T: FromTypeParam,

source§

impl<T, L, C> GenericParamExt for GenericParam<T, L, C>

§

type TypeParam = T

The type this GenericParam uses to represent type params and their bounds
§

type LifetimeDef = L

§

type ConstParam = C

source§

fn as_type_param(&self) -> Option<&T>

If this GenericParam is a type param, get the underlying value.
source§

fn as_lifetime_def(&self) -> Option<&L>

If this GenericParam is a lifetime, get the underlying value.
source§

fn as_const_param(&self) -> Option<&C>

If this GenericParam is a const param, get the underlying value.
source§

impl<T, L, C> PartialEq for GenericParam<T, L, C>where T: PartialEq, L: PartialEq, C: PartialEq,

source§

fn eq(&self, other: &GenericParam<T, L, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T, L, C> Eq for GenericParam<T, L, C>where T: Eq, L: Eq, C: Eq,

source§

impl<T, L, C> StructuralEq for GenericParam<T, L, C>

source§

impl<T, L, C> StructuralPartialEq for GenericParam<T, L, C>

Auto Trait Implementations§

§

impl<T, L, C> RefUnwindSafe for GenericParam<T, L, C>where C: RefUnwindSafe, L: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, L, C> Send for GenericParam<T, L, C>where C: Send, L: Send, T: Send,

§

impl<T, L, C> Sync for GenericParam<T, L, C>where C: Sync, L: Sync, T: Sync,

§

impl<T, L, C> Unpin for GenericParam<T, L, C>where C: Unpin, L: Unpin, T: Unpin,

§

impl<T, L, C> UnwindSafe for GenericParam<T, L, C>where C: UnwindSafe, L: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.