Struct sqruff_lib::dialects::ansi::Node
source · pub struct Node<T> {
pub uuid: Uuid,
pub position_marker: Option<PositionMarker>,
pub raw: OnceLock<String>,
pub source_fixes: Vec<SourceFix>,
/* private fields */
}
Fields§
§uuid: Uuid
§position_marker: Option<PositionMarker>
§raw: OnceLock<String>
§source_fixes: Vec<SourceFix>
Implementations§
source§impl Node<FromClauseSegment>
impl Node<FromClauseSegment>
pub fn eventual_aliases(&self) -> Vec<(ErasedSegment, AliasInfo)>
source§impl Node<SelectClauseElementSegment>
impl Node<SelectClauseElementSegment>
pub fn alias(&self) -> Option<ColumnAliasInfo>
source§impl Node<FromExpressionElementSegment>
impl Node<FromExpressionElementSegment>
pub fn eventual_alias(&self) -> AliasInfo
source§impl Node<ObjectReferenceSegment>
impl Node<ObjectReferenceSegment>
pub fn is_qualified(&self) -> bool
pub fn qualification(&self) -> &'static str
pub fn extract_possible_references( &self, level: ObjectReferenceLevel, dialect: &str ) -> Vec<ObjectReferencePart>
pub fn extract_possible_multipart_references( &self, levels: &[ObjectReferenceLevel] ) -> Vec<Vec<ObjectReferencePart>>
pub fn iter_raw_references(&self) -> Vec<ObjectReferencePart>
Trait Implementations§
source§impl<T: 'static + NodeTrait + Send + Sync> Matchable for Node<T>
impl<T: 'static + NodeTrait + Send + Sync> Matchable for Node<T>
fn mk_from_segments(&self, segments: Vec<ErasedSegment>) -> ErasedSegment
fn hack_eq(&self, rhs: &Arc<dyn Matchable>) -> bool
fn is_optional(&self) -> bool
fn simple( &self, parse_context: &ParseContext<'_>, crumbs: Option<Vec<&str>> ) -> Option<(AHashSet<String>, AHashSet<String>)>
fn match_segments( &self, segments: &[ErasedSegment], parse_context: &mut ParseContext<'_> ) -> Result<MatchResult, SQLParseError>
fn cache_key(&self) -> Option<Uuid>
fn copy( &self, _insert: Option<Vec<Arc<dyn Matchable>>>, _at: Option<usize>, _before: Option<Arc<dyn Matchable>>, _remove: Option<Vec<Arc<dyn Matchable>>>, _terminators: Vec<Arc<dyn Matchable>>, _replace_terminators: bool ) -> Arc<dyn Matchable>
source§impl<T> PartialEq for Node<T>
impl<T> PartialEq for Node<T>
source§impl<T: NodeTrait + 'static + Send + Sync> Segment for Node<T>
impl<T: NodeTrait + 'static + Send + Sync> Segment for Node<T>
fn new(&self, segments: Vec<ErasedSegment>) -> ErasedSegment
source§fn edit(
&self,
raw: Option<String>,
source_fixes: Option<Vec<SourceFix>>
) -> ErasedSegment
fn edit( &self, raw: Option<String>, source_fixes: Option<Vec<SourceFix>> ) -> ErasedSegment
Stub.
source§fn get_source_fixes(&self) -> Vec<SourceFix>
fn get_source_fixes(&self) -> Vec<SourceFix>
Return any source fixes as list.
fn raw(&self) -> Cow<'_, str>
fn match_grammar(&self) -> Option<Arc<dyn Matchable>>
fn get_type(&self) -> &'static str
fn get_position_marker(&self) -> Option<PositionMarker>
fn set_position_marker(&mut self, position_marker: Option<PositionMarker>)
fn segments(&self) -> &[ErasedSegment]
fn get_uuid(&self) -> Option<Uuid>
fn class_types(&self) -> AHashSet<&'static str>
fn reference(&self) -> Node<ObjectReferenceSegment>
fn type_name(&self) -> &'static str
fn get_start_loc(&self) -> (usize, usize)
fn get_end_loc(&self) -> (usize, usize)
fn to_serialised( &self, code_only: bool, show_raw: bool, include_meta: bool ) -> TupleSerialisedSegment
fn select_children( &self, start_seg: Option<&ErasedSegment>, stop_seg: Option<&ErasedSegment>, select_if: Option<fn(_: &ErasedSegment) -> bool>, loop_while: Option<fn(_: &ErasedSegment) -> bool> ) -> Vec<ErasedSegment>
fn is_templated(&self) -> bool
fn iter_segments( &self, expanding: Option<&[&str]>, pass_through: bool ) -> Vec<ErasedSegment>
fn recursive_crawl_all(&self, reverse: bool) -> Vec<ErasedSegment>
fn recursive_crawl( &self, seg_types: &[&str], recurse_into: bool, no_recursive_seg_type: Option<&str>, allow_self: bool ) -> Vec<ErasedSegment>
fn code_indices(&self) -> Vec<usize>
fn get_parent(&self) -> Option<ErasedSegment>
fn child(&self, seg_types: &[&str]) -> Option<ErasedSegment>
fn children(&self, seg_types: &[&str]) -> Vec<ErasedSegment>
fn iter_patches(&self, templated_file: &TemplatedFile) -> Vec<FixPatch>
fn descendant_type_set(&self) -> AHashSet<&'static str>
fn get_raw_upper(&self) -> Option<String>
fn first_non_whitespace_segment_raw_upper(&self) -> Option<String>
fn is_type(&self, type_: &str) -> bool
fn is_code(&self) -> bool
fn is_comment(&self) -> bool
fn is_whitespace(&self) -> bool
fn is_meta(&self) -> bool
fn get_default_raw(&self) -> Option<&'static str>
fn gather_segments(&self) -> Vec<ErasedSegment>
source§fn get_matched_length(&self) -> usize
fn get_matched_length(&self) -> usize
Return the length of the segment in characters.
source§fn get_can_start_end_non_code(&self) -> bool
fn get_can_start_end_non_code(&self) -> bool
Are we able to have non-code at the start or end?
source§fn get_allow_empty(&self) -> bool
fn get_allow_empty(&self) -> bool
Can we allow it to be empty? Usually used in combination with the
can_start_end_non_code.
source§fn get_file_path(&self) -> Option<String>
fn get_file_path(&self) -> Option<String>
get_file_path returns the file path of the segment if it is a file
segment.
source§fn get_raw_segments(&self) -> Vec<ErasedSegment>
fn get_raw_segments(&self) -> Vec<ErasedSegment>
Iterate raw segments, mostly for searching. Read more
source§fn iter_source_fix_patches(
&self,
templated_file: &TemplatedFile
) -> Vec<FixPatch>
fn iter_source_fix_patches( &self, templated_file: &TemplatedFile ) -> Vec<FixPatch>
Yield any source patches as fixes now. Read more
source§fn compute_anchor_edit_info(
&self,
fixes: &Vec<LintFix>
) -> AHashMap<Uuid, AnchorEditInfo>
fn compute_anchor_edit_info( &self, fixes: &Vec<LintFix> ) -> AHashMap<Uuid, AnchorEditInfo>
Group and count fixes by anchor, return dictionary.
fn instance_types(&self) -> AHashSet<&'static str>
fn combined_types(&self) -> AHashSet<&'static str>
fn apply_fixes( &self, dialect: &Dialect, fixes: AHashMap<Uuid, AnchorEditInfo> ) -> (ErasedSegment, Vec<ErasedSegment>, Vec<ErasedSegment>, bool)
Auto Trait Implementations§
impl<T> !Freeze for Node<T>
impl<T> !RefUnwindSafe for Node<T>
impl<T> Send for Node<T>where
T: Send,
impl<T> Sync for Node<T>where
T: Sync,
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> !UnwindSafe for Node<T>
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
source§impl<T> CloneSegment for Twhere
T: Segment,
impl<T> CloneSegment for Twhere
T: Segment,
fn clone_box(&self) -> ErasedSegment
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more