Enum ExprSet
pub enum ExprSet {
Select(Box<Select>),
SetOp(ExprSetOp),
Update(Box<Update>),
Values(Values),
Insert(Box<Insert>),
}Expand description
A set of rows produced by a query, set operation, or explicit values.
Represents the different ways to produce a collection of rows in SQL.
§Examples
SELECT * FROM users // ExprSet::Select
SELECT ... UNION SELECT ... // ExprSet::SetOp
VALUES (1, 'a'), (2, 'b') // ExprSet::ValuesVariants§
Select(Box<Select>)
A select query, possibly with a filter.
SetOp(ExprSetOp)
A set operation (union, intersection, …) on two queries.
Update(Box<Update>)
An update expression.
Values(Values)
Explicitly listed values (as expressions).
Insert(Box<Insert>)
An insert statement (used for UNION-style batch inserts)
Implementations§
§impl ExprSet
impl ExprSet
pub fn values(values: impl Into<Values>) -> ExprSet
pub fn is_values(&self) -> bool
pub fn is_values(&self) -> bool
Returns true if this is an ExprSet::Values variant.
§Examples
let values = ExprSet::values(Values::default());
assert!(values.is_values());
let select = ExprSet::from(toasty_core::schema::db::TableId(0));
assert!(!select.is_values());pub fn as_values(&self) -> Option<&Values>
pub fn as_values(&self) -> Option<&Values>
Returns a reference to the inner Values if this is an ExprSet::Values.
Returns None for all other ExprSet variants.
pub fn as_values_unwrap(&self) -> &Values
pub fn as_values_unwrap(&self) -> &Values
pub fn as_values_mut(&mut self) -> &mut Values
pub fn into_values(self) -> Values
pub fn is_const(&self) -> bool
§impl ExprSet
impl ExprSet
pub fn as_select(&self) -> Option<&Select>
pub fn as_select_unwrap(&self) -> &Select
pub fn as_select_mut(&mut self) -> Option<&mut Select>
pub fn as_select_mut_unwrap(&mut self) -> &mut Select
pub fn into_select(self) -> Select
pub fn is_select(&self) -> bool
Trait Implementations§
§impl From<SourceModel> for ExprSet
impl From<SourceModel> for ExprSet
§fn from(value: SourceModel) -> ExprSet
fn from(value: SourceModel) -> ExprSet
Converts to this type from the input type.
§impl<'a, T> IntoExprTarget<'a, T> for &'a ExprSetwhere
T: Resolve,
impl<'a, T> IntoExprTarget<'a, T> for &'a ExprSetwhere
T: Resolve,
fn into_expr_target(self, schema: &'a T) -> ExprTarget<'a>
§impl<T, const N: usize> Like<[T; N]> for ExprSetwhere
Expr: Like<T>,
Support for matching ExprSet against arrays of any length using const generics
impl<T, const N: usize> Like<[T; N]> for ExprSetwhere
Expr: Like<T>,
Support for matching ExprSet against arrays of any length using const generics
§impl<T> Like<Vec<T>> for ExprSetwhere
Expr: Like<T>,
Support for matching ExprSet against Vec patterns
impl<T> Like<Vec<T>> for ExprSetwhere
Expr: Like<T>,
Support for matching ExprSet against Vec patterns
impl StructuralPartialEq for ExprSet
Auto Trait Implementations§
impl Freeze for ExprSet
impl RefUnwindSafe for ExprSet
impl Send for ExprSet
impl Sync for ExprSet
impl Unpin for ExprSet
impl UnwindSafe for ExprSet
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