pub struct NormalizedExpr {
pub canonical_text: String,
pub ast_hash: [u8; 32],
}Expand description
A normalized SQL expression — its canonical text plus a hash of the canonical AST.
The ast_hash is a BLAKE3 hash of canonical_text (the canonical bytes after
keyword lowercasing, paren folding, cast stripping, and commutative-operand
sorting). Two expressions hash-equal iff their canonical texts match exactly,
so equivalence is decided byte-wise on the canonical form.
Fields§
§canonical_text: StringCanonical textual form (lowercased keywords, sorted commutative operands, stripped redundant casts).
ast_hash: [u8; 32]BLAKE3 hash of canonical_text as bytes.
Implementations§
Source§impl NormalizedExpr
impl NormalizedExpr
Sourcepub fn from_text(canonical_text: impl Into<String>) -> Self
pub fn from_text(canonical_text: impl Into<String>) -> Self
Construct from already-canonical text. The hash is computed from the text.
This constructor does NOT run any normalization passes — it assumes the
caller has already produced canonical form. Source-side construction goes
through pgevolve_core::parse::normalize_expr::from_pg_node which deparses
and normalizes a pg_query node.
Sourcepub fn from_canonical_text(text: impl Into<String>) -> Self
pub fn from_canonical_text(text: impl Into<String>) -> Self
Alias for Self::from_text, matching the phase-2 plan vocabulary.
Trait Implementations§
Source§impl Clone for NormalizedExpr
impl Clone for NormalizedExpr
Source§fn clone(&self) -> NormalizedExpr
fn clone(&self) -> NormalizedExpr
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 NormalizedExpr
impl Debug for NormalizedExpr
Source§impl<'de> Deserialize<'de> for NormalizedExpr
impl<'de> Deserialize<'de> for NormalizedExpr
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for NormalizedExpr
Source§impl Hash for NormalizedExpr
impl Hash for NormalizedExpr
Source§impl Ord for NormalizedExpr
impl Ord for NormalizedExpr
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NormalizedExpr
impl PartialEq for NormalizedExpr
Source§fn eq(&self, other: &NormalizedExpr) -> bool
fn eq(&self, other: &NormalizedExpr) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for NormalizedExpr
impl PartialOrd for NormalizedExpr
Source§impl Serialize for NormalizedExpr
impl Serialize for NormalizedExpr
impl StructuralPartialEq for NormalizedExpr
Auto Trait Implementations§
impl Freeze for NormalizedExpr
impl RefUnwindSafe for NormalizedExpr
impl Send for NormalizedExpr
impl Sync for NormalizedExpr
impl Unpin for NormalizedExpr
impl UnsafeUnpin for NormalizedExpr
impl UnwindSafe for NormalizedExpr
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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