Skip to main content

LintDocument

Struct LintDocument 

Source
pub struct LintDocument<'a> {
    pub sql: &'a str,
    pub source_sql: Option<&'a str>,
    pub source_statement_ranges: Vec<Option<Range<usize>>>,
    pub dialect: Dialect,
    pub statements: Vec<LintStatement<'a>>,
    pub tokens: Vec<LintToken>,
    pub raw_tokens: Vec<TokenWithSpan>,
    pub noqa: NoqaMap,
    pub parser_fallback_used: bool,
    pub tokenizer_fallback_used: bool,
}
Expand description

Normalized lint input model for a single SQL source.

Fields§

§sql: &'a str§source_sql: Option<&'a str>§source_statement_ranges: Vec<Option<Range<usize>>>§dialect: Dialect§statements: Vec<LintStatement<'a>>§tokens: Vec<LintToken>§raw_tokens: Vec<TokenWithSpan>§noqa: NoqaMap§parser_fallback_used: bool§tokenizer_fallback_used: bool

Implementations§

Source§

impl<'a> LintDocument<'a>

Source

pub fn new( sql: &'a str, dialect: Dialect, statements: Vec<LintStatement<'a>>, ) -> Self

Build a lint document from source SQL and parsed statements.

Source

pub fn new_with_parser_fallback( sql: &'a str, dialect: Dialect, statements: Vec<LintStatement<'a>>, parser_fallback_used: bool, ) -> Self

Build a lint document with parser fallback provenance metadata.

Source

pub fn new_with_parser_fallback_and_source( sql: &'a str, source_sql: Option<&'a str>, dialect: Dialect, statements: Vec<LintStatement<'a>>, parser_fallback_used: bool, source_statement_ranges: Option<Vec<Option<Range<usize>>>>, ) -> Self

Build a lint document with parser fallback metadata and optional untemplated source mapping.

Auto Trait Implementations§

§

impl<'a> Freeze for LintDocument<'a>

§

impl<'a> RefUnwindSafe for LintDocument<'a>

§

impl<'a> Send for LintDocument<'a>

§

impl<'a> Sync for LintDocument<'a>

§

impl<'a> Unpin for LintDocument<'a>

§

impl<'a> UnsafeUnpin for LintDocument<'a>

§

impl<'a> UnwindSafe for LintDocument<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.