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

Interface Value

crates/gitql-core/src/values/base.rs:26–341  ·  view source on GitHub ↗

The in memory representation of the Values in the GitQL query engine

Source from the content-addressed store, hash-verified

24
25/// The in memory representation of the Values in the GitQL query engine
26pub trait Value: DynClone {
27 /// Return the literal representation for this [`Value`]
28 fn literal(&self) -> String;
29
30 /// Return if other [`Value`] is equal or not to current value
31 #[allow(clippy::borrowed_box)]
32 fn equals(&self, other: &Box<dyn Value>) -> bool;
33
34 /// Return the order between [`Value`] and the current value,
35 /// or None if they can't be ordered
36 #[allow(clippy::borrowed_box)]
37 fn compare(&self, other: &Box<dyn Value>) -> Option<Ordering>;
38
39 /// Return the [`DataType`] for the current [`Value`]
40 fn data_type(&self) -> Box<dyn DataType>;
41
42 /// Return the current value as dynamic [`Any`]
43 fn as_any(&self) -> &dyn Any;
44
45 /// Perform unary `=` operator and return new [`Value`] represent the result or Exception message as [`String`]
46 #[allow(unused_variables)]
47 #[allow(clippy::borrowed_box)]
48 fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
49 Err("Unsupported operator for this type".to_string())
50 }
51
52 /// Perform unary `-` operator and return new [`Value`] represent the result or Exception message as [`String`]
53 #[allow(unused_variables)]
54 #[allow(clippy::borrowed_box)]
55 fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
56 Err("Unsupported operator for this type".to_string())
57 }
58
59 /// Perform unary `*` operator and return new [`Value`] represent the result or Exception message as [`String`]
60 #[allow(unused_variables)]
61 #[allow(clippy::borrowed_box)]
62 fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
63 Err("Unsupported operator for this type".to_string())
64 }
65
66 /// Perform unary `/` operator and return new [`Value`] represent the result or Exception message as [`String`]
67 #[allow(unused_variables)]
68 #[allow(clippy::borrowed_box)]
69 fn div_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
70 Err("Unsupported operator for this type".to_string())
71 }
72
73 /// Perform unary `%` operator and return new [`Value`] represent the result or Exception message as [`String`]
74 #[allow(unused_variables)]
75 #[allow(clippy::borrowed_box)]
76 fn rem_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {
77 Err("Unsupported operator for this type".to_string())
78 }
79
80 /// Perform unary `^` operator and return new [`Value`] represent the result or Exception message as [`String`]
81 #[allow(unused_variables)]
82 #[allow(clippy::borrowed_box)]
83 fn caret_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> {

Callers 2

evaluate_comparisonFunction · 0.80

Implementers 14

diff_changes.rssrc/gitql/values/diff_changes.rs
boolean.rscrates/gitql-core/src/values/boolean.r
date.rscrates/gitql-core/src/values/date.rs
time.rscrates/gitql-core/src/values/time.rs
range.rscrates/gitql-core/src/values/range.rs
text.rscrates/gitql-core/src/values/text.rs
array.rscrates/gitql-core/src/values/array.rs
row.rscrates/gitql-core/src/values/row.rs
float.rscrates/gitql-core/src/values/float.rs
datetime.rscrates/gitql-core/src/values/datetime.
interval.rscrates/gitql-core/src/values/interval.
composite.rscrates/gitql-core/src/values/composite

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…