pub struct ImplToken {
pub attributes: HashMap<String, AttrToken>,
pub generics: Option<GenericParams>,
pub name: TokenTree,
pub for_ty: Option<TyToken>,
pub raw_block: TokenStream,
pub functions: Vec<MethodDeclToken>,
}
Expand description
AST Token to store information about an
impl
block.
Reference: https://doc.rust-lang.org/stable/reference/items/implementations.html
Fields§
§attributes: HashMap<String, AttrToken>
§generics: Option<GenericParams>
§name: TokenTree
The name of the impl Block
for_ty: Option<TyToken>
for the type where the impl block is implemented for
raw_block: TokenStream
Content of the impl block
It is stored the raw block because the kparser library expose all the primitive to parse this kind of token tree, and this will make a slim version of the library.
functions: Vec<MethodDeclToken>
Trait Implementations§
Source§impl From<ImplToken> for TopLevelNode
impl From<ImplToken> for TopLevelNode
Source§impl TopLevelAST for ImplToken
impl TopLevelAST for ImplToken
Source§impl TryFrom<&TokenStream> for ImplToken
impl TryFrom<&TokenStream> for ImplToken
Source§type Error = KParserError
type Error = KParserError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ImplToken
impl RefUnwindSafe for ImplToken
impl !Send for ImplToken
impl !Sync for ImplToken
impl Unpin for ImplToken
impl UnwindSafe for ImplToken
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