Does `self` accept arguments of type `t`?
(&self, ecx: &ExprContext, t: &SqlScalarType)
| 753 | impl ParamType { |
| 754 | /// Does `self` accept arguments of type `t`? |
| 755 | fn accepts_type(&self, ecx: &ExprContext, t: &SqlScalarType) -> bool { |
| 756 | use ParamType::*; |
| 757 | use SqlScalarType::*; |
| 758 | |
| 759 | match self { |
| 760 | Any | AnyElement | AnyCompatible | ListElementAnyCompatible => true, |
| 761 | ArrayAny | ArrayAnyCompatible => matches!(t, Array(..) | Int2Vector), |
| 762 | ListAny | ListAnyCompatible => matches!(t, List { .. }), |
| 763 | MapAny | MapAnyCompatible => matches!(t, Map { .. }), |
| 764 | RangeAny | RangeAnyCompatible => matches!(t, Range { .. }), |
| 765 | NonVecAny | NonVecAnyCompatible => !t.is_vec(), |
| 766 | Internal => false, |
| 767 | Plain(to) => typeconv::can_cast(ecx, CastContext::Implicit, t, to), |
| 768 | RecordAny => matches!(t, Record { .. }), |
| 769 | } |
| 770 | } |
| 771 | |
| 772 | /// Does `t`'s [`TypeCategory`] prefer `self`? This question can make |
| 773 | /// more sense with the understanding that pseudotypes are never preferred. |
no test coverage detected