pub struct TypeParam {
pub attrs: Vec<Attribute>,
pub ident: Ident,
pub colon_token: Option<Colon>,
pub bounds: Punctuated<TypeParamBound, Plus>,
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, Plus>
List of type bounds
eq_token: Option<Eq>
=
default: Option<Type>
Optional default value
Trait Implementations§
Source§impl ToTokensSubst for TypeParam
impl ToTokensSubst for TypeParam
Source§fn 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 Freeze for TypeParam
impl RefUnwindSafe for TypeParam
impl !Send for TypeParam
impl !Sync for TypeParam
impl Unpin for TypeParam
impl UnwindSafe for TypeParam
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more