Skip to main content

TokenStream

Trait TokenStream 

Source
pub trait TokenStream {
    type Error;

    // Required method
    fn append(
        &mut self,
        ty: TokenType,
        value: Option<&str>,
    ) -> Result<(), Self::Error>;

    // Provided method
    fn comma<I, C: ToSqlContext>(
        &mut self,
        items: I,
        context: &C,
    ) -> Result<(), Self::Error>
       where I: IntoIterator,
             I::Item: ToTokens { ... }
}
Expand description

Stream of token

Required Associated Types§

Source

type Error

Potential error raised

Required Methods§

Source

fn append( &mut self, ty: TokenType, value: Option<&str>, ) -> Result<(), Self::Error>

Push token to this stream

Provided Methods§

Source

fn comma<I, C: ToSqlContext>( &mut self, items: I, context: &C, ) -> Result<(), Self::Error>
where I: IntoIterator, I::Item: ToTokens,

Interspace iterator with commas

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§