pub trait DataType: DynClone {
Show 61 methods
// Required methods
fn literal(&self) -> String;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn equals(&self, other: &Box<dyn DataType>) -> bool { ... }
fn can_perform_add_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn add_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_sub_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn sub_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_mul_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn mul_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_div_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn div_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_rem_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn rem_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_caret_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn caret_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType> { ... }
fn can_perform_or_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn or_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_and_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn and_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_xor_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn xor_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_shl_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn shl_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_shr_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn shr_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType> { ... }
fn can_perform_logical_or_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn logical_or_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType> { ... }
fn can_perform_logical_and_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn logical_and_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType> { ... }
fn can_perform_logical_xor_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn logical_xor_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType> { ... }
fn can_perform_index_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn index_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType> { ... }
fn can_perform_slice_op(&self) -> bool { ... }
fn can_perform_slice_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_gt_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_gt_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_gte_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_gte_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_lt_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_lt_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_lte_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_group_lte_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_not_op(&self) -> bool { ... }
fn not_op_result_type(&self) -> Box<dyn DataType> { ... }
fn can_perform_neg_op(&self) -> bool { ... }
fn neg_op_result_type(&self) -> Box<dyn DataType> { ... }
fn can_perform_bang_op(&self) -> bool { ... }
fn bang_op_result_type(&self) -> Box<dyn DataType> { ... }
fn can_perform_contains_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn has_implicit_cast_from(&self, expr: &Box<dyn Expr>) -> bool { ... }
fn can_perform_explicit_cast_op_to(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_like_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_glob_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
fn can_perform_regexp_op_with(&self) -> Vec<Box<dyn DataType>> { ... }
}
Expand description
The in memory representation of the Data type in the GitQL query engine
Required Methods§
Provided Methods§
Sourcefn equals(&self, other: &Box<dyn DataType>) -> bool
fn equals(&self, other: &Box<dyn DataType>) -> bool
Return if other DataType
is equal or not to current Type
Sourcefn can_perform_add_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_add_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform +
operator with
between current DataType and any one of them
Sourcefn add_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn add_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform =
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_sub_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_sub_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform -
operator with
between current DataType and any one of them
Sourcefn sub_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn sub_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform -
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_mul_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_mul_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform *
operator with
between current DataType and any one of them
Sourcefn mul_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn mul_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform *
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_div_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_div_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform /
operator with
between current DataType and any one of them
Sourcefn div_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn div_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform /
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_rem_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_rem_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform %
operator with
between current DataType and any one of them
Sourcefn rem_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn rem_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform &
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_caret_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_caret_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform ^
operator with
between current DataType and any one of them
Sourcefn caret_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn caret_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform ^
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_or_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_or_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform |
operator with
between current DataType and any one of them
Sourcefn or_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn or_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform |
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_and_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_and_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform &
operator with
between current DataType and any one of them
Sourcefn and_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn and_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform &
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_xor_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_xor_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform #
operator with
between current DataType and any one of them
Sourcefn xor_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn xor_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform #
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_shl_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_shl_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform <<
operator with
between current DataType and any one of them
Sourcefn shl_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn shl_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform <<
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_shr_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_shr_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform >>
operator with
between current DataType and any one of them
Sourcefn shr_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn shr_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform >>
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_logical_or_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_logical_or_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform ||
or OR
operator with
between current DataType and any one of them
Sourcefn logical_or_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType>
fn logical_or_op_result_type( &self, other: &Box<dyn DataType>, ) -> Box<dyn DataType>
Return the expected type after perform ||
or OR
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_logical_and_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_logical_and_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform &&
or AND
operator with
between current DataType and any one of them
Sourcefn logical_and_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType>
fn logical_and_op_result_type( &self, other: &Box<dyn DataType>, ) -> Box<dyn DataType>
Return the expected type after perform &&
or AND
operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_logical_xor_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_logical_xor_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `XOR’ operator with between current DataType and any one of them
Sourcefn logical_xor_op_result_type(
&self,
other: &Box<dyn DataType>,
) -> Box<dyn DataType>
fn logical_xor_op_result_type( &self, other: &Box<dyn DataType>, ) -> Box<dyn DataType>
Return the expected type after perform ‘XOR’ operator between current type and argument type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_index_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_index_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `[I]’ operator with between current DataType and any one of them
Sourcefn index_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
fn index_op_result_type(&self, other: &Box<dyn DataType>) -> Box<dyn DataType>
Return the expected type after perform ‘[]’ operator on current type
other
- The index type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_slice_op(&self) -> bool
fn can_perform_slice_op(&self) -> bool
Return true if this type support Slice operator with
Sourcefn can_perform_slice_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_slice_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `[S : E]’ operator with between current DataType and any one of them
Sourcefn can_perform_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `=’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `= [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform !=' or
<>` operator with
between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_bang_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `!= [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `<=>’ operator with between current DataType and any one of them
No need to define the result type, it always IntType
Sourcefn can_perform_group_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_null_safe_eq_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `<=> [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always IntType
Sourcefn can_perform_gt_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_gt_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `>’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_gt_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_gt_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `> [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_gte_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_gte_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `>=’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_gte_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_gte_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `>= [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_lt_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_lt_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `<’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_lt_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_lt_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `< [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_lte_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_lte_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `=<’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_group_lte_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_group_lte_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `<= [ALL|ANY|SOME]’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_not_op(&self) -> bool
fn can_perform_not_op(&self) -> bool
Return a list of types that it’s possible to perform unary `NOT’ operator with between current DataType and any one of them
Sourcefn not_op_result_type(&self) -> Box<dyn DataType>
fn not_op_result_type(&self) -> Box<dyn DataType>
Return the expected type after perform unary `NOT’ operator on current type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_neg_op(&self) -> bool
fn can_perform_neg_op(&self) -> bool
Return a list of types that it’s possible to perform unary `-’ operator with between current DataType and any one of them
Sourcefn neg_op_result_type(&self) -> Box<dyn DataType>
fn neg_op_result_type(&self) -> Box<dyn DataType>
Return the expected type after perform unary `-’ operator on current type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_bang_op(&self) -> bool
fn can_perform_bang_op(&self) -> bool
Return a list of types that it’s possible to perform unary `!’ operator with between current DataType and any one of them
Sourcefn bang_op_result_type(&self) -> Box<dyn DataType>
fn bang_op_result_type(&self) -> Box<dyn DataType>
Return the expected type after perform unary `!’ operator on current type
Note that you don’t need to check again that the argument type is possible to perform operator with
Sourcefn can_perform_contains_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_contains_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform unary `@>’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn has_implicit_cast_from(&self, expr: &Box<dyn Expr>) -> bool
fn has_implicit_cast_from(&self, expr: &Box<dyn Expr>) -> bool
Return true if this Expression can be casted to the current type without any evaluation
For example casting Text with specific format to Date or Time
The result type is equal to the current type
Sourcefn can_perform_explicit_cast_op_to(&self) -> Vec<Box<dyn DataType>>
fn can_perform_explicit_cast_op_to(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform `Cast’ operator to
For example casting column with float value to integer or verse versa
The result type is equal to the current type
Sourcefn can_perform_like_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_like_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform unary `LIKE’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_glob_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_glob_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform unary `GLOB’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Sourcefn can_perform_regexp_op_with(&self) -> Vec<Box<dyn DataType>>
fn can_perform_regexp_op_with(&self) -> Vec<Box<dyn DataType>>
Return a list of types that it’s possible to perform unary `REGEXP’ operator with between current DataType and any one of them
No need to define the result type, it always BoolType
Implementations§
Source§impl dyn DataType
impl dyn DataType
Sourcepub fn is_date_time(&self) -> bool
pub fn is_date_time(&self) -> bool
Return true if this type is DateTimeType
Sourcepub fn is_interval(&self) -> bool
pub fn is_interval(&self) -> bool
Return true if this type is IntervalType
Sourcepub fn is_variant(&self) -> bool
pub fn is_variant(&self) -> bool
Return true if this type is VariantType
Sourcepub fn is_variant_with(&self, matcher: fn(&Box<dyn DataType>) -> bool) -> bool
pub fn is_variant_with(&self, matcher: fn(&Box<dyn DataType>) -> bool) -> bool
Return true if this type is VariantType
and applying the matcher function is return true on one of the variants
Sourcepub fn is_variant_contains(&self, other: &Box<dyn DataType>) -> bool
pub fn is_variant_contains(&self, other: &Box<dyn DataType>) -> bool
Return true if this type is VariantType
and contain specific type as one of it variants
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Return true if this type is OptionType
Sourcepub fn is_varargs(&self) -> bool
pub fn is_varargs(&self) -> bool
Return true if this type is VarargsType
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Return true if this type is CompositeType
Sourcepub fn is_undefined(&self) -> bool
pub fn is_undefined(&self) -> bool
Return true if this type is UndefType