pub struct TypeAlias {
pub attributes: Vec<Attribute>,
pub vis_marker: Option<VisMarker>,
pub tk_type: Ident,
pub name: Ident,
pub bound: Option<GenericBound>,
pub tk_equals: Option<Punct>,
pub initializer_ty: Option<TypeExpr>,
pub tk_semicolon: Punct,
}
Expand description
Type definition.
Handles both associated types (in impl
blocks) or type aliases (globally).
See also https://doc.rust-lang.org/reference/items/type-aliases.html.
Example input:
type MyType = i32;
Fields§
§attributes: Vec<Attribute>
§vis_marker: Option<VisMarker>
§tk_type: Ident
§name: Ident
§bound: Option<GenericBound>
§tk_equals: Option<Punct>
§initializer_ty: Option<TypeExpr>
§tk_semicolon: Punct
Trait Implementations§
Source§impl ToTokens for TypeAlias
impl ToTokens for TypeAlias
Source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for TypeAlias
impl RefUnwindSafe for TypeAlias
impl !Send for TypeAlias
impl !Sync for TypeAlias
impl Unpin for TypeAlias
impl UnwindSafe for TypeAlias
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