pub struct FieldRef {
pub table: Option<NameKey>,
pub name: NameKey,
}Expand description
An unresolved field reference as written in DAX or in a report binding.
Holds the logical name: quote-unescaping ('' → ') is the producer’s job — the
DAX lexer or the PBIR parser — so 'Sales''s Data'[Amount] arrives here as the table
name Sales's Data. Display re-applies the escaping.
Unresolved means the reference has not yet been bound to an ObjectId: [Total]
could be a measure or a column of the current row context.
§Examples
use ripbi_core::{FieldRef, NameKey};
let qualified = FieldRef {
table: Some(NameKey::new("Sales's Data")),
name: NameKey::new("Amount"),
};
// Display re-applies DAX quoting, doubling the internal quote.
assert_eq!(qualified.to_string(), "'Sales''s Data'[Amount]");
let unqualified = FieldRef { table: None, name: NameKey::new("Total") };
assert_eq!(unqualified.to_string(), "[Total]");Fields§
§table: Option<NameKey>Qualifying table, if the reference was written qualified.
'Sales'[Amount] → Some("Sales"); [Total] → None.
name: NameKeyThe column or measure name inside the square brackets.
Trait Implementations§
Source§impl Display for FieldRef
impl Display for FieldRef
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Emits valid DAX. Table names are always single-quoted — quoting is optional in
DAX only for names without spaces or punctuation, so quoting unconditionally is
always correct. The bracketed part is not escaped: ] cannot appear in an
Analysis Services object name, so there is nothing to escape.
impl Eq for FieldRef
impl StructuralPartialEq for FieldRef
Auto Trait Implementations§
impl Freeze for FieldRef
impl RefUnwindSafe for FieldRef
impl Send for FieldRef
impl Sync for FieldRef
impl Unpin for FieldRef
impl UnsafeUnpin for FieldRef
impl UnwindSafe for FieldRef
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.