MCPcopy Create free account
hub / github.com/AmrDeveloper/GQL / equals

Method equals

crates/gitql-ast/src/types/row.rs:31–53  ·  view source on GitHub ↗
(&self, other: &Box<dyn DataType>)

Source from the content-addressed store, hash-verified

29 }
30
31 fn equals(&self, other: &Box<dyn DataType>) -> bool {
32 let row_type: Box<dyn DataType> = Box::new(self.clone());
33 if other.is_any() || other.is_variant_contains(&row_type) {
34 return true;
35 }
36
37 if let Some(other_row) = other.as_any().downcast_ref::<RowType>() {
38 if self.tuple.len() != other_row.tuple.len() {
39 return false;
40 }
41
42 let len = self.tuple.len();
43 for i in 0..len {
44 if !self.tuple[i].eq(&other_row.tuple[i]) {
45 return false;
46 }
47 }
48
49 return true;
50 }
51
52 false
53 }
54
55 fn as_any(&self) -> &dyn Any {
56 self

Callers 14

evaluate_inFunction · 0.45
parse_in_expressionFunction · 0.45
parse_between_expressionFunction · 0.45
parse_case_expressionFunction · 0.45
cast_expression_or_errorFunction · 0.45
isemptyFunction · 0.45
array_removeFunction · 0.45
array_positionFunction · 0.45

Calls 5

is_anyMethod · 0.80
is_variant_containsMethod · 0.80
as_anyMethod · 0.45
lenMethod · 0.45
eqMethod · 0.45

Tested by

no test coverage detected