A helper for printing a self-type qualified path as tokens.
extern crate syn;
extern crate quote;
use syn::{QSelf, Path, PathTokens};
use quote::{Tokens, ToTokens};
struct MyNode {
qself: Option<QSelf>,
path: Path,
}
impl ToTokens for MyNode {
fn to_tokens(&self, tokens: &mut Tokens) {
PathTokens(&self.qself, &self.path).to_tokens(tokens);
}
}
This type is available if Syn is built with the "derive"
or "full"
feature and the "printing"
feature.
Convert self
directly into a Tokens
object. Read more
Performs copy-assignment from source
. Read more