pub fn all_items<'a>(
        &'a self,
        outer_scopes: &'a [Scope],
    ) -> impl Iterator<Item = (ColumnRef, usize, &ScopeItem)> + 'a {
        let mut lat_level = 0;
        iter::once(self)
            .chain(outer_scopes)
            .enumerate()
            .flat_map(move |(level, scope)| {
                if scope.lateral_barrier {
                    lat_level += 1;
                }
                scope
                    .items
                    .iter()
                    .enumerate()
                    .map(move |(column, item)| (ColumnRef { level, column }, lat_level, item))
            })
    }
/// Returns all items in the scope.
///
/// Items are returned in order of preference, where the innermost scope has
/// the highest preference. For example, given scopes `A(B(C))`, items are
/// presented in the order `C`, `B`, `A`.
///
/// Items are returned alongside the column reference that targets that item
/// and the item's "lateral level". The latter bears explaining. The lateral
/// level is the number of lateral barriers between this scope and the item.
/// See `Scope::lateral_barrier` for a diagram. Roughly speaking, items from
/// different levels but the same lateral level are items from different
/// joins in the same subquery, while items in different lateral levels are
/// items from different queries entirely. Rules about ambiguity apply
/// within an entire lateral level, not just within a single scope level.
///
/// NOTE(benesch): Scope` really shows its weaknesses here. Ideally we'd
/// have separate types like `QueryScope` and `JoinScope` that more
/// naturally encode the concept of a "lateral level", or at least something
/// along those lines.
Returns all items in the scope.
Items are returned in order of preference, where the innermost scope has
the highest preference.

Items are returned alongside the column reference that targets that item
and the item's "lateral level". The latter bears explaining. The lateral
level is the number of lateral barriers between this scope and the item.
See `Scope::lateral_barrier` for a diagram. Roughly speaking, items from
different levels but the same lateral level are items from different
joins in the same subquery, while items in different lateral levels are
items from different queries entirely. Rules about ambiguity apply
within an entire lateral level, not just within a single scope level.

Scope` really shows its weaknesses here. Ideally we'd
have separate types like `QueryScope` and `JoinScope` that more
naturally encode the concept of a "lateral level", or at least something
along those lines.
Returns all items in the scope . Items are returned in order of preference where the innermost scope has the highest preference . Items are returned alongside the column reference that targets that item and the item ' s " lateral level " . The latter bears explaining . The lateral level is the number of lateral barriers between this scope and the item . See ` Scope :: lateral_barrier ` for a diagram . Roughly speaking items from different levels but the same lateral level are items from different joins in the same subquery while items in different lateral levels are items from different queries entirely . Rules about ambiguity apply within an entire lateral level not just within a single scope level . Scope ` really shows its weaknesses here . Ideally we ' d have separate types like ` QueryScope ` and ` JoinScope ` that more naturally encode the concept of a " lateral level " or at least something along those lines .
pub fn all_items<'a>(
        &'a self,
        outer_scopes: &'a [Scope],
    ) -> impl Iterator<Item = (ColumnRef, usize, &ScopeItem)> + 'a {
        let mut lat_level = 0;
        iter::once(self)
            .chain(outer_scopes)
            .enumerate()
            .flat_map(move |(level, scope)| {
                if scope.lateral_barrier {
                    lat_level += 1;
                }
                scope
                    .items
                    .iter()
                    .enumerate()
                    .map(move |(column, item)| (ColumnRef { level, column }, lat_level, item))
            })
    }
pub fn all_items < ' a > ( & ' a self , outer_scopes : & ' a [ Scope ] , ) -> impl Iterator < Item = ( ColumnRef , usize , & ScopeItem ) > + ' a { let mut lat_level = 0 ; iter :: once ( self ) . chain ( outer_scopes ) . enumerate ( ) . flat_map ( move | ( level , scope ) | { if scope . lateral_barrier { lat_level += 1 ; } scope . items . iter ( ) . enumerate ( ) . map ( move | ( column , item ) | ( ColumnRef { level , column } , lat_level , item ) ) } ) }
Returns all items in the scope.
Returns all items in the scope .
&'a self
outer_scopes
&'a [Scope]
&'a self
outer_scopes
&'a [Scope]