pub enum RawRef<'a> {
Field {
table: Option<&'a str>,
name: &'a str,
span: Range<usize>,
},
Table {
name: &'a str,
span: Range<usize>,
},
Function {
name: &'a str,
span: Range<usize>,
},
}Expand description
One object reference found in an expression, exactly as written.
Names are raw source slices: delimiters are stripped, but quote escapes are
left intact ('It''s' yields "It''s"). unescape_name and
RawRef::to_field_ref produce the logical names that FieldRef and the
rest of the identity layer expect.
Extraction is purely syntactic and knows nothing about any model: whether a bracketed name is a column or a measure, and whether an identifier names a real table or function at all, is decided by resolution, not here.
Variants§
Field
A column or measure reference: 'Table'[Name], Table[Name], or an
unqualified [Name]. table is None exactly when the reference was
written unqualified.
Fields
Table
A bare table use: COUNTROWS(Sales), EVALUATE Sales. Detected so that a
table referenced only this way is never reported unused.
Fields
Function
A function call: an identifier followed by (. Whether this is a
user-defined function of the model (a real dependency) or a built-in
(SUM, COUNTROWS, …) is decided by resolution.
Implementations§
Source§impl RawRef<'_>
impl RawRef<'_>
Sourcepub fn to_field_ref(&self) -> Option<FieldRef>
pub fn to_field_ref(&self) -> Option<FieldRef>
The logical FieldRef of a RawRef::Field — delimiters stripped and
quote escapes resolved, per the identity layer’s producer contract.
None for RawRef::Table and RawRef::Function, which name no
column or measure.
Trait Implementations§
impl<'a> Eq for RawRef<'a>
impl<'a> StructuralPartialEq for RawRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for RawRef<'a>
impl<'a> RefUnwindSafe for RawRef<'a>
impl<'a> Send for RawRef<'a>
impl<'a> Sync for RawRef<'a>
impl<'a> Unpin for RawRef<'a>
impl<'a> UnsafeUnpin for RawRef<'a>
impl<'a> UnwindSafe for RawRef<'a>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.