pub struct TokenStream(/* private fields */);Implementations§
Source§impl TokenStream
impl TokenStream
pub fn new() -> Self
pub fn iter(&self) -> impl Iterator<Item = &TokenTree>
pub fn is_empty(&self) -> bool
pub fn starts_with_whitespace(&self) -> bool
pub fn ends_with_whitespace(&self) -> bool
pub fn push_ident(&mut self, ident: IdentToken)
pub fn push_literal(&mut self, literal: Literal)
pub fn push_punct(&mut self, punct: Punct)
pub fn push_trivia(&mut self, trivia: Trivia)
pub fn push_group(&mut self, group: Group)
pub fn push(&mut self, tree: TokenTree)
Trait Implementations§
Source§impl Clone for TokenStream
impl Clone for TokenStream
Source§fn clone(&self) -> TokenStream
fn clone(&self) -> TokenStream
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TokenStream
impl Debug for TokenStream
Source§impl Default for TokenStream
impl Default for TokenStream
Source§fn default() -> TokenStream
fn default() -> TokenStream
Returns the “default value” for a type. Read more
Source§impl Display for TokenStream
impl Display for TokenStream
impl Eq for TokenStream
Source§impl Extend<TokenStream> for TokenStream
impl Extend<TokenStream> for TokenStream
Source§fn extend<T: IntoIterator<Item = TokenStream>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = TokenStream>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl Extend<TokenTree> for TokenStream
impl Extend<TokenTree> for TokenStream
Source§fn extend<T: IntoIterator<Item = TokenTree>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = TokenTree>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<TokenTree> for TokenStream
impl FromIterator<TokenTree> for TokenStream
Source§impl IntoIterator for TokenStream
impl IntoIterator for TokenStream
Source§impl Parse for TokenStream
impl Parse for TokenStream
fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
Source§impl PartialEq for TokenStream
impl PartialEq for TokenStream
impl StructuralPartialEq for TokenStream
Source§impl ToCells for TokenStream
impl ToCells for TokenStream
Source§fn to_cells(&self, output: &mut CellStream)
fn to_cells(&self, output: &mut CellStream)
Appends this value’s global cells to
output.Source§fn to_cell_stream(&self, source_id: SourceId) -> CellStream
fn to_cell_stream(&self, source_id: SourceId) -> CellStream
Emits this value into a fresh cell stream with the requested identity.
Source§impl ToTokens for TokenStream
impl ToTokens for TokenStream
Auto Trait Implementations§
impl Freeze for TokenStream
impl RefUnwindSafe for TokenStream
impl Send for TokenStream
impl Sync for TokenStream
impl Unpin for TokenStream
impl UnsafeUnpin for TokenStream
impl UnwindSafe for TokenStream
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