pub trait ToTokens: Display {
// Required method
fn to_tokens<S: TokenStream + ?Sized, C: ToSqlContext>(
&self,
s: &mut S,
context: &C,
) -> Result<(), S::Error>;
// Provided method
fn displayer<'a, 'b, C: ToSqlContext>(
&'b self,
ctx: &'a C,
) -> SqlDisplayer<'a, 'b, C, Self>
where Self: Sized { ... }
}Expand description
Generate token(s) from AST node Also implements Display to make sure devs won’t forget Display
Required Methods§
Sourcefn to_tokens<S: TokenStream + ?Sized, C: ToSqlContext>(
&self,
s: &mut S,
context: &C,
) -> Result<(), S::Error>
fn to_tokens<S: TokenStream + ?Sized, C: ToSqlContext>( &self, s: &mut S, context: &C, ) -> Result<(), S::Error>
Send token(s) to the specified stream with context
Provided Methods§
fn displayer<'a, 'b, C: ToSqlContext>(
&'b self,
ctx: &'a C,
) -> SqlDisplayer<'a, 'b, C, Self>where
Self: Sized,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".