pub struct AnalysisOptions {
pub dialect: DialectMode,
pub warn_shadowing: bool,
pub parameter_hints: BTreeMap<SmolStr, Type>,
}Expand description
Full set of analysis options for a single file.
All fields that affect any derived query MUST appear here so that a digest change automatically invalidates everything downstream.
parameter_hints uses BTreeMap (not HashMap) to guarantee that
the digest is independent of insertion order (spec §8 determinism).
Fields§
§dialect: DialectModeDialect used for gate checks (§9). Defaults to DialectMode::GqlAligned.
warn_shadowing: boolWarn when a variable in an inner scope shadows one in an outer scope.
parameter_hints: BTreeMap<SmolStr, Type>Caller-supplied type hints for query parameters.
Stored in a BTreeMap so digest computation is order-independent.
Implementations§
Source§impl AnalysisOptions
impl AnalysisOptions
Sourcepub fn digest(&self) -> u64
pub fn digest(&self) -> u64
Compute a stable, deterministic 64-bit digest of these options.
Uses FNV-1a (64-bit) over a canonical byte encoding. The encoding is deliberately simple and stable across process restarts because:
std::collections::hash_map::DefaultHasheris NOT stable across runs (Rust explicitly reserves the right to change it).- No external hashing crate is required: FNV-1a is trivial to inline and has no dependencies.
§Canonical encoding
[dialect_u8] [warn_shadowing_u8]
[num_hints_le64]
for each (key, ty) in parameter_hints (BTreeMap order = lex):
[key_len_le64] [key_utf8_bytes] [type_tag_u8]Trait Implementations§
Source§impl Clone for AnalysisOptions
impl Clone for AnalysisOptions
Source§fn clone(&self) -> AnalysisOptions
fn clone(&self) -> AnalysisOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnalysisOptions
impl Debug for AnalysisOptions
Source§impl Default for AnalysisOptions
impl Default for AnalysisOptions
Source§fn default() -> AnalysisOptions
fn default() -> AnalysisOptions
Source§impl PartialEq for AnalysisOptions
impl PartialEq for AnalysisOptions
Source§fn eq(&self, other: &AnalysisOptions) -> bool
fn eq(&self, other: &AnalysisOptions) -> bool
self and other values to be equal, and is used by ==.impl Eq for AnalysisOptions
impl StructuralPartialEq for AnalysisOptions
Auto Trait Implementations§
impl Freeze for AnalysisOptions
impl RefUnwindSafe for AnalysisOptions
impl Send for AnalysisOptions
impl Sync for AnalysisOptions
impl Unpin for AnalysisOptions
impl UnsafeUnpin for AnalysisOptions
impl UnwindSafe for AnalysisOptions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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