pub struct ExprCast {
pub expr: Box<Expr>,
pub from: Option<Type>,
pub ty: Type,
}Expand description
A type cast expression.
Converts an expression’s value to a different type.
§Examples
cast(x, i64) // cast `x` to `i64`
cast(y, string) // cast `y` to `string`Fields§
§expr: Box<Expr>The expression to cast.
from: Option<Type>The source type, when the value alone cannot direct the conversion.
Most casts are directed by the target type and the value’s own shape,
and leave this None. The exception is a #[document] column’s
lowering cast (Type::Model → Type::Object): the structural target
does not name the embedded model and a positional Value::Record is
not self-describing, so the cast carries the model-level source type
to resolve the embed’s field names.
ty: TypeThe target type.
Trait Implementations§
impl StructuralPartialEq for ExprCast
Auto Trait Implementations§
impl Freeze for ExprCast
impl RefUnwindSafe for ExprCast
impl Send for ExprCast
impl Sync for ExprCast
impl Unpin for ExprCast
impl UnsafeUnpin for ExprCast
impl UnwindSafe for ExprCast
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