pub struct Location {
pub row: u32,
pub col: u32,
}
Expand description
Location of an Expression
in a Rego query.
// Create engine and evaluate " \n 1 + 2".
let results = Engine::new().eval_query(" \n 1 + 2".to_string(), false)?;
// Fetch the location for the expression.
let loc = &results.result[0].expressions[0].location;
assert_eq!(loc.row, 2);
assert_eq!(loc.col, 3);
See also QueryResult
.
Fields§
§row: u32
Line number. Starts at 1.
col: u32
Column number. Starts at 1.
Trait Implementations§
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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