pub struct Expression { /* private fields */ }Expand description
RAII wrapper for a duckdb_expression.
Automatically destroyed when dropped.
Implementations§
Source§impl Expression
impl Expression
Sourcepub const unsafe fn from_raw(raw: duckdb_expression) -> Self
pub const unsafe fn from_raw(raw: duckdb_expression) -> Self
Wraps a raw duckdb_expression handle, taking ownership.
§Safety
raw must be a valid duckdb_expression returned by a DuckDB API call
(e.g. duckdb_scalar_function_bind_get_argument). The caller must not
destroy the handle after this call.
Sourcepub const fn as_raw(&self) -> duckdb_expression
pub const fn as_raw(&self) -> duckdb_expression
Returns the raw handle without consuming the Expression.
Sourcepub fn return_type(&self) -> Option<LogicalType>
pub fn return_type(&self) -> Option<LogicalType>
Returns the static return type of this expression, or None if the
handle is null.
Sourcepub fn is_foldable(&self) -> bool
pub fn is_foldable(&self) -> bool
Sourcepub fn fold(&self, context: &ClientContext) -> Result<Value, ErrorData>
pub fn fold(&self, context: &ClientContext) -> Result<Value, ErrorData>
Folds this (constant) expression into a single Value.
Only valid when is_foldable returns true.
§Errors
Returns the structured ErrorData if folding fails (for example because
the expression is not constant).
Trait Implementations§
Source§impl Drop for Expression
impl Drop for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl !Send for Expression
impl !Sync for Expression
impl Unpin for Expression
impl UnsafeUnpin for Expression
impl UnwindSafe for Expression
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