Struct impl_tools_lib::generics::TypeParam
source · [−]pub struct TypeParam {
pub attrs: Vec<Attribute>,
pub ident: Ident,
pub colon_token: Option<Colon>,
pub bounds: Punctuated<TypeParamBound, Add>,
pub eq_token: Option<Eq>,
pub default: Option<Type>,
}
Expand description
A generic type parameter: T: Into<String>
.
This is a custom variant of syn::TypeParam
which supports trait
as a parameter bound.
Fields
attrs: Vec<Attribute>
Type parameter attributes
ident: Ident
Type parameter identifier
colon_token: Option<Colon>
:
bounds: Punctuated<TypeParamBound, Add>
List of type bounds
eq_token: Option<Eq>
=
default: Option<Type>
Optional default value
Trait Implementations
sourceimpl ToTokensSubst for TypeParam
impl ToTokensSubst for TypeParam
sourcefn to_tokens_subst(&self, tokens: &mut TokenStream, subst: &TokenStream)
fn to_tokens_subst(&self, tokens: &mut TokenStream, subst: &TokenStream)
Write
self
to the given TokenStream
Auto Trait Implementations
impl RefUnwindSafe for TypeParam
impl !Send for TypeParam
impl !Sync for TypeParam
impl Unpin for TypeParam
impl UnwindSafe for TypeParam
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