pub enum CastMode {
Normal,
Try,
}Expand description
Whether DuckDB wants cast failures thrown or collected.
In Try mode, conversion failures should write NULL for
the failed row and call CastFunctionInfo::set_row_error, and the
callback should still return false if any row failed. See CastFn for
what DuckDB does with the callback’s return value in each mode — in
particular, returning false in Try mode does not null anything.
Variants§
Normal
Failures are errors: a regular CAST, including the implicit casts
DuckDB inserts into a query.
Try
Failures are collected: TRY_CAST, and the casts DuckDB applies to
single values internally (Value::CastAs, as when a table function’s
argument is converted to its parameter type), which throw when the
callback returns false.
Trait Implementations§
impl Copy for CastMode
impl Eq for CastMode
impl StructuralPartialEq for CastMode
Auto Trait Implementations§
impl Freeze for CastMode
impl RefUnwindSafe for CastMode
impl Send for CastMode
impl Sync for CastMode
impl Unpin for CastMode
impl UnsafeUnpin for CastMode
impl UnwindSafe for CastMode
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