pub struct Cast {
pub this: Expression,
pub to: DataType,
pub trailing_comments: Vec<String>,
pub double_colon_syntax: bool,
pub format: Option<Box<Expression>>,
pub default: Option<Box<Expression>>,
}Expand description
Represent a type cast expression.
Covers both the standard CAST(expr AS type) syntax and the PostgreSQL
shorthand expr::type. Also used as the payload for TryCast and
SafeCast variants. Supports optional FORMAT (BigQuery) and DEFAULT ON
CONVERSION ERROR (Oracle) clauses.
Fields§
§this: ExpressionThe expression being cast.
to: DataTypeThe target data type.
trailing_comments: Vec<String>§double_colon_syntax: boolWhether PostgreSQL :: syntax was used (true) vs CAST() function (false)
format: Option<Box<Expression>>FORMAT clause for BigQuery: CAST(x AS STRING FORMAT ‘format_string’)
default: Option<Box<Expression>>DEFAULT value ON CONVERSION ERROR (Oracle): CAST(x AS type DEFAULT val ON CONVERSION ERROR)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cast
impl<'de> Deserialize<'de> for Cast
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Cast
Auto Trait Implementations§
impl Freeze for Cast
impl RefUnwindSafe for Cast
impl Send for Cast
impl Sync for Cast
impl Unpin for Cast
impl UnwindSafe for Cast
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