MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / can_cast

Function can_cast

src/sql/src/plan/typeconv.rs:1570–1577  ·  view source on GitHub ↗

Reports whether it is possible to perform a cast from the specified types.

(
    ecx: &ExprContext,
    ccx: CastContext,
    cast_from: &SqlScalarType,
    cast_to: &SqlScalarType,
)

Source from the content-addressed store, hash-verified

1568
1569/// Reports whether it is possible to perform a cast from the specified types.
1570pub fn can_cast(
1571 ecx: &ExprContext,
1572 ccx: CastContext,
1573 cast_from: &SqlScalarType,
1574 cast_to: &SqlScalarType,
1575) -> bool {
1576 get_cast(ecx, ccx, cast_from, cast_to).is_ok()
1577}

Callers 3

accepts_typeMethod · 0.85
compatibleMethod · 0.85
guess_best_common_typeFunction · 0.85

Calls 1

get_castFunction · 0.85

Tested by

no test coverage detected