pub struct Scope {
pub bindings: IndexMap<String, Binding>,
pub cte_columns: IndexMap<String, Vec<String>>,
}Fields§
§bindings: IndexMap<String, Binding>§cte_columns: IndexMap<String, Vec<String>>CTE projection columns, keyed by CTE name. Empty Vec means the
CTE is declared in this statement but the resolver did not (yet)
inspect its body to learn its columns. Callers should treat
Some(empty) as “exists but unknown” and None as “no such CTE”.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn get(&self, name: &str) -> Option<&Binding>
pub fn get(&self, name: &str) -> Option<&Binding>
Case-insensitive lookup by alias or bare table name. SQL folds
unquoted identifiers (PG: lowercase, ANSI: upper), so the user
typing U. must resolve a binding declared as u. The fast
exact-match path runs first; a linear case-insensitive scan
covers the cold path.
pub fn tables(&self) -> impl Iterator<Item = &Binding>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn cte_columns_of(&self, name: &str) -> Option<&Vec<String>>
pub fn cte_columns_of(&self, name: &str) -> Option<&Vec<String>>
CTE columns for name, in projection order. Returns None when
the CTE was not declared in this scope; Some(empty) when it
was declared but the resolver could not parse its body yet.
Matches case-insensitively for the same reason as [get].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more