Enum darling::ast::GenericParam
source · [−]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
sourceimpl<T, L, C> Clone for GenericParam<T, L, C> where
T: Clone,
L: Clone,
C: Clone,
impl<T, L, C> Clone for GenericParam<T, L, C> where
T: Clone,
L: Clone,
C: Clone,
sourcefn clone(&self) -> GenericParam<T, L, C>
fn clone(&self) -> GenericParam<T, L, C>
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 more
sourceimpl<T> FromGenericParam for GenericParam<T, LifetimeDef, ConstParam> where
T: FromTypeParam,
impl<T> FromGenericParam for GenericParam<T, LifetimeDef, ConstParam> where
T: FromTypeParam,
fn from_generic_param(
param: &GenericParam
) -> Result<GenericParam<T, LifetimeDef, ConstParam>, Error>
sourceimpl<T> FromTypeParam for GenericParam<T, LifetimeDef, ConstParam> where
T: FromTypeParam,
impl<T> FromTypeParam for GenericParam<T, LifetimeDef, ConstParam> where
T: FromTypeParam,
fn from_type_param(
type_param: &TypeParam
) -> Result<GenericParam<T, LifetimeDef, ConstParam>, Error>
sourceimpl<T, L, C> GenericParamExt for GenericParam<T, L, C>
impl<T, L, C> GenericParamExt for GenericParam<T, L, C>
type TypeParam = T
type TypeParam = T
The type this GenericParam uses to represent type params and their bounds
type LifetimeDef = L
type ConstParam = C
sourcefn as_type_param(&self) -> Option<&T>
fn as_type_param(&self) -> Option<&T>
If this GenericParam is a type param, get the underlying value.
sourcefn as_lifetime_def(&self) -> Option<&L>
fn as_lifetime_def(&self) -> Option<&L>
If this GenericParam is a lifetime, get the underlying value.
sourcefn as_const_param(&self) -> Option<&C>
fn as_const_param(&self) -> Option<&C>
If this GenericParam is a const param, get the underlying value.
sourceimpl<T, L, C> PartialEq<GenericParam<T, L, C>> for GenericParam<T, L, C> where
T: PartialEq<T>,
L: PartialEq<L>,
C: PartialEq<C>,
impl<T, L, C> PartialEq<GenericParam<T, L, C>> for GenericParam<T, L, C> where
T: PartialEq<T>,
L: PartialEq<L>,
C: PartialEq<C>,
sourcefn eq(&self, other: &GenericParam<T, L, C>) -> bool
fn eq(&self, other: &GenericParam<T, L, C>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GenericParam<T, L, C>) -> bool
fn ne(&self, other: &GenericParam<T, L, C>) -> bool
This method tests for !=
.
impl<T, L, C> Eq for GenericParam<T, L, C> where
T: Eq,
L: Eq,
C: Eq,
impl<T, L, C> StructuralEq for GenericParam<T, L, C>
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more