Struct sqruff_lib::core::parser::segments::meta::MetaSegment
source · pub struct MetaSegment<M> { /* private fields */ }Implementations§
source§impl MetaSegment<TemplateSegment>
impl MetaSegment<TemplateSegment>
pub fn template( pos_marker: PositionMarker, source_str: &str, block_type: &str, ) -> Self
source§impl MetaSegment<IndentChange>
impl MetaSegment<IndentChange>
pub fn from_kind(kind: IndentChange) -> Self
pub fn indent() -> Self
pub fn dedent() -> Self
pub fn implicit_indent() -> Self
Trait Implementations§
source§impl<M: Clone> Clone for MetaSegment<M>
impl<M: Clone> Clone for MetaSegment<M>
source§fn clone(&self) -> MetaSegment<M>
fn clone(&self) -> MetaSegment<M>
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<M: Debug> Debug for MetaSegment<M>
impl<M: Debug> Debug for MetaSegment<M>
source§impl<M: MetaSegmentKind> Deref for MetaSegment<M>
impl<M: MetaSegmentKind> Deref for MetaSegment<M>
source§impl<M: Hash> Hash for MetaSegment<M>
impl<M: Hash> Hash for MetaSegment<M>
source§impl<M: MetaSegmentKind + Send + Sync> Matchable for MetaSegment<M>
impl<M: MetaSegmentKind + Send + Sync> Matchable for MetaSegment<M>
fn simple( &self, _parse_context: &ParseContext<'_>, _crumbs: Option<Vec<&str>>, ) -> Option<(AHashSet<String>, SyntaxSet)>
fn match_segments( &self, _segments: &[ErasedSegment], _idx: u32, _parse_context: &mut ParseContext<'_>, ) -> Result<MatchResult, SQLParseError>
fn mk_from_segments(&self, segments: Vec<ErasedSegment>) -> ErasedSegment
fn get_type(&self) -> SyntaxKind
fn match_grammar(&self) -> Option<Arc<dyn Matchable>>
fn hack_eq(&self, rhs: &Arc<dyn Matchable>) -> bool
fn is_optional(&self) -> bool
fn cache_key(&self) -> MatchableCacheKey
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<M: PartialEq> PartialEq for MetaSegment<M>
impl<M: PartialEq> PartialEq for MetaSegment<M>
source§impl<M: MetaSegmentKind + Send + Sync> Segment for MetaSegment<M>
impl<M: MetaSegmentKind + Send + Sync> Segment for MetaSegment<M>
fn get_type(&self) -> SyntaxKind
fn is_code(&self) -> bool
fn is_meta(&self) -> bool
fn get_position_marker(&self) -> Option<PositionMarker>
fn set_position_marker(&mut self, position_marker: Option<PositionMarker>)
fn segments(&self) -> &[ErasedSegment]
source§fn get_raw_segments(&self) -> Vec<ErasedSegment>
fn get_raw_segments(&self) -> Vec<ErasedSegment>
Iterate raw segments, mostly for searching. Read more
fn get_uuid(&self) -> Uuid
fn new(&self, _segments: Vec<ErasedSegment>) -> ErasedSegment
fn copy(&self, _segments: Vec<ErasedSegment>) -> ErasedSegment
fn can_start_end_non_code(&self) -> bool
fn dialect(&self) -> DialectKind
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 raw_segments_with_ancestors( &self, ) -> &OnceCell<Vec<(ErasedSegment, Vec<PathStep>)>>
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<SyntaxSet>, pass_through: bool, ) -> Vec<ErasedSegment>
fn code_indices(&self) -> Vec<usize>
fn get_parent(&self) -> Option<ErasedSegment>
fn child(&self, seg_types: SyntaxSet) -> Option<ErasedSegment>
fn children(&self, seg_types: SyntaxSet) -> Vec<ErasedSegment>
fn iter_patches(&self, templated_file: &TemplatedFile) -> Vec<FixPatch>
fn descendant_type_set(&self) -> &SyntaxSet
fn raw(&self) -> Cow<'_, str>
fn get_raw_upper(&self) -> Option<String>
fn first_non_whitespace_segment_raw_upper(&self) -> Option<String>
fn is_type(&self, type_: SyntaxKind) -> bool
fn is_comment(&self) -> bool
fn is_whitespace(&self) -> bool
fn get_default_raw(&self) -> Option<&'static str>
fn set_segments(&mut self, _segments: Vec<ErasedSegment>)
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 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 get_source_fixes(&self) -> Vec<SourceFix>
fn get_source_fixes(&self) -> Vec<SourceFix>
Return any source fixes as list.
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 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) -> SyntaxSet
fn combined_types(&self) -> SyntaxSet
fn class_types(&self) -> SyntaxSet
impl<M> StructuralPartialEq for MetaSegment<M>
Auto Trait Implementations§
impl<M> Freeze for MetaSegment<M>where
M: Freeze,
impl<M> RefUnwindSafe for MetaSegment<M>where
M: RefUnwindSafe,
impl<M> Send for MetaSegment<M>where
M: Send,
impl<M> Sync for MetaSegment<M>where
M: Sync,
impl<M> Unpin for MetaSegment<M>where
M: Unpin,
impl<M> UnwindSafe for MetaSegment<M>where
M: UnwindSafe,
Blanket Implementations§
source§impl<T> AsAnyMut for Twhere
T: Any,
impl<T> AsAnyMut for Twhere
T: Any,
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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