pub struct PathTokens<'a>(pub &'a Option<QSelf>, pub &'a Path);
Expand description
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.
Tuple Fields§
§0: &'a Option<QSelf>
§1: &'a Path
Trait Implementations§
Source§impl<'a> Clone for PathTokens<'a>
impl<'a> Clone for PathTokens<'a>
Source§fn clone(&self) -> PathTokens<'a>
fn clone(&self) -> PathTokens<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for PathTokens<'a>
impl<'a> Debug for PathTokens<'a>
Source§impl<'a> Hash for PathTokens<'a>
impl<'a> Hash for PathTokens<'a>
Source§impl<'a> PartialEq for PathTokens<'a>
impl<'a> PartialEq for PathTokens<'a>
Source§impl<'a> ToTokens for PathTokens<'a>
impl<'a> ToTokens for PathTokens<'a>
impl<'a> Eq for PathTokens<'a>
impl<'a> StructuralPartialEq for PathTokens<'a>
Auto Trait Implementations§
impl<'a> Freeze for PathTokens<'a>
impl<'a> RefUnwindSafe for PathTokens<'a>
impl<'a> !Send for PathTokens<'a>
impl<'a> !Sync for PathTokens<'a>
impl<'a> Unpin for PathTokens<'a>
impl<'a> UnwindSafe for PathTokens<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Spanned for Twhere
T: ToTokens,
impl<T> Spanned for Twhere
T: ToTokens,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.