Type Alias TopSubtree

Source
pub type TopSubtree = TopSubtree<Span>;

Aliased Type§

struct TopSubtree(pub Box<[TokenTree<SpanData<SyntaxContext>>]>);

Fields§

§0: Box<[TokenTree<SpanData<SyntaxContext>>]>

Implementations

§

impl<S> TopSubtree<S>

pub fn subtree_as_debug_string(&self, subtree_idx: usize) -> String

A simple line string used for debugging

§

impl<S> TopSubtree<S>
where S: Copy,

pub fn empty(span: DelimSpan<S>) -> TopSubtree<S>

pub fn invisible_from_leaves<const N: usize>( delim_span: S, leaves: [Leaf<S>; N], ) -> TopSubtree<S>

pub fn from_token_trees( delimiter: Delimiter<S>, token_trees: TokenTreesView<'_, S>, ) -> TopSubtree<S>

pub fn from_subtree(subtree: SubtreeView<'_, S>) -> TopSubtree<S>

pub fn view(&self) -> SubtreeView<'_, S>

pub fn iter(&self) -> TtIter<'_, S>

pub fn top_subtree(&self) -> &Subtree<S>

pub fn top_subtree_delimiter_mut(&mut self) -> &mut Delimiter<S>

pub fn token_trees(&self) -> TokenTreesView<'_, S>

Trait Implementations§

Source§

impl ToTokenTree for TopSubtree

Source§

fn to_tokens(self, _: Span, builder: &mut TopSubtreeBuilder)

§

impl<S> Clone for TopSubtree<S>
where S: Clone,

§

fn clone(&self) -> TopSubtree<S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<S> Debug for TopSubtree<S>
where S: Debug + Copy,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<S> Display for TopSubtree<S>
where S: Display + Copy,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<S> Hash for TopSubtree<S>
where S: Hash,

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<S> PartialEq for TopSubtree<S>
where S: PartialEq,

§

fn eq(&self, other: &TopSubtree<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<S> Eq for TopSubtree<S>
where S: Eq,

§

impl<S> StructuralPartialEq for TopSubtree<S>