pub type TokenTreesView<'a> = TokenTreesView<'a, SpanData<SyntaxContext>>;
Aliased Type§
struct TokenTreesView<'a>(/* private fields */);
Implementations
§impl<'a, S> TokenTreesView<'a, S>where
S: Copy,
impl<'a, S> TokenTreesView<'a, S>where
S: Copy,
pub fn new(tts: &'a [TokenTree<S>]) -> TokenTreesView<'a, S>
pub fn iter(&self) -> TtIter<'a, S> ⓘ
pub fn cursor(&self) -> Cursor<'a, S>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn try_into_subtree(self) -> Option<SubtreeView<'a, S>>
pub fn strip_invisible(self) -> TokenTreesView<'a, S>
pub fn flat_tokens(&self) -> &'a [TokenTree<S>]
pub fn flat_tokens(&self) -> &'a [TokenTree<S>]
This returns a flat structure of tokens (subtrees will be represented by a single node
preceding their children), so it isn’t suited for most use cases, only for matching leaves
at the beginning/end with no subtrees before them. If you need a structured pass, use [TtIter
].