Enum Returning
pub enum Returning {
Model {
include: Vec<Path>,
},
Changed,
Project(Expr),
Expr(Expr),
}Expand description
Variants§
Model
Return the full model with the specified association includes.
Changed
Return whether the operation changed any rows.
Project(Expr)
Return the result of evaluating an expression against the source rows.
Expr(Expr)
Return a fixed expression, independent of the statement source.
Implementations§
§impl Returning
impl Returning
pub fn from_project_iter<T>(items: impl IntoIterator<Item = T>) -> Returning
pub fn from_project_iter<T>(items: impl IntoIterator<Item = T>) -> Returning
Creates a Returning::Project from an iterator of expressions, combining
them into a record expression.
pub fn model_includes(&self) -> &[Path]
pub fn model_includes(&self) -> &[Path]
Returns the association include paths for a Model variant, or an
empty slice for other variants.
pub fn model_includes_mut_unwrap(&mut self) -> &mut Vec<Path>
pub fn model_includes_mut_unwrap(&mut self) -> &mut Vec<Path>
Returns a mutable reference to the Model variant’s include paths.
§Panics
Panics if this is not the Model variant.
pub fn is_changed(&self) -> bool
pub fn is_changed(&self) -> bool
Returns true if this is the Changed variant.
pub fn is_project(&self) -> bool
pub fn is_project(&self) -> bool
Returns true if this is the Project variant.
pub fn as_project(&self) -> Option<&Expr>
pub fn as_project(&self) -> Option<&Expr>
Returns a reference to the inner expression if this is the Project
variant.
pub fn as_project_unwrap(&self) -> &Expr
pub fn as_project_unwrap(&self) -> &Expr
pub fn as_project_mut(&mut self) -> Option<&mut Expr>
pub fn as_project_mut(&mut self) -> Option<&mut Expr>
Returns a mutable reference to the inner expression if this is the
Project variant.
pub fn as_project_mut_unwrap(&mut self) -> &mut Expr
pub fn as_project_mut_unwrap(&mut self) -> &mut Expr
Returns a mutable reference to the inner expression.
§Panics
Panics if this is not the Project variant.
pub fn set_project(&mut self, expr: impl Into<Expr>)
pub fn set_project(&mut self, expr: impl Into<Expr>)
Replaces this returning clause with Returning::Project containing the
given expression.