pub struct ExprValidator<'a> { /* private fields */ }Expand description
Validates expressions using schema information
Implementations§
Source§impl<'a> ExprValidator<'a>
impl<'a> ExprValidator<'a>
Sourcepub fn new(schema: &'a ExprSchema) -> Self
pub fn new(schema: &'a ExprSchema) -> Self
Creates a new validator
Sourcepub fn add_udf(
&mut self,
name: impl Into<String>,
return_type: ExprDataType,
parameter_types: Vec<ExprDataType>,
) -> &mut Self
pub fn add_udf( &mut self, name: impl Into<String>, return_type: ExprDataType, parameter_types: Vec<ExprDataType>, ) -> &mut Self
Adds a user-defined function
Sourcepub fn validate_expr(&self, expr: &Expr) -> Result<InferredType>
pub fn validate_expr(&self, expr: &Expr) -> Result<InferredType>
Validates an expression and infers its type
Sourcepub fn validate_projections(
&self,
projections: &[ColumnProjection],
) -> Result<HashMap<String, InferredType>>
pub fn validate_projections( &self, projections: &[ColumnProjection], ) -> Result<HashMap<String, InferredType>>
Validates a list of projections
Auto Trait Implementations§
impl<'a> Freeze for ExprValidator<'a>
impl<'a> RefUnwindSafe for ExprValidator<'a>
impl<'a> Send for ExprValidator<'a>
impl<'a> Sync for ExprValidator<'a>
impl<'a> Unpin for ExprValidator<'a>
impl<'a> UnsafeUnpin for ExprValidator<'a>
impl<'a> UnwindSafe for ExprValidator<'a>
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> 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