Struct sqruff_lib::core::rules::context::RuleContext
source · pub struct RuleContext {
pub dialect: Dialect,
pub fix: bool,
pub templated_file: Option<TemplatedFile>,
pub path: Option<String>,
pub config: FluffConfig,
pub segment: Box<dyn Segment>,
pub parent_stack: Vec<Box<dyn Segment>>,
pub raw_stack: Vec<Box<dyn Segment>>,
pub memory: HashMap<String, String>,
pub segment_idx: usize,
}
Expand description
Struct for holding the context passed to rule eval function
Fields§
§dialect: Dialect
§fix: bool
§templated_file: Option<TemplatedFile>
§path: Option<String>
§config: FluffConfig
§segment: Box<dyn Segment>
segment: The segment in question
parent_stack: Vec<Box<dyn Segment>>
parent_stack: A tuple of the path from the root to this segment.
raw_stack: Vec<Box<dyn Segment>>
raw_stack: All of the raw segments so far in the file
memory: HashMap<String, String>
memory: Arbitrary storage for the rule
segment_idx: usize
segment_idx: The index of this segment in the parent
Implementations§
source§impl RuleContext
impl RuleContext
pub fn siblings_post(&self) -> Vec<Box<dyn Segment>>
Trait Implementations§
source§impl Clone for RuleContext
impl Clone for RuleContext
source§fn clone(&self) -> RuleContext
fn clone(&self) -> RuleContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RuleContext
impl Debug for RuleContext
Auto Trait Implementations§
impl !RefUnwindSafe for RuleContext
impl !Send for RuleContext
impl !Sync for RuleContext
impl Unpin for RuleContext
impl !UnwindSafe for RuleContext
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