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§
Sourcefn new<'a>(stack: impl Iterator<Item = &'a Self> + Clone, len: usize) -> Selfwhere
Self: 'a,
fn new<'a>(stack: impl Iterator<Item = &'a Self> + Clone, len: usize) -> Selfwhere
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", so this trait is not object safe.