Struct rustc_ast::tokenstream::AttrAnnotatedTokenStream
source · [−]pub struct AttrAnnotatedTokenStream(pub Lrc<Vec<(AttrAnnotatedTokenTree, Spacing)>>);
Expand description
A AttrAnnotatedTokenStream
is similar to a TokenStream
, but with extra
information about the tokens for attribute targets. This is used
during expansion to perform early cfg-expansion, and to process attributes
during proc-macro invocations.
Tuple Fields
0: Lrc<Vec<(AttrAnnotatedTokenTree, Spacing)>>
Implementations
sourceimpl AttrAnnotatedTokenStream
impl AttrAnnotatedTokenStream
pub fn new(
tokens: Vec<(AttrAnnotatedTokenTree, Spacing)>
) -> AttrAnnotatedTokenStream
sourcepub fn to_tokenstream(&self) -> TokenStream
pub fn to_tokenstream(&self) -> TokenStream
Converts this AttrAnnotatedTokenStream
to a plain TokenStream During conversion,
AttrAnnotatedTokenTree::Attributesget 'flattened' back to a
TokenStreamof the form
outer_attr attr_target`.
If there are inner attributes, they are inserted into the proper
place in the attribute target tokens.
Trait Implementations
sourceimpl Clone for AttrAnnotatedTokenStream
impl Clone for AttrAnnotatedTokenStream
sourcefn clone(&self) -> AttrAnnotatedTokenStream
fn clone(&self) -> AttrAnnotatedTokenStream
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 CreateTokenStream for AttrAnnotatedTokenStream
impl CreateTokenStream for AttrAnnotatedTokenStream
fn create_token_stream(&self) -> AttrAnnotatedTokenStream
sourceimpl Debug for AttrAnnotatedTokenStream
impl Debug for AttrAnnotatedTokenStream
sourceimpl<__D: Decoder> Decodable<__D> for AttrAnnotatedTokenStream
impl<__D: Decoder> Decodable<__D> for AttrAnnotatedTokenStream
sourceimpl Default for AttrAnnotatedTokenStream
impl Default for AttrAnnotatedTokenStream
sourcefn default() -> AttrAnnotatedTokenStream
fn default() -> AttrAnnotatedTokenStream
Returns the “default value” for a type. Read more
sourceimpl<__E: Encoder> Encodable<__E> for AttrAnnotatedTokenStream
impl<__E: Encoder> Encodable<__E> for AttrAnnotatedTokenStream
sourceimpl From<(AttrAnnotatedTokenTree, Spacing)> for AttrAnnotatedTokenStream
impl From<(AttrAnnotatedTokenTree, Spacing)> for AttrAnnotatedTokenStream
sourcefn from(
(tree, spacing): (AttrAnnotatedTokenTree, Spacing)
) -> AttrAnnotatedTokenStream
fn from(
(tree, spacing): (AttrAnnotatedTokenTree, Spacing)
) -> AttrAnnotatedTokenStream
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for AttrAnnotatedTokenStream
impl !Send for AttrAnnotatedTokenStream
impl !Sync for AttrAnnotatedTokenStream
impl Unpin for AttrAnnotatedTokenStream
impl !UnwindSafe for AttrAnnotatedTokenStream
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
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes