pub struct TokenBuffer { /* private fields */ }
Available on crate feature
parsing
only.Expand description
A buffer that can be efficiently traversed multiple times, unlike
TokenStream
which requires a deep copy in order to traverse more than
once.
Implementations§
Source§impl TokenBuffer
impl TokenBuffer
Sourcepub fn new(stream: TokenStream) -> Self
Available on crate feature proc-macro
only.
pub fn new(stream: TokenStream) -> Self
proc-macro
only.Creates a TokenBuffer
containing all the tokens from the input
proc_macro::TokenStream
.
Sourcepub fn new2(stream: TokenStream) -> Self
pub fn new2(stream: TokenStream) -> Self
Creates a TokenBuffer
containing all the tokens from the input
proc_macro2::TokenStream
.
Auto Trait Implementations§
impl Freeze for TokenBuffer
impl RefUnwindSafe for TokenBuffer
impl !Send for TokenBuffer
impl !Sync for TokenBuffer
impl Unpin for TokenBuffer
impl UnwindSafe for TokenBuffer
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
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: 16 bytes