pub struct ExpressionReferences<'expr> { /* private fields */ }
Expand description
A collection of all the references that an expression makes to variables and functions.
Implementations§
Source§impl<'expr> ExpressionReferences<'expr>
impl<'expr> ExpressionReferences<'expr>
Sourcepub fn has_variable(&self, name: impl AsRef<str>) -> bool
pub fn has_variable(&self, name: impl AsRef<str>) -> bool
Returns true if the expression references the provided variable name.
§Example
let expression = parse("foo.bar == true").unwrap();
let references = expression.references();
assert!(references.has_variable("foo"));
Sourcepub fn has_function(&self, name: impl AsRef<str>) -> bool
pub fn has_function(&self, name: impl AsRef<str>) -> bool
Returns true if the expression references the provided variable name.
§Example
let expression = parse("size(foo) > 0").unwrap();
let references = expression.references();
assert!(references.has_function("size"));
Auto Trait Implementations§
impl<'expr> Freeze for ExpressionReferences<'expr>
impl<'expr> RefUnwindSafe for ExpressionReferences<'expr>
impl<'expr> Send for ExpressionReferences<'expr>
impl<'expr> Sync for ExpressionReferences<'expr>
impl<'expr> Unpin for ExpressionReferences<'expr>
impl<'expr> UnwindSafe for ExpressionReferences<'expr>
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
Mutably borrows from an owned value. Read more