pub enum ExprTarget<'a> {
Free,
Model(&'a ModelRoot),
Table(&'a Table),
Source(&'a SourceTable),
}Expand description
What an expression in the current scope references.
Determines how column and field references are resolved within an
ExprContext.
Variants§
Free
Expression does not reference any model or table.
Model(&'a ModelRoot)
Expression references a single model
Table(&'a Table)
Expression references a single table
Used primarily by database drivers
Source(&'a SourceTable)
Expression references a source table (a FROM clause with table references).
Implementations§
Source§impl<'a> ExprTarget<'a>
impl<'a> ExprTarget<'a>
Sourcepub fn as_model(self) -> Option<&'a ModelRoot>
pub fn as_model(self) -> Option<&'a ModelRoot>
Returns the model if this target is ExprTarget::Model, or None.
Sourcepub fn as_model_unwrap(self) -> &'a ModelRoot
pub fn as_model_unwrap(self) -> &'a ModelRoot
Sourcepub fn model_id(self) -> Option<ModelId>
pub fn model_id(self) -> Option<ModelId>
Returns the model ID if this target is ExprTarget::Model, or None.
Sourcepub fn as_table(self) -> Option<&'a Table>
pub fn as_table(self) -> Option<&'a Table>
Returns the table if this target is ExprTarget::Table, or None.
Sourcepub fn as_table_unwrap(self) -> &'a Table
pub fn as_table_unwrap(self) -> &'a Table
Trait Implementations§
Source§impl<'a> Clone for ExprTarget<'a>
impl<'a> Clone for ExprTarget<'a>
Source§fn clone(&self) -> ExprTarget<'a>
fn clone(&self) -> ExprTarget<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ExprTarget<'a>
impl<'a> Debug for ExprTarget<'a>
Source§impl<'a, T: Resolve> IntoExprTarget<'a, T> for ExprTarget<'a>
impl<'a, T: Resolve> IntoExprTarget<'a, T> for ExprTarget<'a>
Source§fn into_expr_target(self, schema: &'a T) -> ExprTarget<'a>
fn into_expr_target(self, schema: &'a T) -> ExprTarget<'a>
Converts
self into an ExprTarget using the provided schema.impl<'a> Copy for ExprTarget<'a>
Auto Trait Implementations§
impl<'a> Freeze for ExprTarget<'a>
impl<'a> RefUnwindSafe for ExprTarget<'a>
impl<'a> Send for ExprTarget<'a>
impl<'a> Sync for ExprTarget<'a>
impl<'a> Unpin for ExprTarget<'a>
impl<'a> UnwindSafe for ExprTarget<'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