Skip to main content

Location

Trait Location 

Source
pub trait Location: Clone {
    // Required method
    fn new<'a>(
        stack: impl Iterator<Item = &'a Self> + Clone,
        len: usize,
    ) -> Self
       where Self: 'a;
}
Expand description

trait for token location in the input stream

Required Methods§

Source

fn new<'a>(stack: impl Iterator<Item = &'a Self> + Clone, len: usize) -> Self
where Self: 'a,

Create a new merged location from len elements in the stack. The stack iterator should yield child locations in reverse order. That is, if the input [a, b, c, …, z] is fed and len is 3, stack.next() will yield z, then y, then x, and this function should return the merged location of [x, y, z].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> Location for Range<T>
where T: Clone + Default + Ord,

Source§

fn new<'a>( stack: impl Iterator<Item = &'a Range<T>> + Clone, len: usize, ) -> Range<T>
where Range<T>: 'a,

Implementors§