Trait ParseBufferExtension

Source
pub trait ParseBufferExtension<'a> {
    // Required method
    fn get_self(&self) -> &ParseBuffer<'a>;

    // Provided methods
    fn parse_arg(&self) -> Result<TokenStream> { ... }
    fn fork_arg(&self) -> Result<ParseBuffer<'a>> { ... }
    fn is_end_of_arg(&self) -> bool { ... }
    fn is_empty_group(&self) -> bool { ... }
}

Required Methods§

Source

fn get_self(&self) -> &ParseBuffer<'a>

Provided Methods§

Source

fn parse_arg(&self) -> Result<TokenStream>

Advance the buffer until we reach a comma or the end of the buffer. Returns the consumed tokens as a TokenStream.

Source

fn fork_arg(&self) -> Result<ParseBuffer<'a>>

Fork the current buffer and move the original buffer to the end of the argument.

Source

fn is_end_of_arg(&self) -> bool

Source

fn is_empty_group(&self) -> bool

Check if the next token is an empty group.

Implementations on Foreign Types§

Source§

impl<'a> ParseBufferExtension<'a> for ParseBuffer<'a>

Source§

fn get_self(&self) -> &ParseBuffer<'a>

Implementors§